1

Adding more than 1 potion effect

JimboPanda123's Avatar JimboPanda1234/1/15 2:46 pm
4/2/2015 7:54 am
Stubbs1's Avatar Stubbs1
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's Avatar
JimboPanda123
Level 41 : Master Enderdragon
21

Create an account or sign in to comment.

14

1
04/02/2015 6:15 am
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
I know but i am adding awsome new armor abilities, structures spawning and maybe a few mobs
1
04/02/2015 6:03 am
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
mcrock999,
i am trying to make my mod really cool and adding lots of new stuff so i need help while doing this.
1
04/02/2015 6:02 am
Level 20 : Expert Cake
mcrocks999
mcrocks999's Avatar
I swear I remember a mod said this wouldn't be allowed.
1
04/02/2015 6:04 am
Level 61 : High Grandmaster Terraformer
Ivain
Ivain's Avatar
what wouldn't be allowed?
1
04/02/2015 6:06 am
Level 20 : Expert Cake
mcrocks999
mcrocks999's Avatar
this mod. Cause he said it's just a representation of whats already there.
1
04/02/2015 7:54 am
Level 67 : High Grandmaster Senpai
Stubbs1
Stubbs1's Avatar
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
04/02/2015 6:02 am
Level 1 : New Modder
_Jxcob
_Jxcob's Avatar
It's multi-texture block. Search it in google.
1
04/02/2015 6:02 am
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
Great thanks.
BTW do you know how to add different textures for blocks. Like oak wood for example?
1
04/02/2015 6:00 am
Level 1 : New Modder
_Jxcob
_Jxcob's Avatar
Yes, you can. I'm sure, because it worked 4 me
1
04/02/2015 5:59 am
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
And using this code, can you make as many potion effects as you want?
1
04/02/2015 5:55 am
Level 1 : New Modder
_Jxcob
_Jxcob's Avatar
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
04/02/2015 5:37 am
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
Anyone know anything?
1
04/01/2015 3:13 pm
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
Anyone any ideas?
1
04/01/2015 2:59 pm
Level 41 : Master Enderdragon
JimboPanda123
JimboPanda123's Avatar
Please help
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome