Can I somehow spawn an enderdragon called fred in minecraft? But the name fred should also be on the bar where the ender dragon is otherwise.
If you go to the end you have to execute this command:
/ data merge entity @e [type = ender_dragon] {CustomNameVisible: 1b, CustomName: '{"text": "Fred"}'}
Don't forget that you have to have activated cheats in the world
I just tried the command, but it didn't work.
Sorry, I forgot part
This is the new command:
/ data merge entity @e [type = ender_dragon, limit = 1] {CustomNameVisible: 1b, CustomName: '{"text": "Fred"}'}
If you only want the name in the bar, you can replace the 1b after CustomNameVisible with a 0b.