0

I've been trying to get city names to appear when I enter an area using the /title command, but it with an impulse it will only show once and repeat it will continuously flash.

We tried /testfor @p, and then using a chain block for the title command, but it's not working.

I am just trying to get the city or area name to appear when my friends an I enter different cities. If anyone has advice, I would appreciate it. I saw a few posts on here about it, but the block instructions aren't working on my server.

1 Answer 1

1

To run a command only once per player, you have to use a system of tags to track who the title has already been displayed to. The breakdown of such a system is as follows:

  1. If the player is in the area and does not have the tag, show the title and add the tag.
  2. If the player leaves the area, remove the tag.
  3. If the player is in the area and already has the tag, do nothing.

Here is how that would look in command form:

title @a[<…>, tag=!welcomed] title Welcome
tag @a[<…>] add welcomed
tag @a[!<…>] remove welcomed

where <…> represents selector arguments of your choice that detect when the player is in the area, and !<…> represents those arguments inverted.

You must log in to answer this question.

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