TransWikia.com

What is wrong with my command?

Arqade Asked by Caley on April 3, 2021

I am trying to do a 1 person sleep command in my realms, and my code won’t work for one specific line:

execute if entity @a[scores={KickBed=1..,}] run execute if score @a[scores={sleep=1..,}] run tellraw @a {"text":"","extra":[{"selector":"@p[scores={KickBed=1,}]","color":"white"},{"text":" doesn't want to skip the night!","color":"red"}]}

Here is where I got the command from. All the code after the “run” in the code turned red after I entered it into command blocks.

One Answer

I know what the problem is!

execute
  if entity @a[scores={KickBed=1..}]
  if score @a[scores={sleep=1..}]
run tellraw @a {"text":"","extra":[{"selector":"@p[scores={KickBed=1,}]","color":"white"},{"text":" doesn't want to skip the night!","color":"red"}]}

The mistake is that the second if score argument needs to be if entity.

Fixed command:

execute if entity @a[scores={KickBed=1..}] if score @a[scores={sleep=1..}] run tellraw @a {"text":"","extra":[{"selector":"@p[scores={KickBed=1,}]","color":"white"},{"text":" doesn't want to skip the night!","color":"red"}]}

Answered by ExpertCoder14 on April 3, 2021

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