#can anyone figure out what's wrong?

1 messages · Page 1 of 1 (latest)

night plinth
#

i have execute at @s as @s if predicate event:stalking run playsound minecraft:block.amethyst.step where event:stalking is:

    "condition": "minecraft:entity_properties",
    "entity": "this",
    "predicate": {
      "stepping_on": {
        "block": {
          "blocks": "minecraft:grass_block"
        }
      }
    }
  }

also, the function is running every tick

thorny otterBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

                        🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you


                        
                        ✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
#
⚠️ You already have a question open!

Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D

Open question: #1257679971258990693

raven gale
#

If it's running in the tick function, @s doesn't exist since it's running as the server

night plinth
#

oh

#

what can i replace it with?

raven gale
#

You need something like execute as @a at @s if predicate ...

#

That runs it as every player

night plinth
#

hm

#

still not working

raven gale
#

I think playsound requires a few more parameters

bitter onyxBOT
#
📜 /playsound

playsound <sound> <source> <targets> [<pos>] [<volume>] [<pitch>] [<minVolume>]

raven gale
#

Yes

night plinth
#

well, ingame it works only with the sound

raven gale
#

Oh ok, maybe this is wrong then

night plinth
#

probally

#

also, can i tell it to play the sound of the block the player is standing on?

raven gale
#

Not easily I'm afraid

#

Anyway, try running the command in chat

night plinth
#

uhhh

#

now i'm even more confused

#

it said that the sound was played when it wasn't

thorny otterBOT
# thorny otter <@&1201956957406109788>

<@&935561184806060073> <@&1202694677766348840>

**🙇 Helpers Arise!**

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

night plinth
#

sry for the ping, i just can't figure it out

scarlet tiger
#

what's the issue

jagged delta
#

Read

scarlet tiger
#

I did

scarlet tiger
#

you didn't hear the sound?

night plinth
#

nope

jagged delta
#

I know this might sound like a stupid question, but do you have Minecraft sound turned on?

scarlet tiger
#

I'm pretty sure you need to execute the playsound at your location

#

for you to hear it

scarlet tiger
#

try /execute at @s run playsound ...

#

(in chat)

jagged delta
#

The command should already be executing at the position of the player.

jagged delta
# bitter onyx

Still, you could try filling out the rest of this command.

#

Most importantly the position part.

scarlet tiger
#

<pos> and <target> too

jagged delta
#

Yea

night plinth
#

oh, i think i did figure it out

#

i didn't say what the sound would be classified at i guess

scarlet tiger
#

<source>

#

just like

#

fill out the whole command

night plinth
#

uhm still not working

scarlet tiger
#

what's the command you're running (in-chat)

night plinth
#

/execute at @a as @s if predicate event:stalking run playsound minecraft:block.amethyst.step block @p ~ ~ ~

jagged delta
#

Specify volume and pitch too, just in case it matters.

granite dragon
#

You need to swap your as and at

night plinth
#

yeah

night plinth
scarlet tiger
#

...because

#

you do

#

are you doing this in chat

#

or in the datapack

night plinth
#

i'm trying both

#

and i still don't hear it

scarlet tiger
#

well

#

it wouldn't matter if it was in chat

#

(you still need to swap them for your datapack)

jagged delta
# night plinth why?

The AS specifies whom to run the command as, and AT specifies the location that the command will run. Things don’t work as intended if you put the AT first.

scarlet tiger
#

which again wouldn't matter in a singleplayer world chat, but for your datapack you'll need it

#

anyways

granite dragon
#

I've seen it affect things in singleplayer

scarlet tiger
#

try increasing the volume

night plinth
#

it is increased

scarlet tiger
#

(like the volume in the command)

night plinth
#

uhm

#

apparently

#

now it works

#

i changed from "at @s" to "at @p"

thorny otterBOT
# thorny otter <@&1201956957406109788>
Question Closed

Your question, #1257776244070551682 (can anyone figure out what's wrong?), was resolved!

Original Message

#1257776244070551682 message

Duration open

58m