1
Adding more than 1 potion effect
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:
When i try and add more than one effect i use this code
But then when i load Minecraft, only the regeneration effects takes place.
And ideas?
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?
Create an account or sign in to comment.
14
1
I know but i am adding awsome new armor abilities, structures spawning and maybe a few mobs
1
mcrock999,
i am trying to make my mod really cool and adding lots of new stuff so i need help while doing this.
i am trying to make my mod really cool and adding lots of new stuff so i need help while doing this.
1
I swear I remember a mod said this wouldn't be allowed.
1
what wouldn't be allowed?
1
this mod. Cause he said it's just a representation of whats already there.
1
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?
But I mean what if he just wanted to make the Mod for his friends? No problem in asking on the forums, right?
1
It's multi-texture block. Search it in google.
1
Great thanks.
BTW do you know how to add different textures for blocks. Like oak wood for example?
BTW do you know how to add different textures for blocks. Like oak wood for example?
1
Yes, you can. I'm sure, because it worked 4 me
1
And using this code, can you make as many potion effects as you want?
1
You must make new class e.g. ItemJumpCarrot that extends ItemFood
It should look like that:
Then you must add a piece of ItemGoldenApple.class code that adds potion effect.
this is your ModBlocks.java code:
It's done!
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
Anyone know anything?
1
Anyone any ideas?
1
Please help