I want to create an explosion when a player fall where the player land.
@SubscribeEvent
public void onPlayerFall(LivingFallEvent event) {
if(!(event.getEntity().level.isClientSide()) && event.getEntityLiving() instanceof Player) {
Player player = (Player) event.getEntityLiving();
float distance = event.getDistance();
if(distance >= 3) {
// Explosion
}
}
}
Does someone have any idea how to create an explosion ?
I want to spawn a living entity when an event is triggered at the location of this event, but i don't know any methods to spawn an entity.
Tanks in advance.
3 replies
Important Information
By using this site, you agree to our Terms of Use.