Agent-based simulation in cyber-physical energy systems is a challenging task, often involving multiple dimensions and layers, heterogeneous actors, and large-scale systems, to serve as an effective analysis tool. It is also hard to compare multi-agent systems because most simulations use complex, non-reusable agent environments. To address these problems, a simulation framework that supports not only complex simulation but also reusable environments for agent systems is needed. This paper describes a Julia-based simulation framework for agent-based simulations of cyber-physical (energy) systems, featuring an environment API that enables the creation of reusable environments. For this purpose, an event-based architecture for agent-environment interaction is proposed, implemented in a framework, and demonstrated as a showcase.