2

Is there a more efficient way to do this?

web_warrior_geo_1's Avatar web_warrior_geo_15/18/24 10:41 am
2 emeralds 125 5
6/7/2024 2:31 am
link2012's Avatar link2012
i want a function to run when the value of a scoreboard is larger than the value of another another



what i have now is just 30000 lines of "execute as @a[​scores={a=1..,b=1}] run function"

and that file is 2,5 mb

anyone know of a better way?
Posted by web_warrior_geo_1's Avatar
web_warrior_geo_1
Level 1 : New Miner
1

Create an account or sign in to comment.

5

link2012
06/07/2024 2:31 am
Level 26 : Expert Crafter
history
link2012's Avatar
execute if score <player> <scoreboard> > <player2> <scoreboard2> run ...
So for example, let's say I wanted to check if the number of eggs I have exceeds my egg limit:
execute if score @s current_eggs > @s max_eggs run clear @s egg 1
1
Gamingbarn
05/18/2024 10:00 pm
Level 70 : Legendary Programmer Programmer
Gamingbarn's Avatar
For future reference, if a file in a datapack is bigger than couple dozen kb, you're probably doing it wrong.
1
web_warrior_geo_1
05/20/2024 10:44 am
Level 1 : New Miner
web_warrior_geo_1's Avatar
i realized that when i opened the game and had .01 tps
2
web_warrior_geo_1
05/18/2024 12:19 pm
Level 1 : New Miner
web_warrior_geo_1's Avatar
update, i found it"scoreboard players operation @s c = @s a
scoreboard players operation @s c -= @s b

execute as @a[tag=atlan,scores={c=0..}] run say test
"



"c=0.." for a>b and "c=..0" for a<b
1
web_warrior_geo_1
05/18/2024 12:11 pm
Level 1 : New Miner
web_warrior_geo_1's Avatar
no is a valid answer
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome