1

I was triying to make a teleporter when a player steps on a obsidian block, but the sound wont play. Here's the command blocks if that's any help.

Repeat, always active: Execute as @a at @s if block ~ -1 ~ obsidian as @s run title @s title §l§b¡Bienvenido...

Chain, conditional, always active: execute as @a at @s if block ~ ~-1 ~ obsidian as @s run title @s subtitle §l§b...A la base §cnether

Chain, always active: execute as @a at @s if block ~ ~-1 ~ obsidian as @s run to @s 0 -60 3

(wont sound) Chain, always active: execute as @a at @s if block ~ ~-1 ~ obsidian as @s run playsound portal.trigger @s ~ ~ ~

3
  • Are they teleported before or after that sound begins to play? If the sound is played at their old location it won't do much. Also, are all the command blocks loaded?
    – Corsaka
    Commented Aug 19, 2022 at 12:15
  • Well Corsaka, when the player gets teleported should make the sound of the portal trigger I've tried everything making the command block un/conditional changed the place where the sound is playing, when it will play (tick of delay), change the order of the command blocks, but nothing seems to work.
    – Endoender
    Commented Aug 19, 2022 at 15:02
  • Wait, do you actually teleport them to another dimension or does it just teleport them to 0 -60 3? (Also, is the to instead of tp in that third command a typo?)
    – Corsaka
    Commented Aug 19, 2022 at 15:14

1 Answer 1

1

Both the playsound command and the teleport command check for obsidian under the player's feet. So likely what is happening is either:

The player walks onto obsidian and you teleport the player away first, so the sound doesn't play since they are no longer on obsidian,

Or even if you play the sound first, it is played at where the player is before they simultaneously get teleported away and can no longer hear it.

Solution? You can still check for obsidian and run the command (as long as it is checked first before getting teleported away) but perhaps instead of ~ ~ ~, play the sound at the destination coordinates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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