Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-150405

Client handling of unknown entity attributes is bugged


    • Icon: Bug Bug
    • Resolution: Fixed
    • 20w14a
    • Minecraft 1.14, Minecraft 1.14.2, 1.15.2, 20w12a
    • Confirmed
    • Crash, Networking

      The client-side handler for entity attribute data currently has an error which will cause exceptions to be thrown in a situation where this is most likely not intended to happen.

      Using MCP names, the relevant function is NetHandlerPlayClient.handleEntityProperties (handler for this client-bound packet), which has the following block of code:

      IAttributeInstance iattributeinstance = abstractattributemap.getAttributeInstanceByName(spacketentityproperties$snapshot.getName());
      if (iattributeinstance == null) {
         iattributeinstance = abstractattributemap.registerAttribute(new RangedAttribute((IAttribute)null, spacketentityproperties$snapshot.getName(), 0.0D, Double.MIN_NORMAL, Double.MAX_VALUE));
      for(AttributeModifier attributemodifier : spacketentityproperties$snapshot.getModifiers()) {

      While this appears to be intended to register a dummy attribute instance for any unknown attribute data recieved, the RangedAttribute created here is invalid and will cause an IllegalArgumentException to be thrown by the constructor:

      else if (defaultValue < minimumValueIn) {
         throw new IllegalArgumentException("Default value cannot be lower than minimum value!");

      This is because the minimum value specified is greater than the default of 0. The correct minimum value should probably be -Double.MAX_VALUE instead of Double.MIN_NORMAL, as negative values are allowed here (e.g. generic.luck).

            Unassigned Unassigned
            quadraxis Ben Staddon
            2 Vote for this issue
            1 Start watching this issue