Skip to content

ServerEvent Annotation

ContronThePanda edited this page Dec 15, 2019 · 1 revision

The @ServerEvent annotation is used to mark events which the server needs to react to. When these events are sent on the client, they will then be replicated to the server as well. This should be used on events which need the server to do something.

Lag Compensation

This annotation has one field: lagCompensate. This is a boolean field which determines whether or not the server should compensate for the time that passes between the client sending the event and the server receiving it, and it defaults to false. If it is set to true, then the server will temporarily rewind the positioning of all entities in order to simulate the conditions when the event was sent. This helps to prevent the appearance of desync between the client and server, although it is not always necessary.