Jump to content

Tile Entities Not Spawning in Generated Structure


314owen

Recommended Posts

I am trying to put my modded block into my structure. When I remove the tile entity code from the block, It places fine, but I need to have it have the tile entity code. How do I fix this? I have tried using .setBlock and .setTileEntity

Link to comment
Share on other sites

I'm Just Using Basic setBlock Code Under My Generate Method:

 

First I tried this:

world.setBlock(i + 2, j + 6, k + 3, MyMod.MyBlock);

 

Then I tried this:

TileEntityMyBlock block = new TileEntityMyBlock();

world.setTileEntity(i + 2, j + 6, k + 3, block);

 

Then I tried both.

 

Here is my block class:

 

public class BlockMyBlock extends Block{

protected BlockMyBlock(Material p_i45394_1_) {

super(p_i45394_1_);

}

public TileEntity createTileEntity(World p_149915_1_, int p_149915_2_)

    {

        return new TileEntityMyBlock();

    }

public boolean hasTileEntity(int metadata) {

 

return true;

}

 

}

 

Link to comment
Share on other sites

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.