Skip to content

Network Component

ContronThePanda edited this page Dec 15, 2019 · 1 revision

The NetworkComponent is a component whose presence registers an entity on a network. An entity must have this component in order for the Replicate Annotation to work on any of its components. (More information about components can be found here). Marking an entity with this component will register it with a network ID so that it works properly over the network.

Although the network component can be added with no parameters, there is a replicateMode field which can be used to determine how the entity's fields will be replicated. This field uses an enum with the following values:

ReplicateMode Description
ALWAYS The entity will always replicated to all clients connected to the server.
RELEVANT The entity will only be replicated to clients where it was relevant (within a certain distance). This is the default value.
OWNER The entity will always be replicated to its owner.
Clone this wiki locally