Jump to content

Tile entity location


redria7
 Share

Recommended Posts

What is the best way to tell a tile entity where it is upon placement? Every time minecraft starts, it creates tile entities using the block class that the tile entity comes from. So I can't set up variables that are set on the block's placement, because they would not be initialized when minecraft started, or they would all start the same and all my tile entities of that type would think they have the same location. So how would I tell a tile entity where it is when I place it?

 

My only idea so far is to use my renderer to tell it where it is, which just seems like awful etiquette to me.

Read my thoughts on my summer mod work and tell me what you think!

http://www.minecraftforge.net/forum/index.php/topic,8396.0.html

 

I absolutely love her when she smiles

Link to comment
Share on other sites

I gave my tile entity a constructor and use the xCoord, yCoord, and zCoord variables int it and all of them just returned as 0. Is there a certain point where they get set, and where I can start using them?

Read my thoughts on my summer mod work and tell me what you think!

http://www.minecraftforge.net/forum/index.php/topic,8396.0.html

 

I absolutely love her when she smiles

Link to comment
Share on other sites

I gave my tile entity a constructor and use the xCoord, yCoord, and zCoord variables int it and all of them just returned as 0. Is there a certain point where they get set, and where I can start using them?

After the constructor, but before onUpdate(). And probably before all the other functions too. Which is why I still say it would be useful to put those args in the block constructor.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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
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.

 Share



×
×
  • Create New...

Important Information

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