Give closest player's displayname to an entity

Started by _Ness on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Give closest player's displayname to an entity

Hi, I'd like to make a procedure that gives an entity the displayname of the closest player, is that possible ? Thanks in advance.

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you are able to also do…
Tue, 06/02/2020 - 15:36

If you are able to also do it in a function you could do:

setblock ~ ~ ~ minecraft:oak_sign{Text1:'["",{"selector":"@p"}]'}

/execute as @e[type=pig] run data modify entity @s CustomName set from block -2 6 113 Text1

 

I don't know much about mcreator but I hope I could help :)