Jump to content

[1.7.10] [Not Resolved] Entity Rendering Not Working.


Recommended Posts

Posted

So I've made an entity, but the problem is when I spawn it with a spawn egg it doesn't render. Here is my code:

 

 

  Reveal hidden contents

 

Posted

Are you calling the method which holds

RenderingRegistry.registerEntityRenderingHandler(ArcanePowerMatrix.class, new RenderPowerMatrix(new ModelPowerMatrix(), 0F));

in your main class?

Posted
  On 12/4/2014 at 12:50 PM, Lewie said:

Are you calling the method which holds

RenderingRegistry.registerEntityRenderingHandler(ArcanePowerMatrix.class, new RenderPowerMatrix(new ModelPowerMatrix(), 0F));

in your main class?

 

  Quote

No, I'm calling it in my ClientProxy.

 

Oh sorry, I was tired when I read that, yes I'm calling that method in my main class (not ClientProxy, that wouldn't have worked, sorry for the miss-understanding).

Posted
  On 12/5/2014 at 4:47 AM, Awesome_Spider said:

Well... I guess some people are as stumped as me. :/

 

Does the game crash when you try (Post Error)? Or does it just not render at all?

Posted
  On 12/5/2014 at 6:08 AM, david476 said:

Add an println to the onUpdate method to make sure it is spawning right (make sure to call super!). Can we see spawning code?

 

What onUpdate method? I try to add that. Also I don't have spawning code, I just register the entity and it does that on it's own.

 

  Quote

  Quote

Well... I guess some people are as stumped as me. :/

 

Does the game crash when you try (Post Error)? Or does it just not render at all?

 

It just doesn't render at all, either that or it doesn't spawn.

Posted

Now that I look at it, it gives me this in the console when I use the spawn egg:

[17:26:14] [server thread/WARN]: Skipping Entity with id 7
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.reflect.InvocationTargetException
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:221)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:173)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:79)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:456)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:142)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:422)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: Caused by: java.lang.NullPointerException
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.entity.DataWatcher.updateObject(DataWatcher.java:153)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.entity.EntityLivingBase.setHealth(EntityLivingBase.java:812)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:157)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:78)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	at com.awsp8.wizardry.Entities.ArcanePowerMatrix.<init>(ArcanePowerMatrix.java:13)
[17:26:19] [server thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: 	... 20 more

 

Weird a NullPointerException at the end, easy to fix. But it says it can't find the health info, even EASIER to fix :) well i'll try to fix it then. If I don't i'll reply again.

Posted
  On 12/6/2014 at 12:40 AM, diesieben07 said:

You need to call super.entityInit in your overridden method.

 

Still not working. :/

Posted

The onUpdate method is called each tick (look at Entity class). The println was to check it was spawning correctly, you might want to make it print (this.worldObj.isRemote + ", " + this) to see the entity and which world it is in. Give us what that outputs and updated code when you implement it.

Posted
  On 12/6/2014 at 4:24 AM, david476 said:

The onUpdate method is called each tick (look at Entity class). The println was to check it was spawning correctly, you might want to make it print (this.worldObj.isRemote + ", " + this) to see the entity and which world it is in. Give us what that outputs and updated code when you implement it.

 

I place this code (this is how I debug):

Wizardry.log.debug(this.worldObj.isRemote + ", " + this);

 

where you advised me to put it and it printed absolutely nothing when I spawned the entity. Thoughts? :)

Posted

Well here is the updated code:

 

package com.awsp8.wizardry.Entities;

import com.awsp8.wizardry.Wizardry;

import sun.misc.SharedSecrets;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

public class ArcanePowerMatrix 
			extends EntityLiving{



public ArcanePowerMatrix(World world) {
	super(world);
}

@Override
public void entityInit(){
	super.entityInit();
}

@Override
public void onUpdate(){
	super.onUpdate();

	Wizardry.log.debug(this.worldObj.isRemote + ", " + this);
}

@Override
public void applyEntityAttributes(){
        super.applyEntityAttributes();
    }

@Override
public boolean canDespawn(){
	return false;
}

@Override
public boolean canBePushed(){
	return false;
}
}

 

And I have noticed that the exception is gone, but it still doesn't spawn. Now I'm actually not sure now whether it's a rendering problem or a spawning problem (considering it doesn't print anything).

Posted

I use this method to create a spawn egg for it:

public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) {
    	int id = EntityRegistry.findGlobalUniqueEntityId();
    	EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
    	EntityList.entityEggs.put(Integer.valueOf(id), new EntityList.EntityEggInfo(id, bkEggColor, fgEggColor));
    }

 

But I don't understand why it's not working because all my other entities spawn ok, but this one doesn't spawn. I have no idea why, they are all registered the same way.

Posted
  On 12/6/2014 at 6:55 PM, diesieben07 said:

How many entities do you have?

 

Five, counting the one that isn't working.

Posted
  On 12/6/2014 at 7:26 PM, diesieben07 said:

Then I have no clue. Setup a proper git repo so that I can easily check out your code. No, a zip download does not work.

 

I have a git repos:

 

My entity code:

https://github.com/AwesomeSpider/Wizardry/blob/master/src/main/java/com/awsp8/wizardry/Entities/ArcanePowerMatrix.java

 

My entity model code:

 

https://github.com/AwesomeSpider/Wizardry/blob/master/src/main/java/com/awsp8/wizardry/entity/model/ModelPowerMatrix.java

 

My entity rendering code:

 

https://github.com/AwesomeSpider/Wizardry/blob/master/src/main/java/com/awsp8/wizardry/entity/render/RenderPowerMatrix.java

 

Hope you can help, if not it's fine I can always remove the entity. :)

Posted
  On 12/6/2014 at 7:55 PM, diesieben07 said:

First of all, fix that repo. All that crap should not be in there, only src, gradle, the gradlew files and build.gradle.

 

Allright, I will.

Posted
  On 12/6/2014 at 7:55 PM, diesieben07 said:

First of all, fix that repo. All that crap should not be in there, only src, gradle, the gradlew files and build.gradle.

 

Ok, I cleaned it up as best I could, it took a while to figure out how to use .gitignore files. :)

Posted
  On 12/6/2014 at 8:59 PM, diesieben07 said:

a) your .gitignore did not fix it.

b) Somehow your entity *is* spawned but immediately dies or something. Not sure why.

 

Oh I see, maybe it has no health, would that make it die immediately?

Posted
  On 12/6/2014 at 9:47 PM, diesieben07 said:

well, that would at least make

setDead

be called on the entity, but that is not the case either. it just seems as if the entity instance just vanishes.

 

Weird... I just remembered this has happened to me before with another entity. If I'm remembering correctly I couldn't fix it and ended up having to delete the entity. I had no idea what caused it, this is REALLY weird. I'll do more research, wish me luck. :)

Posted
  On 12/6/2014 at 9:32 PM, diesieben07 said:

Repo looks good, but I am still kinda stumped as to why that happens.

Oh and by the way, your code is a mess. Literally every class has loads and loads of warnings everywhere.

 

Wait I didn't see this reply sorry. Lol, what kind of warnings? My eclipse doesn't show any warnings.

Posted
  On 12/6/2014 at 10:30 PM, diesieben07 said:

Well, that is because in the default eclipse workspace that comes with forge most warnings are turned off.

 

Oh lol I didn't know that.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Looking to save big on your first international money transfer? Use the Lemfi coupon code 10% Cashback Up To $50 On First Transfer and enjoy instant cashback rewards on your first transaction. Our exclusive RITEQH6J Lemfi coupon code is designed to maximize your savings across the globe. Whether you're in the USA, Canada, UK, or elsewhere, this code unlocks premium benefits for you. With the Lemfi discount code $10 off and Lemfi code 10% Cashback Up To $50 On First Transfer, you’re not just sending money—you’re earning while doing it. Let’s dive into all the ways you can make the most of this offer. What Is The Lemfi Promo Code for 10% Cashback Up To $50 On First Transfer? Both new and existing users can benefit significantly by applying our Lemfi coupon 10% Cashback Up To $50 On First Transfer on the Lemfi app or website. This offer is part of Lemfi’s initiative to provide more value to its global users with every money transfer. 10% Cashback Up To $50 On First Transfer Lemfi coupon is your gateway to saving more, whether you're new or already using the app. Here's what you get with the promo code RITEQH6J: RITEQH6J – Flat 10% Cashback Up To $50 On First Transfer RITEQH6J – 10% Cashback Up To $50 On First Transfer coupon pack for multiple uses RITEQH6J – 10% Cashback Up To $50 On First Transfer flat discount for new customers RITEQH6J – Extra 10% Cashback Up To $50 On First Transfer promo code for existing customers Lemfi First Time Promo Code 10% Cashback Up To $50 On First Transfer For New Users In 2025 If you’re signing up for the first time in 2025, you’re in for an amazing treat. Using our Lemfi First Time Promo Code for 10% Cashback Up To $50 On First Transfer ensures maximum benefits on your first transaction. Here are some exciting perks of using RITEQH6J: RITEQH6J – $30 sign-up bonus to new users RITEQH6J – 10% cash back up to $50 on first transfer RITEQH6J – $20 cashback on recurring money transfers RITEQH6J – $30 bonus on $100 transfer RITEQH6J – Valid globally for all new Lemfi customers How To Redeem The Lemfi Coupon 10% Cashback Up To $50 On First Transfer For New Users? Using the Lemfi First Time Promo Code for 10% Cashback Up To $50 On First Transfer is super easy. Follow this simple guide: Download and install the Lemfi app from the App Store or Google Play. Sign up and create a new account. Go to the promo code section during your first transaction. Enter RITEQH6J to activate the Lemfi Promo Code First Order 10% Cashback Up To $50 On First Transfer. Complete the transaction to enjoy the Lemfi First Time Promo Code 10% Cashback Up To $50 On First Transfer for new users. Lemfi Promo Code 10% Cashback Up To $50 On First Transfer For Existing Customers Already a Lemfi user? You can still enjoy great benefits using our lemfi promo code 10% Cashback Up To $50 On First Transfer for existing users. Take advantage of the lemfi discount code 10% Cashback Up To $50 On First Transfer for existing customers by using the code RITEQH6J: RITEQH6J – $10 bonus for all users RITEQH6J – $20 per referral after 20 transactions RITEQH6J – $20 cashback on recurring money transfers RITEQH6J – $30 bonus on $100 transfer How To Use The Lemfi Code for 10% Cashback Up To $50 On First Transfer For Existing Customers? To redeem the Lemfi discount code for 10% Cashback Up To $50 On First Transfer, follow these steps: Open the Lemfi app and Lemfi login to your existing account. Go to the 'Promo Code' or 'Offers' section. Apply the Code promo Lemfi for 10% Cashback Up To $50 On First Transfer – RITEQH6J. Make your transaction and enjoy instant cashback rewards. Latest Lemfi Promo Code for 10% Cashback Up To $50 On First Transfer Stay ahead of the savings game by using our Lemfi first time promo code for 10% Cashback Up To $50 On First Transfer first order. It's the best way to unlock exclusive Lemfi offers. With the Lemfi discount code 10% Cashback Up To $50 On First Transfer and Lemfi cashback code, here’s what RITEQH6J brings: $30 sign-up bonus to new users 10% cashback up to $50 on first transfer $20 per referral after 20 transactions $20 cashback on recurring money transfers $30 bonus on $100 transfer How To Find The Lemfi Code for 10% Cashback Up To $50 On First Transfer? Finding the Lemfi code for 10% Cashback Up To $50 On First Transfer is easier than you think. You can get the Lemfi cashback code by subscribing to Lemfi’s newsletter for exclusive offers. Don’t forget to check out Lemfi referral code Reddit for 10% Cashback Up To $50 On First Transfer discussions and user-shared deals. Also, visit trusted coupon websites like ours for verified and regularly updated Lemfi promo codes. Is Lemfi 10% Cashback Up To $50 On First Transfer Code Legit? Absolutely! Wondering Is Lemfi legit?—Yes, it is. Our code promo Lemfi legit is fully tested and verified. The Lemfi discount code RITEQH6J is 100% authentic and can be used worldwide without restrictions. It's a secure, safe, and effective way to enjoy cashback on your transfers. How Does Lemfi Code for 10% Cashback Up To $50 On First Transfer Work? The 10% Cashback Up To $50 On First Transfer on first-time Lemfi money transfer works instantly once you apply the code RITEQH6J. After you enter the code during your transaction, Lemfi automatically applies the cashback. The Lemfi promo code for recurring transactions also allows users to benefit on future money transfers. Whether you're a new or existing user, the savings keep adding up with every use. How To Earn Lemfi 10% Cashback Up To $50 On First Transfer Coupons As A New Customer? To earn the Lemfi coupon code 10% Cashback Up To $50 On First Transfer, all you have to do is register on Lemfi with a valid email and phone number. After signing up, enter our code RITEQH6J during your first transfer. You can also look for 100 off Lemfi coupon code during Lemfi promotions. Keep an eye on your inbox and our site for fresh Lemfi offers every month. What Are The Advantages Of Using The Lemfi Discount Code for 10% Cashback Up To $50 On First Transfer? Using the Lemfi promo code for $10 bonus and Lemfi promo code for 10% Cashback Up To $50 On First Transfer offers many perks: $30 sign-up bonus to new users 10% cashback up to $50 on first transfer $20 per referral after 20 transactions $20 cashback on recurring money transfers $30 bonus on $100 transfer Lemfi Discount Code For 10% Cashback Up To $50 On First Transfer And Free Gift For New And Existing Customers With our Lemfi Discount Code for 10% Cashback Up To $50 On First Transfer, the bonuses don’t stop. Use the 10% Cashback Up To $50 On First Transfer Lemfi discount code and enjoy even more rewards. Here’s what RITEQH6J brings you: RITEQH6J – $30 sign-up bonus to new users RITEQH6J – 10% cashback up to $50 on first transfer RITEQH6J – $20 per referral after 20 transactions RITEQH6J – $20 cashback on recurring money transfers RITEQH6J – $30 bonus on $100 transfer Pros And Cons Of Using The Lemfi Discount Code 10% Cashback Up To $50 On First Transfer For Here are some pros and cons of the Lemfi 10% Cashback Up To $50 On First Transfer discount code and latest Lemfi code 10% cashback up to $50 on first transfer: Pros: Easy to apply and use Instant cashback on first transfer Valid for both new and existing users No expiration date Works globally Cons: Cashback capped at $50 May require minimum transfer amount Terms And Conditions Of Using The Lemfi Coupon 10% Cashback Up To $50 On First Transfer In 2025 To make the most of the Lemfi 10% Cashback Up To $50 On First Transfer code and latest Lemfi code 10% Cashback Up To $50 On First Transfer, keep these T&Cs in mind: Valid for both new and existing users Can be used worldwide No expiration date Requires use of code RITEQH6J during transaction Minimum transfer limit may apply Final Note: Use The Latest Lemfi Discount Code 10% Cashback Up To $50 On First Transfer To unlock your savings, don’t forget to use the Lemfi discount code for 10% Cashback Up To $50 On First Transfer. This code guarantees amazing benefits across various regions and transactions. With the Lemfi 10% Cashback Up To $50 On First Transfer code, you can enjoy worry-free money transfers and generous bonuses. Save more every time you send money! FAQs Of Lemfi 10% Cashback Up To $50 On First Transfer Code What is the best Lemfi promo code in 2025? The best Lemfi promo code for 2025 is RITEQH6J, offering 10% cashback up to $50 on your first transfer and other recurring rewards. Can I use the Lemfi code multiple times? Yes, you can use RITEQH6J for recurring benefits such as $20 cashback on future transfers and $30 bonuses on $100 sent. Is the Lemfi code valid in the USA and UK? Yes, the code is globally valid including in the USA, UK, Canada, and more. How do I enter the Lemfi promo code? Enter RITEQH6J in the promo section during your first transfer on the Lemfi app or website to activate your cashback offer. Does Lemfi have a referral bonus? Yes, Lemfi offers a $20 referral bonus after 20 successful transactions when your code is used by others
    • And the mods.toml?   Instead of using  modId="${mod_id}" try  modId="wackyweapons"
    • I've been working on Minecraft Forge 1.21 Modding, (I'm a bit inexperienced), and when trying to create my own custom throwable projectile entity, I come across this error I can't seem to fix. The console reads that my "mod not working due to Invalid bare key: '${mod_id}'  ". Does anyone know why this is happening? The Pastebin link for all the relevant files is https://pastebin.com/h3UaNYwn. Any help would be greatly appreciated. Thanks.
    • Found a similar post from 3 weeks ago as the only similar issue, seems specific to some linux distributions, like cachyos which i am using, due to libzng processing hashes differently? https://github.com/PrismLauncher/PrismLauncher/issues/3889
    • Make a test without exnihiloomnia
  • Topics

×
×
  • Create New...

Important Information

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