American2050 Posted January 22, 2018 Posted January 22, 2018 I was looking at the TileEntityShulkerBox and I saw the method receiveClientEvent that decides when to start the OPENING / CLOSING animation of the Shulker Box. My question is... What triggers this? I was trying to implement this on my own TE but that method I don't think it's getting called at all. What does Minecraft do with that block for it to get called? PS: In the meanwhile I just moved the OPENING / CLOSING to the openInventory / closeInventory and while it is working, not sure it's the best way. Quote
American2050 Posted January 22, 2018 Author Posted January 22, 2018 (edited) So, it's only called on World addBlockEvent? How that gets triggered when opening a Shulker Box? (Or for the case, how do I make so it triggers on my code when I right click my block) What you mean with no use BlockContainer? On my block I have this method @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] { FACING }); } That is okey to use? Edited January 22, 2018 by American2050 Quote
American2050 Posted January 22, 2018 Author Posted January 22, 2018 2 minutes ago, diesieben07 said: Yes. TileEntityShulkerBox, methods openInventory and closeInventory. Why do you want to use it for that? That does not make much sense. This mechanism is used to communicate simple events from server to client. I mean do not use the class BlockContainer. How is that related to anything I said? Ohh ok, I see now how they call it. Not that I want to use it, I was just seen how Vanilla does it and apply it to my Block. (There must be a reason on why the call each method in the locations they call it) Like why wouldn't they just call the Open GUI, the notification for Animations to let know it's OPENING and the PlaySound of the Shulker Box all in the same place, I don't know, why they do it like this? I don't think it's "just because" doesn't make much sense to me, I would just call everything from "onBlockActivated" Quote
Recommended Posts
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.