1

Adding more than 1 potion effect

JimboPanda123 4/1/15 2:46 pm
440
4/2/2015 7:54 am
Hi,
I was making a mod and i wanted it so that when you eat the item, it gives you more than 1 potion effect.
Here is my code:
Click to reveal
itemJumpCarrot1 = new ItemFood(5, 0.2F, false).setPotionEffect(Potion.jump.id, 20, 0, 1.0F).setUnlocalizedName("ItemJumpCarrot1").setTextureName("scm:itemcarrotjump").setCreativeTab(tabSuperCarrotMod);


When i try and add more than one effect i use this code
Click to reveal
itemJumpCarrot1 = new ItemFood(5, 0.2F, false).setPotionEffect(Potion.jump.id, 20, 0, 1.0F).setPotionEffect(Potion.regeneration.id, 90, 4, 1.0F).setUnlocalizedName("ItemJumpCarrot1").setTextureName("scm:itemcarrotjump").setCreativeTab(tabSuperCarrotMod);


But then when i load Minecraft, only the regeneration effects takes place.

And ideas?
Posted by
JimboPanda123
Level 41 : Master Enderdragon
21

  Have something to say?

JoinSign in

14

JimboPanda123
04/02/2015 6:15 am
Level 41 : Master Enderdragon
I know but i am adding awsome new armor abilities, structures spawning and maybe a few mobs
1
JimboPanda123
04/02/2015 6:03 am
Level 41 : Master Enderdragon
mcrock999,
i am trying to make my mod really cool and adding lots of new stuff so i need help while doing this.
1
mcrocks999
04/02/2015 6:02 am
Level 20 : Expert Cake
I swear I remember a mod said this wouldn't be allowed.
1
Ivain
04/02/2015 6:04 am
Level 63 : High Grandmaster Terraformer
what wouldn't be allowed?
1
mcrocks999
04/02/2015 6:06 am
Level 20 : Expert Cake
this mod. Cause he said it's just a representation of whats already there.
1
Stubbs1
04/02/2015 7:54 am
He/Him • Level 75 : Legendary Wizard Senpai
Does it really matter? I know the rules says clearly: "Don't copy something that has already been made"
But I mean what if he just wanted to make the Mod for his friends? No problem in asking on the forums, right?
1
_Jxcob
04/02/2015 6:02 am
Level 1 : New Modder
It's multi-texture block. Search it in google.
1
JimboPanda123
04/02/2015 6:02 am
Level 41 : Master Enderdragon
Great thanks.
BTW do you know how to add different textures for blocks. Like oak wood for example?
1
_Jxcob
04/02/2015 6:00 am
Level 1 : New Modder
Yes, you can. I'm sure, because it worked 4 me
1
JimboPanda123
04/02/2015 5:59 am
Level 41 : Master Enderdragon
And using this code, can you make as many potion effects as you want?
1
_Jxcob
04/02/2015 5:55 am
Level 1 : New Modder
You must make new class e.g. ItemJumpCarrot that extends ItemFood

It should look like that:

package com.yourname.modid.items;

public class ItemJumpCarrot extends ItemFood {
public ItemJumpCarrot(int amount, boolean isWolfFood) {
this.setUnlocalizedName("ItemJumpCarrot1");
this.setTextureName("scm:itemcarrotjump");
this.setCreativeTab(CreativeTabs.tabFood);
}
}


Then you must add a piece of ItemGoldenApple.class code that adds potion effect.

this is your ModBlocks.java code:

itemJumpCarrot1 = new ItemJumpCarrot(amount of food points, true/false);


It's done!
1
JimboPanda123
04/02/2015 5:37 am
Level 41 : Master Enderdragon
Anyone know anything?
1
JimboPanda123
04/01/2015 3:13 pm
Level 41 : Master Enderdragon
Anyone any ideas?
1
JimboPanda123
04/01/2015 2:59 pm
Level 41 : Master Enderdragon
Please help
1

Welcome