Posted December 7, 20186 yr Does any one have advise on the best way to change a tile entites item calability based off it's state. For example, if I have a tile entity where it has an item handler capability and if you shift right click on a side of the block it disables the capability from that side. I have been messing around with different ways of achieving this but when I set the blocks state to not give the item capability on a certain side I have to reload the world before the connecting block updates to no longer accept items from that side. I call a block update when I change the state so I was wondering if there is anything I might be missing with the capabilities system around changing a tile entities capability? Thanks.
December 7, 20186 yr Reloading the world sounds like a desync issue... or you're using a global value to set the on/off flags on cap init And you're not changing the capabilities, you're just denying access when a particular side is 'off'. All you should have to do is return false for hasCapability() and null for getCapability() on the corresponding sides. I think its my java of the variables.
December 7, 20186 yr Author I had changed some code before I posted the question while I was testing so I tried re-implementing my initial code and now its working flawlessly. I couldn't tell you what I'm doing differently. Sorry to bother you and thanks for the advice anyway. If I have any other issues relating to this I'll post my code.
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.