AntiCheatAddition icon indicating copy to clipboard operation
AntiCheatAddition copied to clipboard

🟢 | PotionEffects hider

Open rejomy opened this issue 1 year ago • 0 comments

Hide other entity potion effects for player. Nametags can draw entity potion effect.

  @Override
   public void onPacketSend(PacketSendEvent event) {
       if (!enabled)
           return;

       if (event.getPacketType() == PacketType.Play.Server.ENTITY_EFFECT) {
           WrapperPlayServerEntityEffect wrapper = new WrapperPlayServerEntityEffect(event);

           if (wrapper.getEntityId() != player.entityID) {
               // Cancel send packet about other entity potions.
               event.setCancelled(true);
           }
       }
   }

rejomy avatar Oct 18 '24 05:10 rejomy