Пример #1
0
 @Override
 public boolean onItemUse(
     ItemStack stack,
     EntityPlayer player,
     World world,
     int x,
     int y,
     int z,
     int par7,
     float par8,
     float par9,
     float par10) {
   if (world.provider.dimensionId != -1)
     player.addChatMessage(
         Util.getChatComponent(Util.AQUA + "This item can only be used in the Nether."));
   else if (!world.isRemote) {
     EntityKingOfScorchers entity = new EntityKingOfScorchers(world);
     entity.setPosition(x, y + 1, z);
     if (world.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty()) {
       world.spawnEntityInWorld(entity);
       if (!player.capabilities.isCreativeMode) stack.stackSize--;
     }
   }
   return true;
 }