Interface ILunarEvent

All Known Implementing Classes:
BadOmenMoonEvent, BigMoonEvent, BloodMoonEvent, CrimsonMoonEvent, EclipseMoonEvent, HeroMoonEvent, LunarEvent, MinerMoonEvent, RegularMoonEvent, TinyMoonEvent, WhiteMoonEvent

public interface ILunarEvent
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Called when the lunar event checks if it can apply an effect to entities.
    default void
    applyEntityEffect(net.minecraft.world.entity.Entity entity)
    Called when the lunar event tries to apply an effect to an entity.
    default boolean
    Called when the lunar event checks if it can apply an effect to players.
    default void
    applyPlayerEffect(net.minecraft.world.entity.player.Player player)
    Called when the lunar event tries to apply an effect to a living entity.
    default boolean
    Called when the lunar event checks if it can apply an effect to living entities upon spawn.
    default void
    applySpawnEffect(net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.MobSpawnType spawnType)
    Called when the lunar event tries to apply an effect to a living entity upon spawn.
    default boolean
    canAppear(net.minecraft.world.level.Level level)
    Called to check if the lunar event can happen.
    default EventResult
    canSleep(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos sleepingLocation)
    Called when a player is about to try and sleep through the lunar event.
    default boolean
    Called when the lunar event tries check if a mob is allowed to spawn.
    net.minecraft.resources.ResourceLocation
    Get the resource location of the lunar event.
    default EventResult
    getSpawnResult(net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.MobSpawnType spawnType)
    Called when the lunar event tries check if a mob is allowed to spawn.
    Get the translation key for the lunar event.
    int
    The color of the moon during the lunar event.
    default float
    Called to check if the moon should get scaled.
    default net.minecraft.resources.ResourceLocation
    Called to change the texture of the moon.
    int
    The weight in which the lunar event will be picked.
    default void
    stopEffects(net.minecraft.world.level.Level level)
    Called when the lunar event is over and the effects are removed.
  • Method Details

    • getID

      net.minecraft.resources.ResourceLocation getID()
      Get the resource location of the lunar event.
      Returns:
      the resource location of the lunar event
    • getTranslationKey

      String getTranslationKey()
      Get the translation key for the lunar event.
      Returns:
      the translation key
    • canAppear

      default boolean canAppear(net.minecraft.world.level.Level level)
      Called to check if the lunar event can happen.
      Parameters:
      level - The level
      Returns:
      if the lunar event can happen
    • moonScale

      default float moonScale()
      Called to check if the moon should get scaled.
      Returns:
      the scale of the moon (1.0 = normal, 0.5 = half size, 2.0 = double size)
    • moonTexture

      default net.minecraft.resources.ResourceLocation moonTexture()
      Called to change the texture of the moon.
      Returns:
      the resource location of the custom moon texture
    • spawnWeight

      int spawnWeight()
      The weight in which the lunar event will be picked.
      Returns:
      The spawn weight, 0 being disabled and 100 being really common (min 0, max 100)
    • moonColor

      int moonColor()
      The color of the moon during the lunar event.
      Returns:
      the color of the moon
    • getSpawnResult

      default EventResult getSpawnResult(net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.MobSpawnType spawnType)
      Called when the lunar event tries check if a mob is allowed to spawn.
      Parameters:
      livingEntity - the entity being checked
      spawnType - the spawn reason
    • dictatesMobSpawn

      default boolean dictatesMobSpawn()
      Called when the lunar event tries check if a mob is allowed to spawn.
      Returns:
      if the lunar event changes mob spawning rules
    • applySpawnEffect

      default void applySpawnEffect(net.minecraft.world.entity.LivingEntity livingEntity, net.minecraft.world.entity.MobSpawnType spawnType)
      Called when the lunar event tries to apply an effect to a living entity upon spawn.
      Parameters:
      livingEntity - the entity the effect is applied to
      spawnType - the spawn reason
    • applySpawnEffect

      default boolean applySpawnEffect()
      Called when the lunar event checks if it can apply an effect to living entities upon spawn.
      Returns:
      if the entity should have an effect applied to it
    • applyEntityEffect

      default void applyEntityEffect(net.minecraft.world.entity.Entity entity)
      Called when the lunar event tries to apply an effect to an entity.
      Parameters:
      entity - the entity the effect is applied to
    • applyEntityEffect

      default boolean applyEntityEffect()
      Called when the lunar event checks if it can apply an effect to entities.
      Returns:
      if the entity should have an effect applied to it
    • applyPlayerEffect

      default void applyPlayerEffect(net.minecraft.world.entity.player.Player player)
      Called when the lunar event tries to apply an effect to a living entity.
      Parameters:
      player - the player the effect is applied to
    • applyPlayerEffect

      default boolean applyPlayerEffect()
      Called when the lunar event checks if it can apply an effect to players.
      Returns:
      if the player should have an effect applied to it
    • stopEffects

      default void stopEffects(net.minecraft.world.level.Level level)
      Called when the lunar event is over and the effects are removed.
      Parameters:
      level - the level where the event took place
    • canSleep

      default EventResult canSleep(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos sleepingLocation)
      Called when a player is about to try and sleep through the lunar event.
      Parameters:
      player - The sleeping player
      sleepingLocation - The position of the sleeping player
      Returns:
      if the player is allowed to sleep