Ejemplo n.º 1
0
        public override void func_6006_a(Packet7 packet7)
        {
            Entity entity = mcServer.worldMngr.func_6158_a(packet7.targetEntity);

            if (entity != null && playerEntity.canEntityBeSeen(entity) && playerEntity.getDistanceToEntity(entity) < 4F)
            {
                if (packet7.isLeftClick == 0)
                {
                    playerEntity.useCurrentItemOnEntity(entity);
                }
                else if (packet7.isLeftClick == 1)
                {
                    playerEntity.attackTargetEntityWithCurrentItem(entity);
                }
            }
        }
Ejemplo n.º 2
0
 public override void func_6006_a(Packet7 packet7)
 {
     Entity entity = mcServer.worldMngr.func_6158_a(packet7.targetEntity);
     if (entity != null && playerEntity.canEntityBeSeen(entity) && playerEntity.getDistanceToEntity(entity) < 4F)
     {
         if (packet7.isLeftClick == 0)
         {
             playerEntity.useCurrentItemOnEntity(entity);
         }
         else if (packet7.isLeftClick == 1)
         {
             playerEntity.attackTargetEntityWithCurrentItem(entity);
         }
     }
 }