Class DropItemMechanic

java.lang.Object
me.deecaad.core.mechanics.defaultmechanics.Mechanic
me.deecaad.core.mechanics.defaultmechanics.DropItemMechanic
All Implemented Interfaces:
InlineSerializer<Mechanic>, Serializer<Mechanic>, net.kyori.adventure.key.Keyed, org.bukkit.Keyed

public class DropItemMechanic extends Mechanic
Drops a real item at the target location.
  • Constructor Details

    • DropItemMechanic

      public DropItemMechanic()
      Default constructor for serializers.
    • DropItemMechanic

      public DropItemMechanic(org.bukkit.inventory.ItemStack item, VectorProvider velocity)
  • Method Details

    • use0

      public void use0(CastData cast)
      Description copied from class: Mechanic
      This method should be overridden to define the behavior of the Mechanic. For example, a Potion mechanic may use the CastData.getTarget() method to apply a potion effect.
      Specified by:
      use0 in class Mechanic
      Parameters:
      cast - The non-null data including source/target information.
    • getKey

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

      @NotNull public @NotNull Mechanic serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Description copied from interface: Serializer
      Instantiates a new Object to be added into the finalized configuration. The object should be built off of SerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw a SerializerException. This method may not return null.
      Parameters:
      data - The non-null data containing config
      Returns:
      The non-null serialized data.
      Throws:
      me.deecaad.core.file.SerializerException - If there is an error in config.