ReyMagos
Тег-бомбастер
- 412
- 7
- 121
Вот событие:
Оно не работает. Подскажите, что делать.
Java:
@SubscribeEvent
public static void onSetCurrentBlock(PlayerInteractEvent.RightClickItem event)
{
if (event.getEntity() instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.getEntity();
World worldIn = player.world;
BlockPos pos = event.getPos();
if (player.getHeldItem(EnumHand.MAIN_HAND) == new ItemStack(Blocks.STONE)) {
if (worldIn.isAirBlock(pos.up(1))) {
worldIn.setBlockState(pos.up(1), Blocks.SAND.getDefaultState());
}
else {
event.setCanceled(true);
}
}
}
}
Последнее редактирование: