Enum Class MoonPhase
- All Implemented Interfaces:
Serializable,Comparable<MoonPhase>,Constable
Enumeration of the eight moon phases in Minecraft.
The moon phase cycles every 8 Minecraft days (8 * 24000 ticks). Each phase represents a different point in the lunar cycle, from full moon through new moon and back. Moon phases can be used for spell calculations and lunar-based mechanics.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFirst Quarter - half moon, increasingFull Moon - brightest lunar phaseLast Quarter - half moon, decreasingNew Moon - darkest lunar phaseWaning Crescent - thin crescent before new moonWaning Gibbous - after full moon, gradually decreasingWaxing Crescent - thin crescent after new moonWaxing Gibbous - before full moon, gradually increasing -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MoonPhasegetMoonPhase(@NotNull org.bukkit.World world) Get the current moon phase for a world.static MoonPhaseReturns the enum constant of this class with the specified name.static MoonPhase[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FULL_MOON
Full Moon - brightest lunar phase -
WANING_GIBBOUS
Waning Gibbous - after full moon, gradually decreasing -
LAST_QUARTER
Last Quarter - half moon, decreasing -
WANING_CRESCENT
Waning Crescent - thin crescent before new moon -
NEW_MOON
New Moon - darkest lunar phase -
WAXING_CRESCENT
Waxing Crescent - thin crescent after new moon -
FIRST_QUARTER
First Quarter - half moon, increasing -
WAXING_GIBBOUS
Waxing Gibbous - before full moon, gradually increasing
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getMoonPhase
Get the current moon phase for a world.Calculates the moon phase based on the world's full time, which cycles every 8 Minecraft days. The full time is divided by 24000 (ticks per day) and modulo 8 to get the phase.
- Parameters:
world- the world to check- Returns:
- the current moon phase
-