The Meaning of Life, the Universe, and Everything.
Join Date:
12/28/2011
Posts:
49
Member Details
You make very good tutorials and you help me a lot. It would be very nice if you could do some tutorials to make those mods worked in multiplayer ( like with modloadermp or something )
You make very good tutorials and you help me a lot. It would be very nice if you could do some tutorials to make those mods worked in multiplayer ( like with modloadermp or something )
Thanks so much! This was really helpful. I only just started modding and made a new biome with only one error (accidentally capitalized biomeID, whoops!) but other than that, thank you. The tutorial was super easy to understand and follow along with. Can't wait for the dimension tutorial.
How about adding a potion effect to a sword? (ie When you attack a mob, it will assign the mob a potion effect)
I can help you on this one by showing you some code from one of my throwable items.
protected void onImpact(MovingObjectPosition movingobjectposition)
{
byte byte1 = rand.nextInt(10 + 10);
if (movingobjectposition.entityHit != null)
{
byte byte0 = 0;
if (movingobjectposition.entityHit instanceof EntityLiving)
{
byte0 = 2;
}
if (!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0));
if (byte0 > 0)
{
((EntityLiving)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, byte1 * 20, 0));
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
}
if (!worldObj.isRemote)
{
setEntityDead();
}
}
It should pretty much be self-explanatory.
Well...I'll explain byte0 and byte1
byte0 is the damage (0-20) that it deals to a monster on impact
byte1 is a random number I used to determine how long the poison effect lasts -- between 10 and 20 seconds (at least I think it's seconds)
Um, not sure if I should post this here, but I am trying to make a item give a potion effect on right click, but I am having some problems
My code:
package net.minecraft.src;
import java.util.Random;
public class ItemHum extends Item
{
public ItemHum (int i)
{
super(i);
maxStackSize = 16;
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world,
int i, int j, int k, int l)
{
addPotionEffect(new PotionEffect(Potion.regeneration.id, 10, 0));
}
}
line, that tells the game what to give the effect to, but I am not sure, I may need some other stuff but I am not sure, so if you know what to do please tell me.
-Thank You-
Um, not sure if I should post this here, but I am trying to make a item give a potion effect on right click, but I am having some problems
My code:
package net.minecraft.src;
import java.util.Random;
public class ItemHum extends Item
{
public ItemHum (int i)
{
super(i);
maxStackSize = 16;
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world,
int i, int j, int k, int l)
{
addPotionEffect(new PotionEffect(Potion.regeneration.id, 10, 0));
}
}
line, that tells the game what to give the effect to, but I am not sure, I may need some other stuff but I am not sure, so if you know what to do please tell me.
-Thank You-
If you want it to give a potion effect from consuming it like a food, you can just extend ItemFood, then when you initialize the item you can use...
...something like what rotten flesh uses to inflict status effects on you.
I know how to make potion effect food, I was thinking more to the effect of an item that let you do it several times, and that would have condition, but thanks for the help.
I know how to make potion effect food, I was thinking more to the effect of an item that let you do it several times, and that would have condition, but thanks for the help.
Couldn't you just modify a food-type item to have multiple uses then? Like tools, for example.
Could you add a tutorial about Using XP orbs? Cuz I was going to make a magic mod, but using Xp as power :biggrin.gif:
P.S. when is the Dimension tuts going to be out?
OK, thanks.
Sure, that sounds like fun
Nice, thanks !
Could you look at this code and see what is wrong? The class is called BlockMultiCrafter:
Could you Make one onNPCs possibly?
Working on it
- Vipen
GUIS! I know you can, because the EnergyCell thing.
I can help you on this one by showing you some code from one of my throwable items.
It should pretty much be self-explanatory.
Well...I'll explain byte0 and byte1
byte0 is the damage (0-20) that it deals to a monster on impact
byte1 is a random number I used to determine how long the poison effect lasts -- between 10 and 20 seconds (at least I think it's seconds)
My code:
-Thank You-
If you want it to give a potion effect from consuming it like a food, you can just extend ItemFood, then when you initialize the item you can use...
...something like what rotten flesh uses to inflict status effects on you.
I know how to make potion effect food, I was thinking more to the effect of an item that let you do it several times, and that would have condition, but thanks for the help.
Couldn't you just modify a food-type item to have multiple uses then? Like tools, for example.