Class MockPotionEffectType

java.lang.Object
org.bukkit.potion.PotionEffectType
be.seeseemelk.mockbukkit.potion.MockPotionEffectType
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, net.kyori.adventure.translation.Translatable, org.bukkit.Keyed

public class MockPotionEffectType extends org.bukkit.potion.PotionEffectType
This MockPotionEffectType mocks an actual PotionEffectType by taking an id, a name, whether it is instant and a RGB Color variable.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.potion.PotionEffectType

    org.bukkit.potion.PotionEffectType.Category
  • Field Summary

    Fields inherited from class org.bukkit.potion.PotionEffectType

    ABSORPTION, BAD_OMEN, BLINDNESS, CONDUIT_POWER, CONFUSION, DAMAGE_RESISTANCE, DARKNESS, DOLPHINS_GRACE, FAST_DIGGING, FIRE_RESISTANCE, GLOWING, HARM, HEAL, HEALTH_BOOST, HERO_OF_THE_VILLAGE, HUNGER, INCREASE_DAMAGE, INVISIBILITY, JUMP, LEVITATION, LUCK, NIGHT_VISION, POISON, REGENERATION, SATURATION, SLOW, SLOW_DIGGING, SLOW_FALLING, SPEED, UNLUCK, WATER_BREATHING, WEAKNESS, WITHER
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockPotionEffectType(org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier)
    Adds an attribute modifier to this potion effect type.
    boolean
     
    double
    getAttributeModifierAmount(@NotNull org.bukkit.attribute.Attribute attribute, int effectAmplifier)
     
    @NotNull org.bukkit.Color
     
    double
    Deprecated.
    @NotNull Map<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier>
     
    @NotNull org.bukkit.potion.PotionEffectType.Category
     
    @NotNull String
     
    int
     
    boolean
     
    @NotNull String
     

    Methods inherited from class org.bukkit.potion.PotionEffectType

    createEffect, getById, getByKey, getByName, getId, getKey, registerPotionEffectType, stopAcceptingRegistrations, toString, values

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.Keyed

    key
  • Constructor Details

    • MockPotionEffectType

      public MockPotionEffectType(org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color)
  • Method Details

    • getDurationModifier

      @Deprecated public double getDurationModifier()
      Deprecated.
      Specified by:
      getDurationModifier in class org.bukkit.potion.PotionEffectType
    • getName

      @NotNull public @NotNull String getName()
      Specified by:
      getName in class org.bukkit.potion.PotionEffectType
    • isInstant

      public boolean isInstant()
      Specified by:
      isInstant in class org.bukkit.potion.PotionEffectType
    • getColor

      @NotNull public @NotNull org.bukkit.Color getColor()
      Specified by:
      getColor in class org.bukkit.potion.PotionEffectType
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class org.bukkit.potion.PotionEffectType
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.bukkit.potion.PotionEffectType
    • addAttributeModifier

      public void addAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier)
      Adds an attribute modifier to this potion effect type.
      Parameters:
      attribute - The attribute to modify.
      modifier - The modifier to apply.
    • getEffectAttributes

      @NotNull public @NotNull Map<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getEffectAttributes()
      Specified by:
      getEffectAttributes in class org.bukkit.potion.PotionEffectType
    • getAttributeModifierAmount

      public double getAttributeModifierAmount(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, int effectAmplifier)
      Specified by:
      getAttributeModifierAmount in class org.bukkit.potion.PotionEffectType
    • getEffectCategory

      @NotNull public @NotNull org.bukkit.potion.PotionEffectType.Category getEffectCategory()
      Specified by:
      getEffectCategory in class org.bukkit.potion.PotionEffectType
    • translationKey

      @NotNull public @NotNull String translationKey()