Class DamageType

java.lang.Object
com.github.darksoulq.abyssallib.world.entity.DamageType

@Experimental public class DamageType extends Object
Represents a custom damage type to be registered into the Paper DamageType registry.

Each DamageType can have custom audio effects, exhaustion, and scaling behavior. Instances are registered automatically via a DeferredRegistry in plugin bootstrap.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DamageType(net.kyori.adventure.key.Key id)
    Creates a new custom DamageType with the given identifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.github.darksoulq.abyssallib.world.entity.DamageType.Builder
    builder(net.kyori.adventure.key.Key id)
     
    void
    register(io.papermc.paper.plugin.bootstrap.BootstrapContext ctx)
     
    org.bukkit.damage.DamageSource
    withCause(org.bukkit.entity.Entity cause)
     
    org.bukkit.damage.DamageSource
    withDirect(org.bukkit.entity.Entity direct)
     
    org.bukkit.damage.DamageSource
    withLocation(org.bukkit.Location loc)
     

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DamageType

      public DamageType(net.kyori.adventure.key.Key id)
      Creates a new custom DamageType with the given identifier.
      Parameters:
      id - Unique namespaced ID for this damage type.
  • Method Details

    • withCause

      public org.bukkit.damage.DamageSource withCause(org.bukkit.entity.Entity cause)
    • withDirect

      public org.bukkit.damage.DamageSource withDirect(org.bukkit.entity.Entity direct)
    • withLocation

      public org.bukkit.damage.DamageSource withLocation(org.bukkit.Location loc)
    • register

      public void register(io.papermc.paper.plugin.bootstrap.BootstrapContext ctx)
    • builder

      public static com.github.darksoulq.abyssallib.world.entity.DamageType.Builder builder(net.kyori.adventure.key.Key id)