Действие при зажатии пкм

Версия Minecraft
1.7.10
14
1
Сорян если такие темы уже были, возможно не нашел. Как накладывать эффект на игрока пока он зажимает пкм?
 
Решение
Java:
@Override
    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {   
    ...   
    if (entity instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) entity;
            player.addPotionEffect(new PotionEffect(Potion.confusion.id, 400, 1));
            player.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 0));
        }
    ...
        return stack;
    }
1,417
44
594
Java:
@Override
    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {   
    ...   
    if (entity instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) entity;
            player.addPotionEffect(new PotionEffect(Potion.confusion.id, 400, 1));
            player.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 0));
        }
    ...
        return stack;
    }
 
1,111
47
420
Java:
@Override
    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {  
    ...  
    if (entity instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) entity;
            player.addPotionEffect(new PotionEffect(Potion.confusion.id, 400, 1));
            player.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 0));
        }
    ...
        return stack;
    }
Тут чо то не так. есть значится параметр player типа EntityPlayer, и, внезапно, есть некое entity, которое почему то проверяется на EntityPlayer.
Прикольно крч.
 
5,022
47
784
Сверху