Jump to content

Recommended Posts

Posted

Hey fellow Modders!

 

I am trying to make an item that spawns a Multi-block structure in the world. I started with an item that creates 1 BlockContainer with TileEntity.

I can't get it to work.

Here's what I know so far:

- Replacing my custom block for a vanilla block does make it spawn in the world.

- Replacing my custom block for a vanilla TileEntity does make it spawn. (I tried the anvil block).

- I use all necessary functions used ItemSkull, TileEntitySkull, BlockSkull. (Or at least as far as I know).

- world.getTileEntity(x, y, z); returns null.

- world.getTileEntity also returns null after I used world.setTileEntity(x, y, z, tileentity);.

- Placing the block by hand does make it a working TileEntity

- Placing a block by hand calls createNewTileEntity() multiple times (mostly 2 times, but I've seen 3 as well (print statement)).

- I did look at numerous Tutorials, topics on this forum, and minecraft code examples (like the skull). Most of them are 1.6 though (some older)..

 

I'll update this list whenever I found a new usefull clue.

 

My guess is I'm forgetting to call a function, but I wouldn't know which one.

The main thing I don't understand is why my TileEntity works whenever I place the block by hand, but whenever I use the Item it fails.

 

Here is the code:

 

ItemTurret

 

  Reveal hidden contents

 

 

TileEntityTurret

 

  Reveal hidden contents

 

 

BlockTurret

 

  Reveal hidden contents

 

Posted

Wow...

Thanks so much!

I could not believe that actually worked, but it makes a lot of sense now haha.

I wasted almost a week of my time on this problem.

CASE CLOSED

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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