Posted June 17, 201312 yr 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
June 17, 201312 yr I've noticed that. By default you don't even get the metadata... you have to find and override a specific function. It seems a shortcoming of Forge. To the Suggestions board! BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 17, 201312 yr Tile entities store their coordinates. While you can't use those coordinates to check upon creation via the block, you can check in the constructor of the TileEntity.
June 17, 201312 yr Author 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
June 17, 201312 yr 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.
June 17, 201312 yr Author I'm overriding updateEntity for my purposes. It seems to work well enough. 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
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.