use of org.bukkit.event.block.BlockDamageAbortEvent in project Mohist by MohistMC.
the class CraftEventFactory method callBlockDamageAbortEvent.
public static BlockDamageAbortEvent callBlockDamageAbortEvent(ServerPlayer who, BlockPos pos, ItemStack itemstack) {
Player player = who.getBukkitEntity();
CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);
Block blockClicked = CraftBlock.at(who.getLevel(), pos);
BlockDamageAbortEvent event = new BlockDamageAbortEvent(player, blockClicked, itemInHand);
player.getServer().getPluginManager().callEvent(event);
return event;
}
Aggregations