TransWikia.com

Help with @a[scores={objective=1}]

Arqade Asked by EkeJr on November 15, 2020

Long story short, me and a couple of my friends decided to make a server that we can play on because we were bored, and we wanted to add trails to our shop. The trails would work like so: every player that has fogTrailEquipped = 1, we display the particles on them. But for some reason my command doesnt work after I added the @a[scores={fogTrailEquipped=1}] part.
heres my command (on a repeating command block):
execute at @a[scores={fogTrailEquipped=1}] run particle minecraft:ash ~ ~ ~ 0 0.5 0 70 70 normal

2 Answers

The issue is not with your selector in your command, because it is correct according to the wiki. You should check that the player you are trying to spawn the trail at actually has the score fogTrailEquipped set to 1.

Answered by Macks on November 15, 2020

The command is functional, so check the following:

Is the command block activated?

Check that the command block is set to Repeat and Unconditional.

If it is activated by redstone, (Needs Redstone) make sure it is powered by a redstone input, such as a lever, redstone block, etc.

If it is set to Always Active, make sure that the command block did not glitch and stop activating. (This happens to me sometimes.) Change the setting to Needs Redstone and then back to Always Active. You can make sure it is activating if the time in Previous Output increases.

Does the target player have the score?

Type /scoreboard objectives setdisplay sidebar fogTrailEquipped. Any players that have a score will appear in the list. You can clear the sidebar later with /scoreboard objectives setdisplay sidebar.

Is the scoreboard a dummy scoreboard?

If the scoreboard is not a dummy scoreboard, you may have issues giving scores to players. Type /scoreboard players set @s fogTrailEquipped 1. If an error returns: "Scoreboard objective `fogTrailEquipped` is read-only", then you need to delete the scoreboard and recreate it:

/scoreboard objectives remove fogTrailEquipped
/scoreboard objectives add fogTrailEquipped dummy

Is the command block loaded?

Command blocks will not work if the chunk it is located in is unloaded. Chunks unload whenever a player is not nearby, so if the command block is far away this may be the reason. You can fix this issue by placing the command block in the spawn chunks, which are never unloaded.

Are your particles off?

The particles will not be visible if you have your particle settings set to Minimal. You can fix this by changing the setting to Decreased or All, or you can change your command to show particles regardless of settings:

execute at @a[scores={fogTrailEquipped=1}] run particle minecraft:ash ~ ~ ~ 0 0.5 0 70 70 force

Answered by ginkgo on November 15, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP