diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java index 3eb8ff9c..9352b542 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java @@ -113,19 +113,19 @@ public class MagicValues { register(Pose.SNEAKING, 5); register(Pose.DYING, 6); - register(AttributeType.GENERIC_MAX_HEALTH, "minecraft:generic.max_health"); - register(AttributeType.GENERIC_FOLLOW_RANGE, "minecraft:generic.follow_range"); - register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "minecraft:generic.knockback_resistance"); - register(AttributeType.GENERIC_MOVEMENT_SPEED, "minecraft:generic.movement_speed"); - register(AttributeType.GENERIC_ATTACK_DAMAGE, "minecraft:generic.attack_damage"); - register(AttributeType.GENERIC_ATTACK_KNOCKBACK, "minecraft:generic.attack_knockback"); - register(AttributeType.GENERIC_ATTACK_SPEED, "minecraft:generic.attack_speed"); - register(AttributeType.GENERIC_ARMOR, "minecraft:generic.armor"); - register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "minecraft:generic.armor_toughness"); - register(AttributeType.GENERIC_LUCK, "minecraft:generic.luck"); - register(AttributeType.GENERIC_FLYING_SPEED, "minecraft:generic.flying_speed"); - register(AttributeType.HORSE_JUMP_STRENGTH, "minecraft:horse.jump_strength"); - register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "minecraft:zombie.spawn_reinforcements"); + register(AttributeType.GENERIC_MAX_HEALTH, "generic.max_health"); + register(AttributeType.GENERIC_FOLLOW_RANGE, "generic.follow_range"); + register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "generic.knockback_resistance"); + register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movement_speed"); + register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attack_damage"); + register(AttributeType.GENERIC_ATTACK_KNOCKBACK, "generic.attack_knockback"); + register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attack_speed"); + register(AttributeType.GENERIC_ARMOR, "generic.armor"); + register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armor_toughness"); + register(AttributeType.GENERIC_LUCK, "generic.luck"); + register(AttributeType.GENERIC_FLYING_SPEED, "generic.flying_speed"); + register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jump_strength"); + register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawn_reinforcements"); // Forge-only register(AttributeType.SWIM_SPEED, "forge.swim_speed"); register(AttributeType.NAMETAG_DISTANCE, "forge.name_tag_distance"); diff --git a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java index 63b6151a..124ac1f6 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java +++ b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/entity/ServerEntityPropertiesPacket.java @@ -41,6 +41,9 @@ public class ServerEntityPropertiesPacket implements Packet { modifiers.add(new AttributeModifier(in.readUUID(), in.readDouble(), MagicValues.key(ModifierOperation.class, in.readByte()))); } + if (key.startsWith("minecraft:")) { + key = key.replace("minecraft:", ""); + } this.attributes.add(new Attribute(MagicValues.key(AttributeType.class, key), value, modifiers)); } }