Skip to content

🟢 | PotionEffects hider #666

@rejomy

Description

@rejomy

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);
           }
       }
   }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions