#How to store a scoreboard in a variable

3 messages · Page 1 of 1 (latest)

worldly thunder
#

It might seem simple but I can't figure out how to store a player's dummy scoreboard in a variable to reuse it later in a conditional statement I've only found how to see all the scores but not their values could you please help me
(neoforge 1.21.1)

drifting caveBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

jolly oar
#

it's apparently possible to get the global scoreboard from a player object

this is how you'd get a players score in any event that gives you a player:

const { player } = event;
const { scoreboard } = player;

const score = scoreboard.getOrCreatePlayerScore(player, scoreboard.getObjective("somescoreboardobjective"))
player.tell(score.get())