I am trying to make it so that when a player jumps, their xp goes up. I have already set up the scoreboard command (/scoreboard objectives add jump minecraft.custom:jump "Jumps"
) and I am also trying to figure out how to use /execute
to see if that score has increased, and if so, run /xp add @p 1 level
. (Using /execute as
would be preferable because then I wouldn't have to specify what player to add the xp to.)
Minecraft – How to you test if a player’s scoreboard score has gone up with /execute
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – My arrows aren’t being executed at by a looping function/command block
- Minecraft – Can somebody help me with the execute commands in Minecraft
- Minecraft – (Java Minecraft 1.14) How to save a player’s scoreboard team temporarily for later use
- Minecraft – How to do /scoreboard players test functions in 1.14
- Minecraft – How to use an index with /execute with Vanilla Minecraft Commands
- Minecraft – Why does /execute store refuse to update an NBT number when provided with a scoreboard value
Best Answer
First add another scoreboard which will keep track of the Jumps scoreboard
Now we will check if jum is higher than the last time we checked
Then we update prevJump
/tag @e remove addXpLevel
This will also give you 2 levels if you would jump twice in the same frame. This might be more usefull for other uses.