EntityLivingSpawnEvent
Link to entitylivingspawnevent
The EntityLivingSpawn Event is fired whenever an entity tries to join or leave a world.
It has one subclass, the EntityLivingExtendedSpawnEvent that also contains an IMobSpawnerBaseLogic reference.
Класс события
Link to класс-события
You will need to cast the event in the function header as this class:
crafttweaker.event.EntityLivingSpawnEvent
crafttweaker.event.EntityLivingExtendedSpawnEvent
You can, of course, also import the class before and use that name then.
Наследование от интерфейсов событий
Link to наследование-от-интерфейсов-событий
EntityLivingSpawn Events implement the following interfaces and are able to call all of their methods/getters/setters as well:
ZenGetters
Link to zengetters
Следующая информация может быть получена от события:
ZenGetter | Тип |
---|---|
ZenGetter world | Тип IWorld |
ZenGetter x | Тип float |
ZenGetter y | Тип float |
ZenGetter z | Тип float |
ZenGetter | Тип |
ZenGetter spawner (Extended Only) | Тип IMobSpawnerBaseLogic |
Event functions
Link to event-functions
The despawn event also offers three functions to change the event outcome:
ZenMethod | Описание |
---|---|
ZenMethod allow | Описание Forces the entity to (de)spawn |
ZenMethod deny | Описание Forces the entity not to (de)spawn |
ZenMethod pass | Описание Sets the event result to the default state |