Posted May 7, 20178 yr comment_264853 Hello everyone, I'm trying to create a block that is able to switch between several tile entities, each time it's activated. However, world.removeTileEntity(blockpos) and world.setTileEntity(blockpos, tileentity) don't seem to work. Is that because my block only returns one tile entity in the createNewTileEntity(world, meta) method? What should I use to do what I want to do? Thanks in advance (:
May 7, 20178 yr comment_264856 Why would you ever want your block to switch it's tile entity? Tile entity is just a way to store and process data. What exactly are you trying to achieve?
May 7, 20178 yr Author comment_264858 I'm trying to make a block that has multiple functionalities. Like a furnace and a chest and a battery or something. I'd like to be able to dynamically add more tile entities to this list, so, the block should be able to iterate through this list. I got it to the point where setTileEntity seems to set the new tile entity, but when I try to access it later, it changed back to the original tile entity.
May 7, 20178 yr comment_264859 There is nothing stopping you from implementing all functionalities you want your block to have and have a field that controls them if you want your block to 'switch'. If you simply want it to have all the functionalities you can and should simply use capabilities. If you want to have a 'dynamic list' you can implement your functionalities in some kind of wrappers and have that list of wrappers in your tile entity. Or something different, depending on the way you want everything to be handled. It is really more of a design choice
May 7, 20178 yr Author comment_264860 Alright, it seems that it only resets the tile entity on server side, even though the method is called on both sides.
May 7, 20178 yr Author comment_264861 4 minutes ago, V0idWa1k3r said: There is nothing stopping you from implementing all functionalities you want your block to have and have a field that controls them if you want your block to 'switch'. If you simply want it to have all the functionalities you can and should simply use capabilities. If you want to have a 'dynamic list' you can implement your functionalities in some kind of wrappers and have that list of wrappers in your tile entity. Or something different, depending on the way you want everything to be handled. It is really more of a design choice So, I guess you could do that... I'll give it a try, thx!
May 7, 20178 yr Author comment_264866 Alright I fixed it! So it turned out my packet didn't quite work, so the client side didn't update what tile entity was there, so it couldn't open the right gui's... Thanks for your help! (:
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.