0

I'm in the process of renaming all existing villagers to "Villager" in a server I manage (fairly new to admin stuff) but I do not know what code to use. I did find one before but it was kind of a stupid move for me to not bookmark it so now I can't find it. All I know is that I need to use the /execute command.

2
  • First, what version of Minecraft are you on? The execute command changes drastically after 1.13.
    – AMJ
    Dec 29, 2020 at 3:29
  • sorry for the late reply, because I haven't been on stack exchange lately. I'm on the latest version (1.16.4)
    – Orez
    Jan 25, 2021 at 1:18

1 Answer 1

1

On 1.13+, it is:

/execute as @e[type=villager] run data merge entity @s {CustomName:"\"Bob\""}

on 1.12− it is:

/entitydata @e[type=villager] {CustomName:Bob}
3
  • That is very much correct, but I'd like to encourage you to write a small explanation on how the command works. For example, why did you choose to use /execute for the /data merge command, and not type the selector in directly?
    – One 2 Many
    Dec 29, 2020 at 7:28
  • @ExpertCoder14 Because /data merge in 1.13+ only works with one entity at a time, unlike /entitydata in 1.12-
    – pppery
    Dec 29, 2020 at 17:41
  • I'll go try this out when I open the server later, thanks for the answer!
    – Orez
    Jan 25, 2021 at 1:20

You must log in to answer this question.

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