
dude22072
Members-
Posts
185 -
Joined
-
Last visited
Everything posted by dude22072
-
What mod is it?
-
Make item damaged in crafting get repaired.
dude22072 replied to dude22072's topic in Modder Support
What do i do within the class? (also here is my crafting manager if i can just use this file) package dudesmods.lozmod; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.ICraftingHandler; public class LOZCraftingHandler implements ICraftingHandler { public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) { for(int i=0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i) != null) { ItemStack j = inv.getStackInSlot(i); if(j.getItem() != null && j.getItem() == LOZmod.magicPowder) { ItemStack k = new ItemStack(LOZmod.magicPowder, 2, (j.getItemDamage() + 1)); inv.setInventorySlotContents(i, k); } } } } @Override public void onSmelting(EntityPlayer player, ItemStack item) { // TODO Auto-generated method stub } } -
Make item damaged in crafting get repaired.
dude22072 replied to dude22072's topic in Modder Support
1.this would still clone it 2.i don't want it to be 100%, if i did i would use the anvil Aw, for the love of Pete. Just show me your code. Maybe I didn't explain well enough: I have an item. When you use it in a crafting recipe it remains and simply takes damage(Like the minium stone from EE3). I want the item to have a recipe that repairs the item instead of damaging it. -
Make item damaged in crafting get repaired.
dude22072 replied to dude22072's topic in Modder Support
1.this would still clone it 2.i don't want it to be 100%, if i did i would use the anvil -
Make item damaged in crafting get repaired.
dude22072 replied to dude22072's topic in Modder Support
That just clones the item. -
Is their a way i can make an item that gets damaged in crafting get repaired via crafting?
-
onBlockActivated not working (Changing from one block to another)
dude22072 replied to dude22072's topic in Modder Support
Still doesn't change and still crashes. Modified Code: package dudesmods.lozmod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class BlockPedistal extends Block { public BlockPedistal(int par1) { super(par1, Material.rock); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(par5EntityPlayer.getHeldItem().itemID == LOZmod.swordMaster.itemID) { par5EntityPlayer.getHeldItem().stackSize -= 1; //only if you want to use the item when you do this. if(par1World.isRemote) { par1World.setBlock(par2, par3, par4, LOZmod.pedistalSword.blockID); } return true; } if(par5EntityPlayer.getHeldItem() == null) { return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); } else return false; } } -
when i right click the block with the specified item it flashes to what it should change to then flashes back. It also crashed the game if clicked with an empty hand. Code: package dudesmods.lozmod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class BlockPedistal extends Block { public BlockPedistal(int par1) { super(par1, Material.rock); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(par5EntityPlayer.getHeldItem().itemID == LOZmod.swordMaster.itemID) { par5EntityPlayer.getHeldItem().stackSize -= 1; //only if you want to use the item when you do this. if(par1World.isRemote) { par1World.setBlock(par2, par3, par4, LOZmod.pedistalSword.blockID); } } return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); } }
-
How do i use VillageCreationHandler?
-
I can't seem to figure it out
-
OK. Eclipse messed with my stuff for some reason. fixed now.
-
[Solved] Entity is invisible (Render doen't work)
dude22072 replied to MaSch212's topic in Modder Support
Yes but I have "EntityRegistry.registerGlobalEntityID". I don't really know the differences between "registerGlobalEntityID" and "registerModEntity". Do I have to write both in the ClientProxy? Or do I have to put them in another class? You put registerModEntity in the same place as registerGlobalEntityID registerGlobalEntityID gives the entity a unique id (like in the older versions of minecraft if you pressed F3 you'dd see numbers above mobs heads) registerModEntity actually tells the game their is an entity. -
Im trying to make a vanilla cow drop a new item. ModLivingDropsEvent: package dudesmods.lozmod; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityCow; import net.minecraft.item.Item; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraft.entity.EntityLiving; public class ModLivingDropsEvent { public static double rand; @ForgeSubscribe public void onEntityDrop(ModLivingDropsEvent event) { if(event.entityLiving instanceof EntityCow) { event.entityLiving.dropItem(LOZmod.greenTannedLeather.itemID); } } } it gives me a red underline on both of the "entityLiving" parts saying it cannot be resolved or is not a field.
-
[Solved] Entity is invisible (Render doen't work)
dude22072 replied to MaSch212's topic in Modder Support
you have no EntityRegistry.registerModEntity -
Still not working. Revised EntityBomb: package dudesmods.lozmod; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.Explosion; import net.minecraft.world.World; public class EntityBomb extends EntityThrowable { public int field_92057_e = 1; public EntityBomb(World par1World) { super(par1World); } public EntityBomb(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } public EntityBomb(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0); } if(this.worldObj.isRemote) { explode(); } if(!this.worldObj.isRemote) { this.setDead(); } System.out.println(worldObj); } public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setInteger("ExplosionLOZBomb", this.field_92057_e); } public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); if (par1NBTTagCompound.hasKey("ExplosionLOZBomb")) { this.field_92057_e = par1NBTTagCompound.getInteger("ExplosionLOZBomb"); } } private void explode() { if(!exploded) { exploded = true; worldObj.createExplosion(this, posX, posY, posZ, 4.0F, true); } } boolean exploded; }
-
When just thrown i get: 2013-05-12 17:00:16 [iNFO] [sTDOUT] net.minecraft.world.WorldServer@55a8c7aa But when i throw it up, it comes down, and explodes i get: 2013-05-12 17:00:09 [iNFO] [sTDOUT] net.minecraft.world.WorldServer@55a8c7aa 2013-05-12 17:00:09 [iNFO] [sTDOUT] net.minecraft.client.multiplayer.WorldClient@4ba70c56
-
I have created a throw-able bomb(grenade i guess) but it doesn't explode if i throw it forward or down i have to throw it up into the air and it must com back down to the ground it doesn't even work if i throw it up at a tree it has to come back to the ground. EntityBomb: package dudesmods.lozmod; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.Explosion; import net.minecraft.world.World; public class EntityBomb extends EntityThrowable { public EntityBomb(World par1World) { super(par1World); } public EntityBomb(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } public EntityBomb(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0); } if(this.worldObj.isRemote) { explode(); } if(!this.worldObj.isRemote) { this.setDead(); } } private void explode() { if(!exploded) { exploded = true; worldObj.createExplosion(this, posX, posY, posZ, 4.0F, true); } } boolean exploded; } ItemBomb: package dudesmods.lozmod; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemBomb extends Item { public ItemBomb(int par1) { super(par1); setMaxStackSize(32); setCreativeTab(LOZmod.tabLozMod); } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if(!entityplayer.capabilities.isCreativeMode) { --itemstack.stackSize; } if (!world.isRemote) { world.spawnEntityInWorld(new EntityBomb(world, entityplayer)); } return itemstack; } } ModClassStuffs: bomb = new ItemBomb(16501).setUnlocalizedName("bomb").setMaxStackSize(32); EntityRegistry.registerGlobalEntityID(EntityBomb.class, "bomb", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityBomb.class, "bomb", 2, this, 20, 2, false); (im aware i have no RenderingRegistry thing, it shows up as a white box and i'm fine with that until i get this to work.
-
I'm making a new bow/arrow for a mod i'm crating but the arrow does not render in world(its still just the default arrow texture so i cant think that thats an issue) Codes and such: ItemHeroBow: EntityHeroArrow: RenderHeroArrow: Things in basemod file: public static Item arrowHero = new blankItem(16508).setUnlocalizedName("arrowHero"); public static Item heroBow = new ItemHeroBow(16510).setUnlocalizedName("heroBow"); RenderingRegistry.registerEntityRenderingHandler(EntityHeroArrow.class, new RenderHeroArrow());