Posted December 16, 20168 yr I am trying to make so when a MagmaBlock hits water it will turn into MagmaIngot (Selfmade) but when i try to spawn it i get an error. EntityJoinWorldEventHandler Class: [embed=425,349]package thaun.thaunsmod.handler; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import thaun.thaunsmod.Blocks.MagmaEntity; public class EntityJoinWorldEventHandler { @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if(event.getEntity() instanceof EntityItem) { if(((EntityItem)event.getEntity()).getEntityItem().getItem() == Item.getItemFromBlock(Blocks.MAGMA)) { event.setCanceled(true); MagmaEntity entityItem = new MagmaEntity(event.getEntity().worldObj, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, ((EntityItem)event.getEntity()).getEntityItem()); if (!event.getWorld().isRemote) { System.out.println("Sending out signal: 1"); event.getEntity().getEntityWorld().spawnEntityInWorld(entityItem); } } } } } [/embed] MagmaBlock class: [embed=425,349]package thaun.thaunsmod.Blocks; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import thaun.thaunsmod.Items.ItemInit; public class MagmaEntity extends EntityItem{ public MagmaEntity(World worldIn, double x, double y, double z, ItemStack stack) { super(worldIn, x, y, z, stack); } @Override public void onUpdate() { if(this.isWet()) { EntityItem entity = new EntityItem(worldObj, this.posX, this.posY, this.posZ, new ItemStack(ItemInit.magmaIngot)); worldObj.spawnEntityInWorld(entity); System.out.println("Sending out signal: 2"); } } }[/embed] I have [embed=425,349]MinecraftForge.EVENT_BUS.register(new EntityJoinWorldEventHandler());[/embed] in Post-Init What i get as output is alot of "Sending out signal: 1" and this error that is huge... http://pastebin.com/dWQcyCqe
December 16, 20168 yr My guess is that you haven't registered your entity. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 16, 20168 yr Author I looked thru some Entity Registering and i cant understand them. That means i do not know how to register the entity.
December 16, 20168 yr Author Did this: [embed=425,349] EntityRegistry.registerModEntity(Blocks.MAGMA.getRegistryName(), MagmaEntity.class, "magma", 1899, this, 1, 1, false);[/embed] Seems i get the same error... I dont really know how to use this stuff really well...
December 17, 20168 yr Author Well, lets say i dont know what i am doing. When it comes to forge modding, im kinda a novice at this. What i want it to do is: When a Magma Block ENTITY iswet or is in water i want it to turn itself into another item that i created.
December 17, 20168 yr Yes, we know. Diesieben07 has pointed out the problems with your current code. You need to fix those. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.