Events

Event callbacks to hook into vanilla code.

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-events:<VERSION>'
}

Block Events

BlockEvents.PLACE: Fired when a block is placed. BlockEvents.BREAK: Fired when a block is broken. BlockEvents.CHANGE: Fired when a block changes at a position.

CropEvents.GROW: Fired when a crop grows naturally or when bone-mealed.

Entity Events

AnimalEntityEvents.PRE_BREED: Fired when two Animals breed, before the baby is born. AnimalEntityEvents.POST_BREED: Fired when two Animals breed, after the baby is born. AnimalEntityEvents.EAT: Fired when an animal is fed food. AnimalEntityEvents.GROW_UP: Fired when a baby animal grows up. AnimalEntityEvents.LOVE: Fired when two animals have entered 'love' mode to begin breeding.

EntityEvents.SPAWN: Fired when an Entity spawns in the world. EntityEvents.WITHIN_STRUCTURE: Fired when an Entity is within a structure. EntityEvents.DATA_TRACK: Fired when an Entity's tracked data is set. (Removed in 0.4.0) EntityEvents.WRITE_NBT: Fired when an Entity's NBT is written. (Removed in 0.4.0) EntityEvents.STRUCK_BY_LIGHTNING: Fired when an entity is struck by a lightning bolt. EntityEvents.CHANGE_DIMENSION: Fired when an entity moves to another dimension. This is not called for players.

LivingEntityEvents.DROP_LOOT: Fired when a living entity drops loot on death. LivingEntityEvents.EQUIP_STACK: Fired when a living entity equips an equipment item. LivingEntityEvents.EAT_FOOD: Fired when a living entity eats food.

MobEntityEvents.INITIALIZE: Fired when a mob is initialized into the world. MobEntityEvents.INIT_GOALS: Fired when a mob has its goalSelector and targetSelector initialized.

PlayerEntityEvents.LEVEL_UP: Fired when a player levels up. PlayerEntityEvents.RESPAWN: Fired when a player respawns.

ProjectileEntityEvents.FIRE: Fired when a projectile is fired. ProjectileEntityEvents.IMPACT: Fired when a projectile impacts something.

Item Events

ItemEvents.CRAFT: Fired when an item is crafted. ItemEvents.ENCHANT: Fired when an item is enchanted. ItemEvents.PICK_UP: Fires when an item is picked up by a player or mob.

World Events

WorldEvents.EXPLODE: Fired when an explosion occurs in the world.

Misc Events

FishingEvents.CAST: Fired when a Fishing Rod is cast. FishingEvents.REEL_IN: Fired when a Fishing Rod has its Fishing Bobber reeled in.

SleepEvents.EXPLODE: Fired when a Bed explodes. SleepEvents.SLEEP: Fired when an entity attempts to sleep in a Bed. SleepEvents.WAKE_UP: Fired when an entity wakes up from a Bed.

LanguageEvents.LOAD_TRANSLATION: Fired when each translation key for a locale is translated and stored.

RecipeEvents.RECIPE_LOAD: Fired when a recipe is deserialized, before being loaded into the game.

Last updated