0

I am making a Minecraft jetpack with a testfor command a /execute command which gives me levitation and also with particle effects. I am trying to add sound with the playsound command by putting it on top of the chain command blocks for the /execute and the particles but it makes this really horrible sound because it is playing constantly. I tried to put it in a separate repeating command block but it doesn't work. Does anyone know how to do this? Thanks!

  • "I'm making a jetpack with testfor and execute" is extremely unspecific where it would help to be specific and too specific in other ways. It's like answering "a black one" to the question what PC you have. – Fabian Röling Sep 4 '17 at 9:46
4

You probably want to loop the command slower. You can do this using redstone (just a regular redstone clock).

If you don't want to use redstone, you can tell the command block to only execute the command every few iterations.
To do this, you assign a timer scoreboard to the player that ticks up every game tick and only if it reaches the time you want, the sound gets played and then the timer gets reset.

Setup:

scoreboard objectives add timer dummy

In loop, replace @p with the selector of the flying player and ... with the rest of your playsound command:

scoreboard players add @p timer 1
playsound @p[scores={timer=20}] <...>
scoreboard players set @p[scores={timer=20}] timer 0

If it's a function, you can also use /schedule (archive):

/schedule function <function> 20

or:

/schedule function <function> 1s

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.