Added event system and custom entities for plugins