Package net.minecraftforge.event
Class OnDatapackSyncEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.OnDatapackSyncEvent
-
public class OnDatapackSyncEvent extends net.minecraftforge.eventbus.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
Fields Modifier and Type Field Description private ServerPlayerEntity
player
private PlayerList
playerList
-
Constructor Summary
Constructors Constructor Description OnDatapackSyncEvent(PlayerList playerList, ServerPlayerEntity player)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerPlayerEntity
getPlayer()
PlayerList
getPlayerList()
-
-
-
Field Detail
-
playerList
private final PlayerList playerList
-
player
@Nullable private final ServerPlayerEntity player
-
-
Constructor Detail
-
OnDatapackSyncEvent
public OnDatapackSyncEvent(PlayerList playerList, @Nullable ServerPlayerEntity player)
-
-
Method Detail
-
getPlayerList
public PlayerList getPlayerList()
- Returns:
- The server's player list to get a view of all players.
-
getPlayer
@Nullable public ServerPlayerEntity getPlayer()
- Returns:
- The player to sync datapacks to. Null when syncing for all players, such as when the reload command runs.
-
-