Class PlayerLeavingModEvent
java.lang.Object
com.minecolonies.api.eventbus.events.AbstractModEvent
com.minecolonies.api.eventbus.events.colony.AbstractColonyModEvent
com.minecolonies.api.eventbus.events.colony.permissions.PlayerLeavingModEvent
- All Implemented Interfaces:
IModEvent
Player leaving colony mod event.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerLeavingModEvent(@NotNull IColony colony, net.minecraft.world.entity.player.Player player) Constructs a colony-based event. -
Method Summary
Modifier and TypeMethodDescriptionvoidDisable the anti spectator check, allowing you to add custom logic under which to disable the notifications.voidDisable sending out the notifications.net.minecraft.world.entity.player.PlayerGet the player that is leaving the colony.booleanWhether we should show the notification for the player leaving.Methods inherited from class com.minecolonies.api.eventbus.events.colony.AbstractColonyModEvent
getColonyMethods inherited from class com.minecolonies.api.eventbus.events.AbstractModEvent
getEventId
-
Constructor Details
-
PlayerLeavingModEvent
public PlayerLeavingModEvent(@NotNull @NotNull IColony colony, net.minecraft.world.entity.player.Player player) Constructs a colony-based event.- Parameters:
colony- the colony related to the event.player- the player that is leaving the colony.
-
-
Method Details
-
getPlayer
public net.minecraft.world.entity.player.Player getPlayer()Get the player that is leaving the colony. -
shouldShowNotification
public boolean shouldShowNotification()Whether we should show the notification for the player leaving.- Returns:
- true if so.
-
disableNotification
public void disableNotification()Disable sending out the notifications. -
allowForSpectators
public void allowForSpectators()Disable the anti spectator check, allowing you to add custom logic under which to disable the notifications.
-