I'm trying to add a value (0.1) to a horse's jump height, which I've already set to 0.7. I can't figure out how to add a value to jump height versus setting it. Does anyone know how to accomplish this? This is all I have right now.
execute at @e[type=minecraft:horse,sort=nearest,limit=1,tag=!set] run data modify entity @e[sort=nearest,limit=1] Attributes[7].Base
I'm trying to add a value (0.1) to a horse's jump height, which I've already set to 0.7. I can't figure out how to add a value to jump height versus setting it. Does anyone know how to accomplish this? This is all I have right now.
execute at @e[type=minecraft:horse,sort=nearest,limit=1,tag=!set] run data modify entity @e[sort=nearest,limit=1] Attributes[7].Base
To modify an attribute:
/data modify entity <entity> Attributes[0].Base set value 10.0d
I was looking for a way to add a value to the horse's jump height which is already set to 0.7. As in, "execute at @e[type=minecraft:horse,sort=nearest,limit=1,tag=!set] run data modify entity @e[sort=nearest,limit=1] Attributes[7].Base set value 0.7d" to set it, and then I would like to add 0.1d to that value, regardless of the current jump height value. Is this possible in vanilla with command blocks, or if not so, is it possible with datapacks?
A common assumption a lot of people make about data packs is that they are some sort of mod or something that can do things vanilla commands can't but really, a data pack is a folder in which you store function files which contain vanilla commands.
To increase this value, you would have to store it into a scoreboard objective, increase it by using /scoreboard players operation and then store it back. The problem with this is that scoreboard objectives only support round numbers so your 0.7 would become a 0 if stored into an objective. Unless there is some sort of tricky workaround, I don't see this being possible.
Many people have suggested these sort of things to be implemented into the game and I would really like to see support for more data types in scoreboard objectives so we can do things like this.
I'm trying to add a value (0.1) to a horse's jump height, which I've already set to 0.7. I can't figure out how to add a value to jump height versus setting it. Does anyone know how to accomplish this? This is all I have right now.
execute at @e[type=minecraft:horse,sort=nearest,limit=1,tag=!set] run data modify entity @e[sort=nearest,limit=1] Attributes[7].Base
To modify an attribute:
keep in mind that the index starts from 0.
Command block engineer // Developer // #TeamTrees
I was looking for a way to add a value to the horse's jump height which is already set to 0.7. As in, "execute at @e[type=minecraft:horse,sort=nearest,limit=1,tag=!set] run data modify entity @e[sort=nearest,limit=1] Attributes[7].Base set value 0.7d" to set it, and then I would like to add 0.1d to that value, regardless of the current jump height value. Is this possible in vanilla with command blocks, or if not so, is it possible with datapacks?
A common assumption a lot of people make about data packs is that they are some sort of mod or something that can do things vanilla commands can't but really, a data pack is a folder in which you store function files which contain vanilla commands.
To increase this value, you would have to store it into a scoreboard objective, increase it by using /scoreboard players operation and then store it back. The problem with this is that scoreboard objectives only support round numbers so your 0.7 would become a 0 if stored into an objective. Unless there is some sort of tricky workaround, I don't see this being possible.
Many people have suggested these sort of things to be implemented into the game and I would really like to see support for more data types in scoreboard objectives so we can do things like this.
Command block engineer // Developer // #TeamTrees