Hello everyone,
I know that since minecraft vanilla 1.9, there is the possibility to change among other the damage of weapons when they are equipped. Like showed on the picture below
java.lang.NullPointerException: null
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:257) ~[minecraft_server.1.12.2.jar:?]
at org.spongepowered.common.data.SpongeManipulatorRegistry.getDelegate(SpongeManipulatorRegistry.java:308) ~[SpongeManipulatorRegistry.class:1.12.2-7.1.0-BETA-5]
at org.spongepowered.common.data.util.DataUtil.getBaseValueProcessor(DataUtil.java:375) ~[DataUtil.class:1.12.2-7.1.0-BETA-5]
at net.minecraft.item.ItemStack.get(SourceFile:1313) ~[aip.class:?]
at org.spongepowered.common.item.inventory.SpongeItemStackSnapshot.get(SpongeItemStackSnapshot.java:303) ~[SpongeItemStackSnapshot.class:1.12.2-7.1.0-BETA-5]
at com.ylinor.itemizer.Itemizer.preInit(Itemizer.java:48)
there must be a solution it’s possible to change attributeModifier via a chat command : /give @p minecraft:stone_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"dégats",Slot:"mainhand",Amount:10,Operation:0,UUIDMost:77976,UUIDLeast:134898}]}
Just seen in the keys class that it says for projectiles (dont know why i didn’t see that before). However I can not see a key for item damage. I know its not the best idea but you could run a command to set the attributes
I come back on this post 7 month later to solve the problem. I used the the unsafe data of a container to create an itemStack with a modified attack damage.