Solved Can't find attribute minecraft:generic.attack_damage

Discussion in 'Spigot Plugin Development' started by Zuif, Oct 16, 2020.

  1. Hello, I want to add animals that can melee attack the player, but every time it gives this error:

    Code (Text):

    net.minecraft.server.v1_16_R2.ReportedException: Ticking entity
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1117) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:349) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_191]
    Caused by: java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
        at net.minecraft.server.v1_16_R2.AttributeProvider.d(SourceFile:22) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.AttributeProvider.a(SourceFile:28) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.AttributeMapBase.c(SourceFile:62) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.b(EntityLiving.java:1949) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.attackEntity(EntityInsentient.java:1461) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack.a(SourceFile:142) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack.e(SourceFile:134) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalWrapped.e(SourceFile:55) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:1.8.0_191]
        at java.util.Iterator.forEachRemaining(Unknown Source) ~[?:1.8.0_191]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_191]
        at net.minecraft.server.v1_16_R2.PathfinderGoalSelector.doTick(SourceFile:88) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.doTick(EntityInsentient.java:729) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.movementTick(EntityLiving.java:2669) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.movementTick(EntityInsentient.java:530) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityAgeable.movementTick(EntityAgeable.java:142) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityAnimal.movementTick(EntityAnimal.java:34) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.tick(EntityLiving.java:2398) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.tick(EntityInsentient.java:293) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.WorldServer.entityJoinedWorld(WorldServer.java:659) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.World.a(World.java:718) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.WorldServer.doTick(WorldServer.java:394) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1104) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        ... 5 more
    [20:03:10] [Server thread/ERROR]:     Cause of unexpected exception was
    java.lang.IllegalArgumentException: Can't find attribute minecraft:generic.attack_damage
        at net.minecraft.server.v1_16_R2.AttributeProvider.d(SourceFile:22) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.AttributeProvider.a(SourceFile:28) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.AttributeMapBase.c(SourceFile:62) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.b(EntityLiving.java:1949) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.attackEntity(EntityInsentient.java:1461) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack.a(SourceFile:142) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack.e(SourceFile:134) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.PathfinderGoalWrapped.e(SourceFile:55) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:1.8.0_191]
        at java.util.Iterator.forEachRemaining(Unknown Source) ~[?:1.8.0_191]
        at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_191]
        at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_191]
        at net.minecraft.server.v1_16_R2.PathfinderGoalSelector.doTick(SourceFile:88) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.doTick(EntityInsentient.java:729) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.movementTick(EntityLiving.java:2669) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.movementTick(EntityInsentient.java:530) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityAgeable.movementTick(EntityAgeable.java:142) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityAnimal.movementTick(EntityAnimal.java:34) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityLiving.tick(EntityLiving.java:2398) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.EntityInsentient.tick(EntityInsentient.java:293) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.WorldServer.entityJoinedWorld(WorldServer.java:659) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.World.a(World.java:718) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.WorldServer.doTick(WorldServer.java:394) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1104) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:349) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.3.jar:git-Spigot-2740d5a-890130b]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_191]
     


    I tried three method to generate damage attribute:
    1:
    Code (Java):

     this.getAttributeMap().a(GenericAttributes.ATTACK_DAMAGE);
     
    2:
    Code (Java):

     this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE);
     
    3:
    Code (Java):

        public static final Map<EntityTypes<?>, net.minecraft.server.v1_16_R2.AttributeProvider.Builder> DEFAULT_ATTRIBUTES;
         
        static {
              try {
                 final Field modifiers = Field.class.getDeclaredField("modifiers");
                 modifiers.setAccessible(true);
                 final Field field = AttributeDefaults.class.getDeclaredField("b");
                 modifiers.setInt(field, modifiers.getInt(field) & ~Modifier.FINAL);
                 field.setAccessible(true);
                DEFAULT_ATTRIBUTES = new HashMap<EntityTypes<?>, net.minecraft.server.v1_16_R2.AttributeProvider.Builder>(
                        (Map<EntityTypes<?>, net.minecraft.server.v1_16_R2.AttributeProvider.Builder>) field.get(null));
                 field.set(null, DEFAULT_ATTRIBUTES);
              } catch (Throwable reason) {
                 throw new RuntimeException(reason);
              }
           }

     
    And in the constructor:
    Code (Java):

            AttributeProvider.DEFAULT_ATTRIBUTES.put(type, EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE)
                    .a(GenericAttributes.ATTACK_DAMAGE, plugin.getAnimset().getInt(mobname + ".attack.damage")));

     
    This is what my animal class looks like now:
    Code (Java):

    package me.zuif.rean.animals.v1_16_R2;

    import org.bukkit.Location;
    import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;

    import me.zuif.rean.desc.v1_16_R2.DescListener;
    import me.zuif.rean.main.ReAnMain;
    import me.zuif.rean.mechanics.v1_16_R2.AttributeProvider;
    import net.minecraft.server.v1_16_R2.EntityAgeable;
    import net.minecraft.server.v1_16_R2.EntityCow;
    import net.minecraft.server.v1_16_R2.EntityCreature;
    import net.minecraft.server.v1_16_R2.EntityHuman;
    import net.minecraft.server.v1_16_R2.EntityInsentient;
    import net.minecraft.server.v1_16_R2.EntityTypes;
    import net.minecraft.server.v1_16_R2.GenericAttributes;
    import net.minecraft.server.v1_16_R2.PathfinderGoal;
    import net.minecraft.server.v1_16_R2.PathfinderGoalAvoidTarget;
    import net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack;
    import net.minecraft.server.v1_16_R2.PathfinderGoalNearestAttackableTarget;

    public class Cow extends EntityCow {

        public Cow(EntityTypes<? extends EntityCow> type, Location loc) {
            super(type, ((CraftWorld) loc.getWorld()).getHandle());
            String mobname = this.getEntityType().toString().replaceAll("entity.minecraft.", "");
            ReAnMain plugin = ReAnMain.getInstance();
            this.setPosition(loc.getX(), loc.getY(), loc.getZ());
            AttributeProvider.DEFAULT_ATTRIBUTES.put(type, EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE)
                    .a(GenericAttributes.ATTACK_DAMAGE, plugin.getAnimset().getInt(mobname + ".attack.damage")));
        }

        public void initPathfinder() {
            String mobname = this.getEntityType().toString().replaceAll("entity.minecraft.", "");
            ReAnMain plugin = ReAnMain.getInstance();
            DescListener desc = new DescListener(plugin);
            desc.descInitializer(String.valueOf(this.getId()));
            super.initPathfinder();
            String gender = plugin.getDesc().getString(this.getId() + ".gender");
            if (gender.equalsIgnoreCase("Female")) {
                if (plugin.getAnimset().getBoolean(mobname + ".attack.female")) {
                    this.targetSelector.a(0,
                            (PathfinderGoal) new PathfinderGoalNearestAttackableTarget<EntityHuman>((EntityCreature) this,
                                    EntityHuman.class, true));
                    this.goalSelector.a(0, new PathfinderGoalMeleeAttack(this, 1, false));
                }
            } else {
                if (plugin.getAnimset().getBoolean(mobname + ".attack.male")) {
                    this.targetSelector.a(0,
                            (PathfinderGoal) new PathfinderGoalNearestAttackableTarget<EntityHuman>((EntityCreature) this,
                                    EntityHuman.class, true));
                    this.goalSelector.a(0, new PathfinderGoalMeleeAttack(this, 1, false));
                }
            }

            this.goalSelector.a(1,
                    (PathfinderGoal) new PathfinderGoalAvoidTarget<EntityHuman>(this, EntityHuman.class,
                            plugin.getAnimset().getInt(mobname + ".avoid.max-distance"),
                            plugin.getAnimset().getInt(mobname + ".avoid.sprint-modifier"),
                            plugin.getAnimset().getInt(mobname + ".avoid.walk-modifier")));

        }

        @SuppressWarnings("unchecked")
        public EntityCow createChild(EntityAgeable a) {
            EntityTypes<? extends EntityCow> type = (EntityTypes<? extends EntityCow>) a.getBukkitEntity().getHandle()
                    .getEntityType();
            Location loc = new Location(a.getWorld().getWorld(), a.locX(), a.locY(), a.locZ());
            Cow kid = new Cow(type, loc);
            return kid;
        }

    }
     


    What am I doing wrong? Any help appreciated
     
  2. pretty sure a cow cannot have this attribute
     
  3. As far as I know, you can add an attribute to the animal. I saw other people do it, but for me these methods did not work, due to the fact that I am doing something wrong
     
    • Like Like x 1
  4. Works, need to find the thread where I last answered the solution.
     
  5. #5 Zuif, Oct 16, 2020
    Last edited: Oct 16, 2020
    • Like Like x 1

  6. Access EntityLiving#attributeMap reflective.
    Then access AttributeMap#b reflective.

    Map<AttributeBase, AttributeModifiable>#put()

    AttributeInstance attributeInstance = new AttributeInstance(attribute,attributes::eek:nAttributeModified);
    this.attributes.attributes.put(attribute, attributeInstance);
     
  7. Thanks a lot, I will try this a little later
     
  8. Could you provide more details on this? I didn't quite understand
     
  9. I had the same problem. Here's the code I used, but with a pig. Ysl3000 is who gave me this code.

    Code (Text):
    import java.lang.reflect.Field;
    import java.util.List;
    import java.util.Map;

    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.attribute.Attribute;
    import org.bukkit.attribute.AttributeModifier;
    import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.LivingEntity;

    import com.google.common.graph.ElementOrder.Type;

    import net.minecraft.server.v1_16_R2.AttributeBase;
    import net.minecraft.server.v1_16_R2.AttributeModifiable;
    import net.minecraft.server.v1_16_R2.BiomeBase;
    import net.minecraft.server.v1_16_R2.ChatComponentText;
    import net.minecraft.server.v1_16_R2.EntityChicken;
    import net.minecraft.server.v1_16_R2.EntityCow;
    import net.minecraft.server.v1_16_R2.EntityGiantZombie;
    import net.minecraft.server.v1_16_R2.EntityHuman;
    import net.minecraft.server.v1_16_R2.EntityInsentient;
    import net.minecraft.server.v1_16_R2.EntityLiving;
    import net.minecraft.server.v1_16_R2.EntityPig;
    import net.minecraft.server.v1_16_R2.EntityTypes;
    import net.minecraft.server.v1_16_R2.EntityZombie;
    import net.minecraft.server.v1_16_R2.GenericAttributes;
    import net.minecraft.server.v1_16_R2.MinecraftKey;
    import net.minecraft.server.v1_16_R2.PathfinderGoalFloat;
    import net.minecraft.server.v1_16_R2.PathfinderGoalLeapAtTarget;
    import net.minecraft.server.v1_16_R2.PathfinderGoalLookAtPlayer;
    import net.minecraft.server.v1_16_R2.PathfinderGoalMeleeAttack;
    import net.minecraft.server.v1_16_R2.PathfinderGoalNearestAttackableTarget;
    import net.minecraft.server.v1_16_R2.PathfinderGoalRandomLookaround;

    public class KillerPork extends EntityPig {
        private static Field attributeField;



        //EntityTypes<? extends EntityCow> type,
        public KillerPork(Location loc) {
            super(EntityTypes.PIG, ((CraftWorld) loc.getWorld()).getHandle());
         
            this.setPosition(loc.getX(), loc.getY(), loc.getZ());
     
            this.setCustomName(new ChatComponentText(ChatColor.LIGHT_PURPLE + "Killer Pork"));
            this.setCustomNameVisible(true);
            this.setHealth(20);
         
         
            //((LivingEntity)this).getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(1.0);
            //((EntityLiving)this).getAttributeMap().b().add(new AttributeModifiable((AttributeBase) this.getAttributeMap().b(), m -> {
             
            //}));
         
            try {
                registerGenericAttribute(this.getBukkitEntity(), Attribute.GENERIC_ATTACK_DAMAGE);
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
     
     
        @Override
        public void initPathfinder() {
         
     
            this.getAttributeMap().b().add(new AttributeModifiable(GenericAttributes.ATTACK_DAMAGE, (a) -> {a.setValue(10.0);}));
            this.getAttributeMap().b().add(new AttributeModifiable(GenericAttributes.FOLLOW_RANGE, (a) -> {a.setValue(1.0);}));
         
         
         
         
            this.goalSelector.a(0, new PathfinderGoalFloat(this));
            this.goalSelector.a(0, new PathfinderGoalMeleeAttack(this, 1.0D, false));
            this.targetSelector.a(0, new PathfinderGoalNearestAttackableTarget<EntityChicken>(this, EntityChicken.class, true));
            this.goalSelector.a(1, new PathfinderGoalRandomLookaround(this));
            this.goalSelector.a(2, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));

        }
     
     
        static {
            try {
                attributeField = net.minecraft.server.v1_16_R2.AttributeMapBase.class.getDeclaredField("b");
                attributeField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                e.printStackTrace();
            }
        }

        public void registerGenericAttribute(org.bukkit.entity.Entity entity, Attribute attribute) throws IllegalAccessException {
            net.minecraft.server.v1_16_R2.AttributeMapBase attributeMapBase = ((org.bukkit.craftbukkit.v1_16_R2.entity.CraftLivingEntity)entity).getHandle().getAttributeMap();
            Map<net.minecraft.server.v1_16_R2.AttributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable> map = (Map<net.minecraft.server.v1_16_R2.AttributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable>) attributeField.get(attributeMapBase);
            net.minecraft.server.v1_16_R2.AttributeBase attributeBase = org.bukkit.craftbukkit.v1_16_R2.attribute.CraftAttributeMap.toMinecraft(attribute);
            net.minecraft.server.v1_16_R2.AttributeModifiable attributeModifiable = new net.minecraft.server.v1_16_R2.AttributeModifiable(attributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable::getAttribute);
            map.put(attributeBase, attributeModifiable);
        }
     


    }
    Code (Text):
    private static Field attributeField;

        static {
            try {
                attributeField = net.minecraft.server.v1_16_R2.AttributeMapBase.class.getDeclaredField("b");
                attributeField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                e.printStackTrace();
            }
        }

        public void registerGenericAttribute(org.bukkit.entity.Entity entity, Attribute attribute) throws IllegalAccessException {
            net.minecraft.server.v1_16_R2.AttributeMapBase attributeMapBase = ((org.bukkit.craftbukkit.v1_16_R2.entity.CraftLivingEntity)entity).getHandle().getAttributeMap();
            Map<net.minecraft.server.v1_16_R2.AttributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable> map = (Map<net.minecraft.server.v1_16_R2.AttributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable>) attributeField.get(attributeMapBase);
            net.minecraft.server.v1_16_R2.AttributeBase attributeBase = org.bukkit.craftbukkit.v1_16_R2.attribute.CraftAttributeMap.toMinecraft(attribute);
            net.minecraft.server.v1_16_R2.AttributeModifiable attributeModifiable = new net.minecraft.server.v1_16_R2.AttributeModifiable(attributeBase, net.minecraft.server.v1_16_R2.AttributeModifiable::getAttribute);
            map.put(attributeBase, attributeModifiable);
        }
       
     
    • Friendly Friendly x 1
  10. Wow, thanks a lot, I'll try now
     
  11. Works!
     
    • Like Like x 1