-1

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

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .