Jump to content

Recommended Posts

Posted

I have it set to spawn in the nether, which it looks like it tries to do, because when I go to the nether, I get this error repeatedly until I leave or close the game:

 

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor29.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at net.minecraft.world.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:164)
at net.minecraft.world.WorldServer.tick(WorldServer.java:171)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:702)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)
Caused by: java.lang.NullPointerException
at f1repl4ce.unlogic.entities.CustomPig.applyEntityAttributes(CustomPig.java:44)
at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:168)
at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:78)
at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:38)
at net.minecraft.entity.EntityAgeable.<init>(EntityAgeable.java:17)
at net.minecraft.entity.passive.EntityAnimal.<init>(EntityAnimal.java:34)
at net.minecraft.entity.passive.EntityPig.<init>(EntityPig.java:33)
at f1repl4ce.unlogic.entities.CustomPig.<init>(CustomPig.java:24)
... 10 more

 

And this when I try using the spawn egg to spawn it:

 

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:221)
at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:173)
at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:79)
at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:145)
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422)
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:591)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247)
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:736)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)
Caused by: java.lang.NullPointerException
at f1repl4ce.unlogic.entities.CustomPig.applyEntityAttributes(CustomPig.java:44)
at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:168)
at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:78)
at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:38)
at net.minecraft.entity.EntityAgeable.<init>(EntityAgeable.java:17)
at net.minecraft.entity.passive.EntityAnimal.<init>(EntityAnimal.java:34)
at net.minecraft.entity.passive.EntityPig.<init>(EntityPig.java:33)
at f1repl4ce.unlogic.entities.CustomPig.<init>(CustomPig.java:24)
... 19 more

 

The custom pig class:

 

package f1repl4ce.unlogic.entities;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIControlledByPlayer;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class CustomPig extends EntityPig{

public CustomPig(World p_i1689_1_) {
	super(p_i1689_1_);
        this.setSize(0.9F, 0.9F);
        this.getNavigator().setAvoidsWater(true);
        this.tasks.addTask(0, new EntityAISwimming(this));
        this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
        this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
        this.tasks.addTask(3, new EntityAITempt(this, 1.2D, Items.carrot, false));
        this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
        this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
        this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
        this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
        this.tasks.addTask(8, new EntityAILookIdle(this));
}
@Override
protected void applyEntityAttributes()
{
	 super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D);
}
@Override
public void onStruckByLightning(EntityLightningBolt p_70077_1_){}
}

 

And this code is in the modbase for it:

 

//set egg colors
        public static void getEggColor(Class entityClass){
        	if(entityClass == CustomPig.class){
        		primaryColor = 11513775;
            	secondaryColor = 8519830;
        	}
        }
        //Entity Registry
    	public static void registerEntity(Class entityClass, String name)
    	{
    	int entityID = EntityRegistry.findGlobalUniqueEntityId();
    	primaryColor = 13132800;//RGB to RGB int at http://www.shodor.org/stella2java/rgbint.html
    	secondaryColor = 1310735;//RGB to RGB int at http://www.shodor.org/stella2java/rgbint.html
    	getEggColor(entityClass);

    	EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
    	EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 1, true);
    	EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
    	}
@EventHandler
        public void preInit(FMLPreInitializationEvent event) {
registerEntity(CustomPig.class, "CustomPig");
        	EntityRegistry.addSpawn(CustomPig.class, 1, 0, 1, EnumCreatureType.ambient, BiomeGenBase.hell);
}

 

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Where is your clientproxy, commonproxy, nothing ?! You need Render and Entity.

 

~ maybe i am wrong below but not above, you need to have render aside entity class.

Also you cant do CustomPig extends EntityPig. Some of the AI wont work if you dont have your own. Becouse some of them are only connected to EntityPig.

Posted

@proalt That doesn't have anything to do with the error.

 

@F1repl4ce

Caused by: java.lang.NullPointerException
at f1repl4ce.unlogic.entities.CustomPig.applyEntityAttributes(CustomPig.java:44)

Can you post line 44 of CustomPig.java?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

@proalt That doesn't have anything to do with the error.

 

@F1repl4ce

Caused by: java.lang.NullPointerException
at f1repl4ce.unlogic.entities.CustomPig.applyEntityAttributes(CustomPig.java:44)

Can you post line 44 of CustomPig.java?

Wow, I'm an idiot... I don't see how adding attackDamage to an animal could affect anything, but apparently it did.

Where is your clientproxy, commonproxy, nothing ?! You need Render and Entity.

 

~ maybe i am wrong below but not above, you need to have render aside entity class.

Also you cant do CustomPig extends EntityPig. Some of the AI wont work if you dont have your own. Becouse some of them are only connected to EntityPig.

I do have render classes and proxy classes. I didn't post them because I knew that wasn't the issue. Also, I was more concerned about getting it to spawn before working on the AI.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.