Package com.mrbysco.lunar.api
Interface ILunarEvent
- All Known Implementing Classes:
BadOmenMoonEvent,BigMoonEvent,BloodMoonEvent,CrimsonMoonEvent,EclipseMoonEvent,HeroMoonEvent,LunarEvent,MinerMoonEvent,RegularMoonEvent,TinyMoonEvent,WhiteMoonEvent
public interface ILunarEvent
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanCalled when the lunar event checks if it can apply an effect to entities.default voidapplyEntityEffect(net.minecraft.world.entity.Entity entity) Called when the lunar event tries to apply an effect to an entity.default booleanCalled when the lunar event checks if it can apply an effect to players.default voidapplyPlayerEffect(net.minecraft.world.entity.player.Player player) Called when the lunar event tries to apply an effect to a player.default booleanCalled when the lunar event checks if it can apply an effect to living entities upon spawn.default voidapplySpawnEffect(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 booleancanAppear(net.minecraft.world.level.Level level) Called to check if the lunar event can happen.default EventResultcanSleep(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 booleanCalled when the lunar event tries check if a mob is allowed to spawn.default List<org.apache.commons.lang3.tuple.Pair<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, net.minecraft.resources.ResourceLocation>> Returns a list of attribute pairs that are associated with the lunar event.net.minecraft.resources.ResourceLocationgetID()Get the resource location of the lunar event.default EventResultgetSpawnResult(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.intThe color of the moon during the lunar event.default floatCalled to check if the moon should get scaled.default net.minecraft.resources.ResourceLocationCalled to change the texture of the moon.default voidremoveEntityEffect(net.minecraft.world.entity.Entity entity) Called when the lunar event tries to remove an effect from an entity.default voidremovePlayerEffect(net.minecraft.world.entity.player.Player player) Called when the lunar event tries to remove an effect from a player.intThe weight in which the lunar event will be picked.
-
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 checkedspawnType- the spawn reason- Returns:
- if the lunar event changes mob spawning rules
-
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 tospawnType- 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
-
removeEntityEffect
default void removeEntityEffect(net.minecraft.world.entity.Entity entity) Called when the lunar event tries to remove an effect from an entity.- Parameters:
entity- the entity the effect is removed from
-
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 player.- Parameters:
player- the player the effect is applied to
-
removePlayerEffect
default void removePlayerEffect(net.minecraft.world.entity.player.Player player) Called when the lunar event tries to remove an effect from a player.- Parameters:
player- the player the effect is removed from
-
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
-
getAttributePairs
default List<org.apache.commons.lang3.tuple.Pair<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>,net.minecraft.resources.ResourceLocation>> getAttributePairs()Returns a list of attribute pairs that are associated with the lunar event.- Returns:
- a list of pairs containing the attribute and the resource location of the modifier
-
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 playersleepingLocation- The position of the sleeping player- Returns:
- if the player is allowed to sleep
-