Interface AbilityEffect

All Known Subinterfaces:
EventTriggeredAbilityEffect<T>

public interface AbilityEffect
Represents an ability effect. One Ability may have multiple ability effects.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<AbilityEffect>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.MapCodec<? extends AbilityEffect>
     
    default void
    shiftInto(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
    Called when a Player shifts into an Ability with the effect.
    default void
    shiftOutOf(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
    Called when a Player shifts into an Ability with the effect.
    default void
    tick(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
    Called every tick when an Ability with the effect is active on the given Player.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<AbilityEffect> CODEC
  • Method Details

    • codec

      com.mojang.serialization.MapCodec<? extends AbilityEffect> codec()
      Returns:
      The registered MapCodec of the ability effect.
    • shiftInto

      default void shiftInto(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
      Called when a Player shifts into an Ability with the effect.
      Parameters:
      player - The Player shifting into the Ability.
      ability - The Ability the player is shifting into.
    • shiftOutOf

      default void shiftOutOf(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
      Called when a Player shifts into an Ability with the effect.
      Parameters:
      player - The Player shifting into the Ability.
      ability - The Ability the player is shifting into.
    • tick

      default void tick(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Ability> ability)
      Called every tick when an Ability with the effect is active on the given Player.
      Parameters:
      player - The Player the Ability is active on.
      ability - The Ability that is active.