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, org.bukkit.Translatable

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 an 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, DARKNESS, DOLPHINS_GRACE, FIRE_RESISTANCE, GLOWING, HASTE, HEALTH_BOOST, HERO_OF_THE_VILLAGE, HUNGER, INFESTED, INSTANT_DAMAGE, INSTANT_HEALTH, INVISIBILITY, JUMP_BOOST, LEVITATION, LUCK, MINING_FATIGUE, NAUSEA, NIGHT_VISION, OOZING, POISON, RAID_OMEN, REGENERATION, RESISTANCE, SATURATION, SLOW_FALLING, SLOWNESS, SPEED, STRENGTH, TRIAL_OMEN, UNLUCK, WATER_BREATHING, WEAKNESS, WEAVING, WIND_CHARGED, WITHER
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockPotionEffectType(com.google.gson.JsonObject data)
    Deprecated, for removal: This API element is subject to removal in a future version.
    MockPotionEffectType(@NotNull org.bukkit.NamespacedKey key, int id, @NotNull String name, boolean instant, @NotNull org.bukkit.Color color, @NotNull org.bukkit.potion.PotionEffectType.Category category)
     
    MockPotionEffectType(@NotNull org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color)
    Constructs a new MockPotionEffectType with the provided parameters.
  • 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.
    @NotNull org.bukkit.potion.PotionEffect
    createEffect(int duration, int amplifier)
     
    boolean
     
    static org.bukkit.Keyed
    from(com.google.gson.JsonObject data)
     
    double
    getAttributeModifierAmount(@NotNull org.bukkit.attribute.Attribute attribute, int effectAmplifier)
     
    @NotNull org.bukkit.potion.PotionEffectTypeCategory
     
    @NotNull org.bukkit.Color
     
    double
    Deprecated.
    @NotNull Map<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier>
     
    @NotNull org.bukkit.potion.PotionEffectType.Category
     
    int
    Deprecated.
    @NotNull org.bukkit.NamespacedKey
     
    @NotNull String
     
    @NotNull String
     
    int
     
    boolean
     
    @NotNull String
     

    Methods inherited from class org.bukkit.potion.PotionEffectType

    getById, getByKey, getByName, values

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.bukkit.Keyed

    key
  • Constructor Details

    • MockPotionEffectType

      public MockPotionEffectType(@NotNull @NotNull org.bukkit.NamespacedKey key, int id, @NotNull @NotNull String name, boolean instant, @NotNull @NotNull org.bukkit.Color color, @NotNull @NotNull org.bukkit.potion.PotionEffectType.Category category)
      Parameters:
      key - The namespaced key representing this effect
      id - The magic number representing this effect
      name - The name of this effect
      instant - Whether the effect is instant or not
      color - The color of the effect
      category - The category of the effect
    • MockPotionEffectType

      public MockPotionEffectType(@NotNull @NotNull org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color)
      Constructs a new MockPotionEffectType with the provided parameters.
      Parameters:
      key - The key of the effect type.
      id - The numerical ID of the effect type.
      name - The name of the effect type.
      instant - Whether the effect type is instantly applied.
      color - The color of the effect type.
    • MockPotionEffectType

      @Deprecated(forRemoval=true) public MockPotionEffectType(com.google.gson.JsonObject data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      data - Json data
  • 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
    • getId

      @Deprecated(since="1.20") public int getId()
      Deprecated.
      Specified by:
      getId in class org.bukkit.potion.PotionEffectType
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
    • createEffect

      @NotNull public @NotNull org.bukkit.potion.PotionEffect createEffect(int duration, int amplifier)
      Specified by:
      createEffect in class org.bukkit.potion.PotionEffectType
    • isInstant

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

      @NotNull public @NotNull org.bukkit.potion.PotionEffectTypeCategory getCategory()
      Specified by:
      getCategory 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 Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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()
    • from

      @Internal public static org.bukkit.Keyed from(com.google.gson.JsonObject data)
    • getTranslationKey

      @NotNull public @NotNull String getTranslationKey()