0

I remember doing this a long time ago with armor stands as it was the only entity to easily do it. I wanted to make an invisible item frame that gives the player jump boost when under the item frame. I know that I will have to use a command block to do it, or is there something that I can do with signs? (you can right click to use a command, but for the item frame have a small radius that is given to a player close to it).

I can't remember exactly how to do this, as I did once and I don't have any references to this anymore.

1 Answer 1

1

For the item frame, you can place the item frame and then run this command in a repeating command block:

execute at @e[type=item_frame] as @a[distance=..2] run effect give @s minecraft:jump_boost 2 1

This command will execute at the item frame and as any player near the location within a radius of 2, in a sphere.

You can also add a tag to the item frame to make it unique.

This will summon an invisible item frame with the custom tag Inv:

/summon item_frame ~ ~ ~ {Invisible:1b,Tags:["Inv"],Item:{}}

You can also add the tag Fixed so it doesn't need a block to sit on, as well as Invulnerable:

/summon item_frame ~ ~ ~ {Invulnerable:1b,Invisible:1b,Fixed:1b,Tags:["Inv"],Item:{}}

To test for the tagged item frame you can use this command:

execute at @e[type=item_frame,tag=Inv] as @a[distance=..2] run effect give @s minecraft:jump_boost 2 1

You can change the distance as you wish like this, the number before the two dots is the minimum, and the number after is the maximum. This distance=2..5 will affect all players at least 2 blocks away but not further than 5.


And this will give you a sign that when you click it provides the player with a jump boost:

/give @p oak_sign{BlockEntityTag:{Text1:"{\"text\":\"Click for jump boost\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"effect give @s jump_boost 2 1\"}}",id:"Sign"}}

Change this command:

effect give @s jump_boost 2 1

You'll change the first number for as many seconds as you'd like, and the amplifier is the second number.

Jump Boost I is 0

Jump Boost II is 1

and so forth.

2
  • this is awesome, it works just like how I wanted it to, just a quick question, is it possible to hide the jump boost applied to the player from the command block without changing the gamerule, i know that if you apply a command on a sign, it doesn't log it at all, i want something similar if it is possible.
    – Alfarese
    Commented May 22, 2022 at 19:08
  • Sorry for the delayed answer... If you get the gray info message like this one: i.imgur.com/W6Up574.png then the only way to remove it is through changing the gamerule comandblockoutput to false. Commented Jul 16, 2022 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.