DRE2N / DungeonsXL

Create custom dungeons and adventure maps with ease!
https://www.spigotmc.org/resources/dungeonsxl.9488/
GNU General Public License v3.0
152 stars 84 forks source link

Title Sign with Distance Trigger #1070

Closed RocketManKian closed 2 years ago

RocketManKian commented 2 years ago

(Please follow this template, as doing so saves both you and me a lot of time. Issues that don't follow the template may be closed.)

Description

[Title] signs with the Distance Trigger only show up for one player and doesn't trigger for each player. I believe this is a bug because the Distance Trigger works fine for activating checkpoints for all players in the group.

Reproduce

  1. Go into your Dungeon
  2. Add a [Title] sign with the Distance trigger
  3. Play the Dungeon with more than one person
  4. You will notice the Title only shows up for one person in the group

Expected behavior

Title sign to show up for all players rather than just one

Screenshots / GIFs / videos

2021-11-15_00 29 01

Relevant configuration files

N/A

Sataniel98 commented 2 years ago

Distance triggers by design trigger their sign once when a player is in distance and then remove themselves.

If you've got a mob sign, you'll want it to start spawning mobs when the first player reaches it, but not continuously when he stays close to it, or when another player reaches the sign. That's what the distance trigger is made for.

If you want to teleport players, you probably want the teleport sign to teleport all players when they reach it, and it should do so whenever they reach it in case they die and respawn in the old location. This is the behavior of the progress trigger, and it's also used for checkpoints unless only the first player is supposed to be allowed to use it.

Distance, presence, interact and use item triggers are player-specific, fortune, mob, redstone and sign triggers are not. That means, e.g. a redstone trigger doesn't know who activated it, and triggers the sign without passing along the information who triggered it. The triggered sign (say, a checkpoint sign) checks if it knows who triggered it; if it does and if applicable, it performs its action for the player (= assigns its respawn point to the player), if it doesn't, it performs it for all players in the world.

tl;dr; you can have your message / title / action bar signs be triggered by a sign trigger, which is not player-specific, and it will send its message to everyone in the world, even if the trigger's sign is triggered by a player-specific distance trigger.

[Trigger]
100

D 10
[Title]
1,2

T 100
RocketManKian commented 2 years ago

That worked! Thank you so much :)