Jump to content

[Solved?][1.12.2] Custom Falling Block Entity crashes for unknown reason.


Recommended Posts

Posted (edited)

Whenever the Entity is spawned my game crashes. The code is directly copy/pasted from Vanilla code. (Vanilla does not crash)
From my tests and observation it seems to be something Client/Server side with the blockstate (the fallTile variable is not set on the Client (or Server?))


Crash Report:

  Reveal hidden contents

---

Entity Class:

  Reveal hidden contents

Block Class:

  Reveal hidden contents

Code in Client Proxy:

  Reveal hidden contents

preInit() is called from the FMLPreInitializationEvent. Also, I don't have a CommonProxy, is that a problem?

Registry of Entity:

  Reveal hidden contents

I am aware of the fact that I don't need the "for" loop, but I will probably add more entities in the future so that's why.
 

I am really lost on what I'm doing wrong, help will be appreciated!

 

 

If the given code is not enough to pinpoint the error please have a look at the Github page: https://github.com/TheRedMajora/DungeonTools

Edited by Highlord_Will
Solved?
Posted

Thanks for the reply!

 

1. Ahh, rookie mistake. I've changed it to ResourceLocation(modID, "entity_name") now.

2. Great.

3. I have not implemented my own features yet, but there are some features I plan on implementing into the falling block.

4. I tried using the hasTileEntity and createTileEntity methods (even checked with @Override and there were no errors), but that crashed my Minecraft.

5. Another rookie mistake. BlockDungeon is gone!

6. I was expecting it to be something like that. I've fixed it using a boolean to determine what type of "Push Block" the entity is. That seems to work well. (My custom entity can only be a push block anyway, I know it's not the best solution, but I had lots of trouble with networking in the past so yeah.)

Posted

Crash:

  Reveal hidden contents

 

Code in Block Class:

@Override
public TileEntity createTileEntity(World world, IBlockState state)
{ return new TileEntityPushBlock(); }

@Override
public boolean hasTileEntity()
{ return true; }

And the line that returns the error:

((TileEntityPushBlock) world.getTileEntity(pos)).setActive(true);

 

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



×
×
  • Create New...

Important Information

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