Class AbstractHitEffectCustomizer

java.lang.Object
net.xun.armory.api.item.tools.AbstractHitEffectCustomizer
All Implemented Interfaces:
ToolCustomizer

public abstract class AbstractHitEffectCustomizer extends Object implements ToolCustomizer
Since:
2.1.0
  • Field Summary

    Fields inherited from interface net.xun.armory.api.item.tools.ToolCustomizer

    DEFAULT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    onHit(ToolPieceType piece, net.minecraft.world.entity.LivingEntity target, net.minecraft.world.entity.LivingEntity attacker)
    Handles the hit effect for a specific tool type on the target entity.
    final void
    triggerHit(ToolPieceType piece, net.minecraft.world.entity.LivingEntity target, net.minecraft.world.entity.LivingEntity attacker)
    Invoked internally by the platform combat integration.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.xun.armory.api.item.tools.ToolCustomizer

    create
  • Constructor Details

    • AbstractHitEffectCustomizer

      public AbstractHitEffectCustomizer()
  • Method Details

    • onHit

      protected abstract void onHit(ToolPieceType piece, net.minecraft.world.entity.LivingEntity target, net.minecraft.world.entity.LivingEntity attacker)
      Handles the hit effect for a specific tool type on the target entity.

      This method is called only on the server side and only when the attack successfully damages the target. Subclasses must implement this method to define the actual effect, such as applying potion effects, dealing additional damage, or playing sounds.

      Parameters:
      piece - the type of tool that caused the hit
      target - the entity that was hit
      attacker - the entity that performed the attack
    • triggerHit

      public final void triggerHit(ToolPieceType piece, net.minecraft.world.entity.LivingEntity target, net.minecraft.world.entity.LivingEntity attacker)
      Invoked internally by the platform combat integration.