Class DamageTypeMock

java.lang.Object
be.seeseemelk.mockbukkit.damage.DamageTypeMock
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, org.bukkit.damage.DamageType, org.bukkit.Keyed, org.bukkit.Translatable

public class DamageTypeMock extends Object implements org.bukkit.damage.DamageType
  • Field Summary

    Fields inherited from interface org.bukkit.damage.DamageType

    ARROW, BAD_RESPAWN_POINT, CACTUS, CRAMMING, DRAGON_BREATH, DROWN, DRY_OUT, EXPLOSION, FALL, FALLING_ANVIL, FALLING_BLOCK, FALLING_STALACTITE, FIREBALL, FIREWORKS, FLY_INTO_WALL, FREEZE, GENERIC, GENERIC_KILL, HOT_FLOOR, IN_FIRE, IN_WALL, INDIRECT_MAGIC, LAVA, LIGHTNING_BOLT, MAGIC, MOB_ATTACK, MOB_ATTACK_NO_AGGRO, MOB_PROJECTILE, ON_FIRE, OUT_OF_WORLD, OUTSIDE_BORDER, PLAYER_ATTACK, PLAYER_EXPLOSION, SONIC_BOOM, SPIT, STALAGMITE, STARVE, STING, SWEET_BERRY_BUSH, THORNS, THROWN, TRIDENT, UNATTRIBUTED_FIREBALL, WIND_CHARGE, WITHER, WITHER_SKULL
  • Constructor Summary

    Constructors
    Constructor
    Description
    DamageTypeMock(com.google.gson.JsonObject data)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Will be replaced with {from(JsonObject)}.
    DamageTypeMock(@NotNull org.bukkit.damage.DamageScaling damageScaling, @NotNull DamageEffectMock damageEffect, @NotNull org.bukkit.NamespacedKey key, @NotNull org.bukkit.damage.DeathMessageType deathMessageType, float exhaustion)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    from(com.google.gson.JsonObject data)
    Create a DamageTypeMock from a JsonObject.
    @NotNull org.bukkit.damage.DamageEffect
     
    @NotNull org.bukkit.damage.DamageScaling
     
    @NotNull org.bukkit.damage.DeathMessageType
     
    float
     
    @NotNull org.bukkit.NamespacedKey
     
    @NotNull String
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.bukkit.Keyed

    key
  • Constructor Details

    • DamageTypeMock

      public DamageTypeMock(@NotNull @NotNull org.bukkit.damage.DamageScaling damageScaling, @NotNull @NotNull DamageEffectMock damageEffect, @NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull org.bukkit.damage.DeathMessageType deathMessageType, float exhaustion)
    • DamageTypeMock

      @Deprecated(forRemoval=true) public DamageTypeMock(com.google.gson.JsonObject data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Will be replaced with {from(JsonObject)}.
  • Method Details

    • from

      public static DamageTypeMock from(com.google.gson.JsonObject data)
      Create a DamageTypeMock from a JsonObject.

      Example:

       {
             "key": "minecraft:in_fire",
             "damageScaling": "WHEN_CAUSED_BY_LIVING_NON_PLAYER",
             "sound": "minecraft:entity.player.hurt_on_fire",
             "deathMessageType": "DEFAULT",
             "exhaustion": 0.1
       }
       
      Parameters:
      data - The json data.
      Returns:
      The damage type created from the JSON
    • getTranslationKey

      @NotNull public @NotNull String getTranslationKey()
      Specified by:
      getTranslationKey in interface org.bukkit.damage.DamageType
      Specified by:
      getTranslationKey in interface org.bukkit.Translatable
    • getDamageScaling

      @NotNull public @NotNull org.bukkit.damage.DamageScaling getDamageScaling()
      Specified by:
      getDamageScaling in interface org.bukkit.damage.DamageType
    • getDamageEffect

      @NotNull public @NotNull org.bukkit.damage.DamageEffect getDamageEffect()
      Specified by:
      getDamageEffect in interface org.bukkit.damage.DamageType
    • getDeathMessageType

      @NotNull public @NotNull org.bukkit.damage.DeathMessageType getDeathMessageType()
      Specified by:
      getDeathMessageType in interface org.bukkit.damage.DamageType
    • getExhaustion

      public float getExhaustion()
      Specified by:
      getExhaustion in interface org.bukkit.damage.DamageType
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
      Specified by:
      getKey in interface org.bukkit.Keyed