-2

I have been working on a minigame using commands and have recently had to change all my nbt of summon commands to align with the new component system. I got this to work and everything was all good and well, however now that I just updated to 1.21 the attribute part of my summon commands has stopped working. This is a command I used that previously increased the followrange of a drowned:

{Tags:[DR1_B],Team:Blue,Attributes:[{Name:"generic.follow_range", Base:100.0}],HandItems:[{Count:1,id:trident,components:{"minecraft:enchantments":{"minecraft:impaling":2}}}],ArmorItems:[{Count:1,id:leather_boots,components:{"minecraft:enchantments":{"minecraft:projectile_protection":3}}},{Count:1,id:leather_leggings,components:{"minecraft:enchantments":{"minecraft:projectile_protection":3}}},{Count:1,id:leather_chestplate,components:{"minecraft:enchantments":{"minecraft:projectile_protection":3}}},{Count:1,id:leather_helmet,components:{"minecraft:enchantments":{"minecraft:projectile_protection":3}}}]}

Everything else in the command works and it still summons the drowned but without the attribute. Could someone please show me what needs to be changed and also please show me how to summon a mob with multiple attributes e.g. followrange and modified base health?

1 Answer 1

1

The NBT format for attributes changed in Java Edition 1.21. You should replace

Attributes:[{Name:"generic.follow_range", Base:100.0}]

with

attributes:[{id:"generic.follow_range", base:100.0}]

To set multiple attributes, just add more entries to the list:

attributes:[{id:"generic.follow_range", base:100.0}, {id:"generic.max_health", base:30.0}]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .