java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.killer.KillerAdapter
All Implemented Interfaces:
Adapter

public class KillerAdapter extends Object implements Adapter
Adapter that maps supported objects to the Killable interface for macro extraction.

This adapter enables the use of the {OBJECT.KILLER} macro by wrapping objects that can report who killed them. This includes:

  • Custom plugin-defined objects implementing Killable
  • LivingEntity types from Bukkit, where getKiller() is available

This adapter is commonly used to generate messages about deaths, such as kill feeds or death chest logs.

  • Constructor Details

    • KillerAdapter

      public KillerAdapter()
  • Method Details

    • adapt

      public Optional<Killable> adapt(Object obj)
      Attempts to adapt an object to the Killable interface.
      Specified by:
      adapt in interface Adapter
      Parameters:
      obj - the object to adapt
      Returns:
      an Optional<Killable> if supported, otherwise empty