Minecraft Blogs

Command Block tutorial; potion giving food/custom effects.

  • 2 diamonds
  • 5,694 views, 4 today
  • 3 comments
  • 0 favorites
  • 2
  • 0
  • 3
avatar zhbrzgx
Level 42 : Master Engineer
15
The following is for 14w21b or higher.
Potion food;
1. create a scoreboard objective called "eatfood" and make the stat stat.useItem.bread (It doesn't have to be bread)
2. Make a redstone clock of any kind and hook up some command blocks to it.
3. Put this command into a command block.;
/effect @a[score_eatfood_min=1] <potion> <length> <level>
4. Put this command into another command block;
/scoreboard players remove @a[score_eatfood_min=1] eatfood 1
Custom effect;
This is for a fire potion effect;
1. Add some more command blocks to your clock.
2. Create a dummy objective called custompotion.
3. Write this command in a command block;
/scoreboard players add @a[score_eatfood_min=1] custompotion <potion length>
4. Write this command in another command block;
/execute @a[score_custompotion_min=1] ~ ~ setblock ~ ~ ~ fire
5. Write this command in another command block;
/effect @a[score_custompotion__min=1] 12* 2 0 true

*or whatever the fire resist ID is.
Credit1
Tags

1
03/21/2015 11:01 am
Level 55 : Grandmaster Programmer
milomaz1
Well thats easy but i was wondering if you could do thid relative to given items so that not all bread would give you that potion effect.
1
03/21/2015 12:56 pm
Level 42 : Master Engineer
zhbrzgx
Hm.... If you test for a player holding bread with a certain name, then at the same time, you aren't holding that bread anyomre, and you have an extra "used bread" stat, it might work.
1
03/24/2015 6:21 pm
Level 55 : Grandmaster Programmer
milomaz1
Wow thanks I never thought of that cause i was wondering about this for a redstone mod im working on...
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome