Minecraft Blogs / Tutorial

Command Block tutorial; potion giving food/custom effects.

  • 8,144 views, 1 today
  • 4
  • 2
  • 3
zhbrzgx's Avatar zhbrzgx
Level 42 : Master Engineer
17
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

Create an account or sign in to comment.

1
03/21/2015 11:01 am
Level 59 : Grandmaster Programmer
milomaz1
milomaz1's Avatar
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
zhbrzgx's Avatar
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 59 : Grandmaster Programmer
milomaz1
milomaz1's Avatar
Wow thanks I never thought of that cause i was wondering about this for a redstone mod im working on...
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome