forum Forumskeyboard_arrow_right Help keyboard_arrow_right computerJava Edition

Create Forum Thread
1

Why Is Is This Target Selector Argument Not Working?

1 emeralds1 reply26 views
User2969796G started 04/01/2020 11:48 am
Bertiecrafter replied 04/01/2020 12:22 pm
Im creating a command wich is supposed to execute a message just once when a certain score is reached.
It worked once, but I made some changes to display a better word seperation by adding some whitespace in the text sections within the tellraw section. It stopped working from there, even as I undid, switched world etc. These are the commands I am using at the moment.
When I am changing the command to only execute when I am below or above a certain score (elytraFlight=5000.., elytraFlight=..5000) it works fine, but obviously keeps spamming.


/scoreboard objectives add elytraFlight minecraft.custom:minecraft.aviate_one_cm

/execute as @a[scores={elytraFlight=5000}] run tellraw @a [{"text":"[Abgehoben...]: "}, {"selector":"@p[scores={elytraFlight=5000}]"}, {"text":" flog 5 Meter!"}]


I dont want to reset the scoreboard - because I want to execute another command once a certain second score is reached.
Posted by avatar
User2969796G
Level 1 : New Miner
0

comment Login or register to post a reply.

1 reply

1
04/01/2020 12:22 pm
Level 50 : Grandmaster Cyborg
Bertiecrafter
You will have to reset the score, otherwise the score will keep increasing past 5000 and trigger again.
You can put the reset score command after all commands you want to run once the score has been reached.

Consider grouping all commands that you execute once the score has been reached into a function. That way you don't have to check the score for every command.
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome