Package io.papermc.paper.event.world
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.world.WorldEvent
world
-
Constructor Summary
ConstructorsConstructorDescriptionWorldDifficultyChangeEvent
(World world, @Nullable CommandSourceStack commandSource, Difficulty difficulty) -
Method Summary
Modifier and TypeMethodDescriptionGets the command source associated with this event.Gets the new difficulty of the world.static HandlerList
Methods inherited from class org.bukkit.event.world.WorldEvent
getWorld
Methods inherited from class org.bukkit.event.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:
null
if the difficulty was changed via api, otherwise theCommandSourceStack
.
-
getDifficulty
Gets the new difficulty of the world.- Returns:
- the new difficulty.
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-