Development Assistance AttributeModifier Player Clear

Discussion in 'Plugin Help/Development/Requests' started by mgone, Dec 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    mgone

    Hello
    i have trouble to reset player attribute, I do not know how to handle it, attribute appeared in player.dat after a bug! I think the bug is known I saw some post that talks about that!

    The bug appear if setHealth(0) on PlayerQuitEvent and the player have armor and item with AttributeModifier, Player will keep the Attribute after die. this is used by most pvp deconnection protect plugins


    I want to reset player AttributeModifier on connect but i am noob with nms and i have trouble!

    private static final UUID attackDamageUID = UUID.fromString("7bbe3bb1-079d-4150-ac6f-669e71550776");
    EntityPlayer ph = ((CraftPlayer) p).getHandle();
    AttributeInstance attributes = ph.getAttributeInstance(GenericAttributes.e);
    AttributeModifier modifier = new AttributeModifier(attackDamageUID, "attack Damage", 0, 0);
    attributes.a(modifier);

    this reset only base attribute and dont remove other ones
    plu.jpg
     
Thread Status:
Not open for further replies.

Share This Page