
novemcinctus
Members-
Posts
17 -
Joined
-
Last visited
Everything posted by novemcinctus
-
I am attempting to create throwable spawn eggs. My Item Class: The item is registered like so: GameRegistry.registerItem(new ItemThrowableEgg(), "thowableSpawnEggSpawn", MODID); The item works fine until I try to create an EntityItem out of it: When I get a huge stack trace and a NullPointerException as it tries to render in the inventory: The entityitem I see on the ground before picking it up has a missing texture. When I get a throwableEgg from my creative inventory and drop it, the texture looks fine. Why is this?
-
Sorry, I'm somewhat new to Forge. What's the best way to set and retrieve the damage value? Should I put it in the constructor? I see that the setDamage function takes an ItemStack as a parameter. Are damage values associated with individual items?
-
In my mod, I have created a new item for throwable spawn eggs: ItemThrowableEgg.java And I register it and all of its forms in preInit like so: snippet from main class preInit: All of that works fine. It appears with the correct texture in the correct inventory slot and behaves exactly as expected on right click. However, I ran into problems trying to create an EntityItem out of it. I have another class that is an event handler for LivingDropsEvent. In this class, spawn eggs are added to the drops of various mobs. The function I use to create an itemstack is this: it is then appended to the drops with: e.drops.add(new EntityItem(e.entity.worldObj, e.entity.posX, e.entity.posY, e.entity.posZ, throwableEggFor([appropriate id]); This is where everything gets messed up. When I kill a mob, I see it drops an item with the black and purple checkered texture used for items without one. When I pick it up, the game crashes:
-
I need to create a delayed explosion, but don't want to halt the execution of the main thread. I tried using java.util.Timer.schedule but ran into some concurrency issues (specifically IllegalStateExceptions). Does the world have a lock associated with it? If not, is there a better way to create a delayed explosion without stalling everything?
-
It was a misunderstanding of proper convention. I have. It is FML v7.10.85.1232 Forge 10.13.2.1232. java version is 1.6.0_65 I just created a new blank template and used a fresh forge download but I'm still getting the same error.
-
Update: I commented out everything in init and I'm still getting the same NullPointerException. This has to either be an error in my config or an issue with my workspace. Based on the last log I posted, which is more likely? I read over all my config and it seems right to me. I also posted it in my original question in case it's helpful to see.
-
I switched to JDK 1.6. Now instead of getting IllegalArgument, i have a NullPointerException. Is this unrelated? Log:
-
I recently discovered IntelliJ, and I'm loving it. It seems so much more neat and organized than eclipse. Unfortunately, I seem to be running into a few issues when starting up my mod. I cannot be certain that it is completely due to the new IDE because I did modify some of the code, but the stack trace doesn't seem to have any of my own method or class names in it. The exceptions also seem to be occurring before my init method. Here is the log: My main class (BetterDropsDriver.java): mcmod.info and finally build.gradle Could this be a problem with my configuration?
-
NullPointerException when trying to spawn custom mob
novemcinctus replied to novemcinctus's topic in Modder Support
Thanks! That was exactly it! -
I am trying to create a custom version of EntitySpider that is slightly smaller than a cave spider. I took a look at EntityCaveSpider.class for some background. What I ended up with is this: Common.java Client.java RenderMiniSpider.java EntityMiniSpider.java And the relevant part of my main class: Everything works fine until I try to spawn one in with an egg and I get a NullPointerException. I tried stepping through the code with a debugger but couldn't find exactly where it happened. Here's my console log: Am I forgetting to register something? What is returning null that shouldn't?
-
[1.7.10] Class Appears Different after Exporting Mod
novemcinctus replied to novemcinctus's topic in Modder Support
Thanks! That fixed it. I forgot the code was obfuscated. It must have been a pain to go through and change everything originally. I'll lock the topic now. -
Previously, I posted about adding spawn eggs for vanilla mobs that do not already have them. The solution I ended up finding was to add them manually. For instance, here is the code I used to add an EnderDragon egg: cpw.mods.fml.common.registry.EntityList.entityEggs.put(Integer.valueOf(63), new EntityList.EntityEggInfo(63, 0x000000, 0x660066)) This works excellently when I launch the project from eclipse, but after copying out the mod files, compressing them, and placing them into my mods folder, I get an error: java.lang.NoSuchFieldError: entityEggs Why would the entityEggs ArrayList exist only when launching the project from eclipse?
-
[1.7.10] Adding Spawn Eggs For Mobs that Don't Have Them
novemcinctus replied to novemcinctus's topic in Modder Support
Although this works fine when running from eclipse, I get NoSuchField exceptions when trying to access the same ArrayList after exporting the mod. Does anyone know why this could be? -
[1.7.10] Adding Spawn Eggs For Mobs that Don't Have Them
novemcinctus replied to novemcinctus's topic in Modder Support
Thanks RANKSHANK that's what I had tried before, but you gave me another idea when you said that. You can't register something twice, but I went to look at the code where the entity gets registered. [embed=425,349]EntityRegistry.registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)[/embed] actually calls [embed=425,349]EntityList.addMapping(Class p_75614_0_, String p_75614_1_, int p_75614_2_, int p_75614_3_, int p_75614_4_)[/embed]. That appends a value to a static ArrayList within [embed=425,349]EntityList[/embed] called [embed=425,349]entityEggs[/embed]. So, to add a new egg manually for an entity that already exists, I figured out you can do this: [embed=425,349]net.minecraft.entity.EntityList.entityEggs.put(Integer.valueOf(63), new EntityList.EntityEggInfo(63, 1, 0));[/embed] I'll leave this thread open for a bit in case someone else has a better way or a question. Thanks for the reply! -
I'm trying to register spawn eggs for some vanilla mobs that don't currently have them (specifically EnderDragons, IronGolems, WitherBosses and Snowmen). I tried to re-register them with EntityRegistry#registerGlobalEntityID but I get an error saying that it was already registered. Plus, doing that seems like a bad idea to begin with. Do I have to create a new item type for spawning them? Or can I just add standard eggs for them another way?
-
Exactly what I needed. Thanks!
-
I have been trying to modify the drops of vanilla mobs, and I'm running into some difficulty. The approach I am taking is to intercept LivingDropsEvent and then append my drops to the ArrayList there. I know the drops ArrayList is event.drops, but it is a list of EntityItem objects. The constructor for this takes a World as an argument. Is there a way to construct one from an ItemStack?