Everything posted by Monstrous_Apple
-
[1.8.9] Custom Mob Drops Only With Specific Item?
I've been trying to do that for ages even before you said and before I asked for help but I can't figure out which ones to use...
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Okay well I have this and now it gives me an error on "ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);" on both of the "harvester" parts saying "harvester cannot be resolved or is not a field"? //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem); if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } }
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Okay well I have this and now it gives me an error on "ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);" on both of the "harvester" parts saying "harvester cannot be resolved or is not a field"? //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem); if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } }
-
[1.8.9] Custom Dimension?
Okay where do I start with making a custom dimension? Also could anyone give me a 1.8.9 tutorial on this if they know of one and if not would a 16.4 or 1.7.2/1.7.10 tutorial for it work for 1.8.9? Like has the code changed or not for this specific task? Thanks.
-
[1.8.9] Custom Dimension?
Okay where do I start with making a custom dimension? Also could anyone give me a 1.8.9 tutorial on this if they know of one and if not would a 16.4 or 1.7.2/1.7.10 tutorial for it work for 1.8.9? Like has the code changed or not for this specific task? Thanks.
-
[1.8.9] Custom Mob Drops Only With Specific Item?
//Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { Object holding = new ItemStack(MAItems.SoulHarvester); if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } } Didn't you say to literally only add this: if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { When I did that it said "holding cannot be resolved to a variable" so I tried making one which is this here: Object holding = new ItemStack(MAItems.SoulHarvester); So what did I actually do wrong? And by the way I can't get the event.source.getEntity() working...
-
[1.8.9] Custom Mob Drops Only With Specific Item?
//Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { Object holding = new ItemStack(MAItems.SoulHarvester); if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } } Didn't you say to literally only add this: if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { When I did that it said "holding cannot be resolved to a variable" so I tried making one which is this here: Object holding = new ItemStack(MAItems.SoulHarvester); So what did I actually do wrong? And by the way I can't get the event.source.getEntity() working...
-
[1.8.9] Tool Tips
Ah thanks I see what the problem was thanks
-
[1.8.9] Tool Tips
Ah thanks I see what the problem was thanks
-
[1.8.9] Custom Mob Drops Only With Specific Item?
My way still works fine for making it drop when using the sword only though? Why change it? And okay thanks for the chance to drop help I'll have a look at what I can do.
-
[1.8.9] Custom Mob Drops Only With Specific Item?
My way still works fine for making it drop when using the sword only though? Why change it? And okay thanks for the chance to drop help I'll have a look at what I can do.
-
[1.8.9] Tool Tips
Define "not working." What is it that the code does that you don't want or what is it that the code isn't doing that you do want? Ah thanks didn't notice the unused block, and well what I'm trying to do with the code is make a tool tip for individual items, so for the arrow mould I was "Arrow Mould Text" and for the Banana Seeds I want "Banana Seeds Text" (to test if it works) but it doesn't add a tool tip with any of the three codes, I'm not actually sure why though? I created them in this class: MAItems: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import com.MonstrousApple.mod.blocks.MABlocks; import com.MonstrousApple.mod.items.crops.MAItemSeeds; import com.MonstrousApple.mod.items.durabletools.MAArrowMouldDurableTools; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; public class MAItems { public static Item ArrowMould; public static Item BananaSeeds; public static void initItems() { GameRegistry.registerItem(ArrowMould = new MAArrowMouldDurableTools("ArrowMould"), "ArrowMould"); GameRegistry.registerItem(BananaSeeds = new MAItemSeeds(MABlocks.BananaPlant, Blocks.farmland, "BananaSeeds"), "BananaSeeds"); } }
-
[1.8.9] Tool Tips
Define "not working." What is it that the code does that you don't want or what is it that the code isn't doing that you do want? Ah thanks didn't notice the unused block, and well what I'm trying to do with the code is make a tool tip for individual items, so for the arrow mould I was "Arrow Mould Text" and for the Banana Seeds I want "Banana Seeds Text" (to test if it works) but it doesn't add a tool tip with any of the three codes, I'm not actually sure why though? I created them in this class: MAItems: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import com.MonstrousApple.mod.blocks.MABlocks; import com.MonstrousApple.mod.items.crops.MAItemSeeds; import com.MonstrousApple.mod.items.durabletools.MAArrowMouldDurableTools; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; public class MAItems { public static Item ArrowMould; public static Item BananaSeeds; public static void initItems() { GameRegistry.registerItem(ArrowMould = new MAArrowMouldDurableTools("ArrowMould"), "ArrowMould"); GameRegistry.registerItem(BananaSeeds = new MAItemSeeds(MABlocks.BananaPlant, Blocks.farmland, "BananaSeeds"), "BananaSeeds"); } }
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Never mind I figured it outs, thanks a lot Edit: Actually there's on more question, I'm now using this as my code for the specific sword: //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { Object holding = new ItemStack(MAItems.SoulHarvester); if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } } What code do I add, and where do I add it for a drop chance? So like if I wanted the soul to only drop 10% of the time how would I do this?
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Never mind I figured it outs, thanks a lot Edit: Actually there's on more question, I'm now using this as my code for the specific sword: //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { Object holding = new ItemStack(MAItems.SoulHarvester); if (holding != null && ((ItemStack) holding).getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } } What code do I add, and where do I add it for a drop chance? So like if I wanted the soul to only drop 10% of the time how would I do this?
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Okay what about the "holding" variable? What would I set that to? New current code: //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } }
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Okay what about the "holding" variable? What would I set that to? New current code: //Cow Soul @SubscribeEvent public void addEntityDrop50 (LivingDropsEvent event) { if (event.entity instanceof EntityCow) { if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack)); } } }
-
[1.8.9] Custom Mob Drops Only With Specific Item?
So is that all I have to do is add this in: if (holding != null && holding.getItem() instanceof MABlazePickaxeTool) { but change "MABlazePickaxeTool" to the swords class? And that's literally it? Because I can see this going towards me trying it like that then it not working asking a stupid question and people moan at me?
-
[1.8.9] Custom Mob Drops Only With Specific Item?
So is that all I have to do is add this in: if (holding != null && holding.getItem() instanceof MABlazePickaxeTool) { but change "MABlazePickaxeTool" to the swords class? And that's literally it? Because I can see this going towards me trying it like that then it not working asking a stupid question and people moan at me?
-
[1.8.9] Custom Mob Drops Only With Specific Item?
It does work, but the pig soul always drops no matter what where I want it to drop when only holding a specific sword, but have no clue how to do that?
-
[1.8.9] Custom Mob Drops Only With Specific Item?
It does work, but the pig soul always drops no matter what where I want it to drop when only holding a specific sword, but have no clue how to do that?
-
[1.8.9] Tool Tips
Okay so I'm trying to get a tool tip on individual items that are linked to the same class, I've tried this: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { list.add(""); } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } And this: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } else if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { return; } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } And this...: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } else if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { list.add(""); } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } But obviously they aren't working or I wouldn't be asking for help, so yeah does anyone know what I need to do to fix this? And could you tell me out of the three attempts which is closest? Thanks.
-
[1.8.9] Tool Tips
Okay so I'm trying to get a tool tip on individual items that are linked to the same class, I've tried this: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { list.add(""); } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } And this: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } else if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { return; } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } And this...: package com.MonstrousApple.mod.items; import java.util.List; import com.MonstrousApple.mod.MAGlobal; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class MAItem extends Item { public MAItem(String name) { super(); this.setUnlocalizedName(name); this.setCreativeTab(MAGlobal.maCreativeTabItems); } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4){ if (this == MAItems.ArrowMould) { list.add("Arrow Mould Text"); } else if(this == MAItems.BananaSeeds) { list.add("Banana Seed Text"); } else { list.add(""); } } { } /** @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add("Example"); }*/ } But obviously they aren't working or I wouldn't be asking for help, so yeah does anyone know what I need to do to fix this? And could you tell me out of the three attempts which is closest? Thanks.
-
[1.8.9] Custom Mob Drops Only With Specific Item?
I have this code for a pickaxe where I mine the block and it removes the current drops and adds in another, and this only works if using the specific pickaxe, this is what I want to do for the sword against mobs but can't figure it out? //Blaze Pickaxe Blocks //Cobblestone Into Stone @SubscribeEvent public void addBlockDrop1 (HarvestDropsEvent event) { if (event.state.getBlock() == Blocks.cobblestone) { ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem); if (holding != null && holding.getItem() instanceof MABlazePickaxeTool) { event.drops.clear(); event.drops.add(new ItemStack(Blocks.stone)); } } }
-
[1.8.9] Custom Mob Drops Only With Specific Item?
I have this code for a pickaxe where I mine the block and it removes the current drops and adds in another, and this only works if using the specific pickaxe, this is what I want to do for the sword against mobs but can't figure it out? //Blaze Pickaxe Blocks //Cobblestone Into Stone @SubscribeEvent public void addBlockDrop1 (HarvestDropsEvent event) { if (event.state.getBlock() == Blocks.cobblestone) { ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem); if (holding != null && holding.getItem() instanceof MABlazePickaxeTool) { event.drops.clear(); event.drops.add(new ItemStack(Blocks.stone)); } } }
IPS spam blocked by CleanTalk.