Another important thing a tile entity can do is synchronize with the server and, therefore, interact with the player. The player interaction and server synchronization for this tile entity is simple. When the block is right-clicked, the counter that switches the metadata stops until it’s right-clicked again. Because this changes how the block works, this has to be synchronized between the server and the client.
The first thing required for this is a Boolean that is checked to see if the counter should change. The variable should look like this:
private boolean counterEnabled = true;
This variable should also be used in the
updateEntity method to make sure the counter is only enabled when this ...