Search in sources :

Example 1 with EntityUnleashEvent

use of org.bukkit.event.entity.EntityUnleashEvent in project Glowstone by GlowstoneMC.

the class GlowEntity method unleash.

// //////////////////////////////////////////////////////////////////////////
// Miscellaneous actions
private void unleash(GlowEntity entity, UnleashReason reason) {
    EventFactory.getInstance().callEvent(new EntityUnleashEvent(entity, reason));
    world.dropItemNaturally(entity.location, new ItemStack(Material.LEAD));
    entity.setLeashHolder(null);
}
Also used : EntityUnleashEvent(org.bukkit.event.entity.EntityUnleashEvent) ItemStack(org.bukkit.inventory.ItemStack)

Aggregations

EntityUnleashEvent (org.bukkit.event.entity.EntityUnleashEvent)1 ItemStack (org.bukkit.inventory.ItemStack)1