Arqade Asked by SophieEFoster on December 7, 2020
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.)
First add another scoreboard which will keep track of the Jumps scoreboard
/scoreboard objectives add prevJump dummy
Now we will check if jum is higher than the last time we checked
/execute as @e if score @s prevJump < @s jump run tag @s add addXpLevel
Then we update prevJump
/xp add @e[tag=addXpLevel] 1 level
/scoreboard players add @e[tag=addXpLevel] prevJump 1
/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.
Answered by Khoeckman on December 7, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP