Rendering and handling keyboard input should only be done on the client.
Logic (pretty much everything else) should be done on the sever.
However, to make stuff look smoother, vanilla runs some logic on both client and server (so that it appears to run smoothly on the client while the real result is synced a little bit later from the server)
You can use a lambda for this
Also, use @Override
https://stackoverflow.com/questions/94361/when-do-you-use-javas-override-annotation-and-why
Your subscription looks right, place a breakpoint to make sure it gets called though.
You don’t ever sync the values.
Read the Documentation.
Here’s an example of a TileEntity that syncs it’s energy every time it changes and here’s an example of a TileEntity that syncs its smeltTime whenever you’re in its GUI (see its container for the syncing)
You're currently checking for entities at (0, 0, 0). You need to offset the box's position by the position of the block being clicked.
As a side note, you should also never mix tabs and spaces for your indentation. Choose one and treat the other like plague.