предмет в руке

Версия Minecraft
1.7.10
Здрасте. Не подскажите условие при котором предмет, который игрок держит в руке вылетает из рук на землю
 
Решение
Не знаю как на 1.7.10, но на 1.12 по идее так:
Код:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
        
        ItemStack itemstack = player.getHeldItem(hand);
        
        if (!player.capabilities.isCreativeMode) {
            
            itemstack.shrink(1);
            
        }
        
        if(!world.isRemote) {
            
            player.dropItem(this);
            
        }
        
        return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemstack);
        
    }
Не уверен, что это именно то, что тебе нужно, но всё же...
Не знаю как на 1.7.10, но на 1.12 по идее так:
Код:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
        
        ItemStack itemstack = player.getHeldItem(hand);
        
        if (!player.capabilities.isCreativeMode) {
            
            itemstack.shrink(1);
            
        }
        
        if(!world.isRemote) {
            
            player.dropItem(this);
            
        }
        
        return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemstack);
        
    }
Не уверен, что это именно то, что тебе нужно, но всё же...
 
Назад
Сверху