Package net.neoforged.neoforge.event
Class OnDatapackSyncEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.OnDatapackSyncEvent
public class OnDatapackSyncEvent
extends net.neoforged.bus.api.Event
Fires when a player joins the server or when the reload command is ran,
before tags and crafting recipes are sent to the client. Send datapack data
to clients when this event fires.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable ServerPlayer
Gets the player that is joining the server, or null when syncing for all players, such as when the reload command runs.Gets the server's player list, containing all players, when the event fires.Creates a stream of players that need to receive data during this event, which is the specified player (if present) or all players.
-
Field Details
-
playerList
-
player
-
-
Constructor Details
-
OnDatapackSyncEvent
-
-
Method Details
-
getPlayerList
Gets the server's player list, containing all players, when the event fires.- Returns:
- The server's player list.
-
getRelevantPlayers
Creates a stream of players that need to receive data during this event, which is the specified player (if present) or all players.- Returns:
- A stream of players to sync data to.
-
getPlayer
Gets the player that is joining the server, or null when syncing for all players, such as when the reload command runs.- Returns:
- The player to sync datapacks to. Null when syncing for all players.
-