Probably the most compact design I know is like this:
W-W-B
W-R-T
W = Redstone Wire
B = Any solid block
R = Repeater
T = Redstone Torch
Taken from minecraftwiki.
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 as id:minecraft_diamond_boots
or tag:{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
/scoreboard players tag @a[tag=jumpBoots] remove jumpBoots
/scoreboard players tag @a[tag=!jumpBoots] add jumpBoots {Inventory:[{Slot:100b,tag:{display:{Name:"Rocket Boots"}}}]}
/effect @a[tag=jumpBoots] minecraft:jump_boost 1 2 true
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:
/scoreboard objective add jumpBoots
You only have to do this once. Now put a some command blocks on a setblock/fill clock, and execute, in this order:
/scoreboard players set @a jumpBoots 0
/scoreboard players set @a jumpBoots 1 {Inventory:[{Slot:100b,tag:{display:{Name:"Rocket Boots"}}}]}
/effect @a[score_jumpBoots_min=1] minecraft:jump_boost 1 2 true
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.
Best Answer
/give @p potion 1 16417
should give you a level II regeneration splash potion; replace16417
with16449
for an extended level I.(After snapshot 15w31a, potions use the
{Potion: type}
tag to indicate their effect; useregeneration
,strong_regeneration
orlong_regeneration
intype
for the respective potions.)Unfortunately, the lengths and intensities of potions are hard-set; to my memory it is impossible to make custom potions without command-block trickery on, say, a water bottle. However, you could set up a command block, put in a book (or just type each time) the command
/effect @p 10 1000000 2
(which is `/effect [player] [ID] [length] ; see this wiki page for all effect IDs).