Minecraft – RPG-esque Area Names on Entry in Minecraft

minecraft-commandsminecraft-java-edition

So the title command lets you put a fancy thing across people's screens like you might see in some RPG. I'd like to use this as a way to give names for areas in my adventure map- for example, they walk into a region and it says "X Dungeon" or "Town Name" on the screen. Problem is, I'm not 100% sure how to accomplish this. I'm pretty sure I'd have to use the scoreboard, but I'd appreciate assistance from anyone more sure of this than I.

Best Answer

All right, got it working. I put everything on top of a fill clock.

This block gives all players the objective always.

/scoreboard players add @a visited 0

This block produces the title.

/title @a[x=-153,y=69,z=309,r=10,score_visited=1] title {text:"Place",bold:true}

This block adds points to visited for anyone within a radius of 10.

/scoreboard players add @a[x=-153,y=69,z=309,r=10,score_visited=1] visited 1

This block takes away points so that the title can be reshown to anyone reentering the area.

/scoreboard players remove @a[x=-153,y=69,z=309,rm=10,score_visited_min=1] visited 1

Things to note:

  • I made everything originate from one place, so the XYZ values are hard coded.
  • Visited is intended to add up to 2 with these precise commands. These command blocks are largely dependent on where the command blocks are placed on the fill clock relative to each other. On 1, the title is shown, then the player is meant to sit at 2 until they leave the area, where it should drop back to 0.