Is this what you put in?
/playsound [x] [y] [z] [volume] [pitch] [minimumVolume]
Also note that you can change the volume /\ and the minimum volume /. Using those to it should be heard by the player. Note also that you can do it to a persific player so if you want it to be heard by one player the have a low volume and target the player.
If that does not work, I have a other solution.
Sorce: Minecraft Forms
or you simply can’t use exclamation marks in NBT tags
This is the case unfortunately. Using !
for negation only works in selectors, and even then only for certain arguments (type
, name
, tag
, team
, m
).
The problem is, that when I move far away from the setup, the redstone stops working, leaving me unable to summon any new fireballs. Instead, I'm trying to use a command block to check when anything except for item is being held;
If I'm understanding correctly, this problem won't be solved by changing your commands if they already do the correct thing when you're near them.
You should instead move your contraption to spawn chunks (which are always loaded) or keep the chunks your contraption is in loaded with a chunk loader.
how I can check for anything except for a specific item?
Your original commands will leave players not holding the item with a score of 0, meaning you can do something like:
/scoreboard players add @a Fireball 1 {SelectedItem:{tag:{display:{Name:"Summon Fireball"}}}}
/execute @a[score_Fireball_min=1,score_Fireball=1] ~ ~ ~ /summon Fireball ~ ~2.5 ~ {direction:[0.0,0.0,0.0]}
/execute @a[score_Fireball_min=0,score_Fireball=0] ~ ~ ~ /say I'm not holding the fireball summon item
/scoreboard players set @a Fireball 0
You can rearrange these commands slightly to have players be left with 0 or 1 at the end of the tick depending on whether they're holding the fireball, if you want:
/scoreboard players set @a Fireball 0
/scoreboard players add @a Fireball 1 {SelectedItem:{tag:{display:{Name:"Summon Fireball"}}}}
/execute @a[score_Fireball_min=1,score_Fireball=1] ~ ~ ~ /summon Fireball ~ ~2.5 ~ {direction:[0.0,0.0,0.0]}
/execute @a[score_Fireball_min=0,score_Fireball=0] ~ ~ ~ /say I'm not holding the fireball summon item
Further, I’ve tried using exclamation marks to set the score of all entities, including the ones with a blank score, but except for the ones with a score of 2 or higher, to 0;
The score_...
argument also unfortunately doesn't accept !
for negation. You'll instead need to do this in multiple steps:
- Add 0 to all scores, turning null scores to 0:
/scoreboard players add @e[type=Arrow] Arrows 0
- Do the command for arrows with
Arrows
score less than 2: @e[score_Arrows=1]
- Do the command for arrows with Arrows score more than 2:
@e[score_Arrows_min=3]
Best Answer
You can't use relative coordinates in NBT.
The
X
,Y
, andZ
coordinates are raw integers. A~
is not recognized as an integer symbol and therefore throws an error.Comment below if you want me to give a workaround.