2

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.

  • I think this is possible with the title command. – angussidney Apr 15 '15 at 23:31
  • Have you made an attempt to solve this yourself? – Frank Apr 15 '15 at 23:58
  • @Frank I haven't actually gone into Minecraft and done anything because I'm not sure how to approach it. – indy Apr 16 '15 at 0:35
  • I am writing an answer wait a sec. – angussidney Apr 16 '15 at 0:38
  • Arqade works better if you make an effort to solve these issues yourself, and get stuck somewhere. Asking about precisely where you're stuck will get you a better answer, and Arqade gets a better question. Everybody wins! – Frank Apr 16 '15 at 0:40
1

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.
| improve this answer | |
0

As I mentioned in my comment, this is possible with the use of the /title command. The syntax is:

Setting the times: title <player> times <fade in> <stay> <fade out>

This command will determine the times which the title will be displayed for. fade in, fade out, and stay are all measured in ticks (1/20 of a second). Example:

/title @a times 10 60 10 will set the display time of everyone to 1/2 second fade in, 3 second display, and 1/2 second fade out.

Note: This command needs to be run before the title command is run.

To display a title: /title <player> title <contents>

Once again, player is a player name or @ commands. contents is the message to be displayed in raw JSON format. Example:

/title @a[r=10] title {text:"This is a title",color:green,bold:true} will display the title This is a title in bold green text.

To implement this into your situation, simply create a command block on a loop at the entrance to each area. Insert the title command into it. Also create another command block on a loop with the time command in it so that the timing is right. This can be anywhere in the map.

The JSON in the title command can be a bit confusing, so I recommend this generator to help you out. It will generate the time and title command.

The Minecraft Wiki has a complete reference on how to use the title command, including subtitles etc.

I hope this is what you are looking for!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.