You can use command blocks, type in the chat window /give username 137
with commands enabled (if you're OP), and it will give you a command block. You need to be OP and in creative mode to use these. Place it and right click it, and you will see a text field where you can type
/effect @p <effect_id> 1000000 [amplifier]
.
This will give the closest player to the block 1000000 seconds of the effect when it's activated with redstone. Effect id's are listed on this page, the first column is the number you'll have to use as <effect_id>
. The amplifier can be any number between 1 and 255. Normal potions will give either 1 or 2 as amplification. For example, to give the player speed 2, the command has to be
/effect @p 1 1000000 2
.
or for jump boost 5, you'd get
/effect @p 8 1000000 5
.
You should watch out that any amplifier value between 128 and 250 will disable jumping, and any value above 251 will decrease jump height.
If you activate the command block with a button, for example, you'll get almost infinitely speed 2.
A command block with time 0, like /effect @p <effect_id> 0
will disable the effect when powered.
There's more information about command blocks at the minecraft wiki.
1.8 snapshots Edit:
In the 1.8 snapshots, an extra parameter can be added to the command, which will hide particles when set to true. This will remove the curly particles around your head, whilst still giving the effect. eg. /effect @p 8 1000000 1 true
.
Also, as Zoweb pointed out, command blocks are now obtained using the command /give <playername> command_block
, instead of the id 137.
The simplest way you can do this is have a fast clock, but don't check if there is a player that has died. Instead, just put your Minecraft username there and it will keep giving you the potion effect even after you die. E.g. (gives jump boost 2 to player with name 'username'):
/effect username minecraft:jump_boost 99999 2
Alternatively, if you want this to work with any two people, have a scoreboard objective and set it to 1 for the player to receive the potion effect. Then give the player with a score of 1 for that objective the potion effect with a really fast clock.
/effect @a[score_effect_min=1] minecraft:jump_boost 99999 2
Hope this helped you!
Best Answer
You can do this using a scoreboard objective and Data Tags.
To check for worn items, you will need to look at
{Inventory:[{Slot:Xb,...}]}
, where X is the appropriate slot, as follows: Helmet: 103, Chestplate: 102, Leggings: 101, Boots: 100. Replace the ellipsis with the items data tag, such asid:minecraft_diamond_boots
ortag:{display:{Name:"Bob"}}
(More info can be found at the wiki article on item structure).Here's an example with jumping boots called "Rocket Boots", for both 1.9 and 1.8:
1.9
Set up a repeat/chain command block line and run
This will add the "jumpBoots" tag to everyone wearing "Rocket Boots". Every player with this tag gets a jump boost effect for 1 second, with magnitude 2 and without swirley particle effects.
1.8
For 1.8, you need to set up a scoreboard objective first:
You only have to do this once. Now put a some command blocks on a setblock/fill clock, and execute, in this order:
Since tags don't exist in 1.8, we use a scoreboard that is set to 0 or 1 depending on whether or not a player is wearing the boots.