Class WorldDifficultyChangeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
io.papermc.paper.event.world.WorldDifficultyChangeEvent
Called when a world's difficulty is changed, either by command or by api.
If the world is in hardcore
the resulting difficulty will always be Difficulty.HARD
- Since:
- 1.21.8
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class WorldEvent
world -
Constructor Summary
ConstructorsConstructorDescriptionWorldDifficultyChangeEvent(World world, @Nullable CommandSourceStack commandSource, Difficulty difficulty) -
Method Summary
Modifier and TypeMethodDescription@Nullable CommandSourceStackGets the command source associated with this event.Gets the new difficulty of the world.static HandlerListMethods inherited from class WorldEvent
getWorldMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
WorldDifficultyChangeEvent
@Internal public WorldDifficultyChangeEvent(World world, @Nullable CommandSourceStack commandSource, Difficulty difficulty)
-
-
Method Details
-
getCommandSource
Gets the command source associated with this event.- Returns:
nullif the difficulty was changed via api, otherwise theCommandSourceStack.- Since:
- 1.21.8
-
getDifficulty
Gets the new difficulty of the world.- Returns:
- the new difficulty.
- Since:
- 1.21.8
-
getHandlers
- Specified by:
getHandlersin classEvent- Since:
- 1.21.8
-
getHandlerList
- Since:
- 1.21.8
-