Interface PetInteractionGate

All Superinterfaces:
Pet, Scheduler, StoredPet

public interface PetInteractionGate extends Pet
Marker for pet types whose underlying vanilla mob has a per-tick item-driven right-click interaction (cow + bucket → milk, sheep and shears → wool, etc.). In v4 pets are real vanilla mobs, so these interactions happen for free on every tame pet. Implementers expose two pieces of metadata that PetInteractionGateListener uses to decide whether to cancel the upstream PlayerInteractEntityEvent (which short-circuits vanilla's interaction handler before it can run):
  1. gatedInteractionItems() — the set of Materials in the player's hand that trigger this pet's gated interaction. Most pets gate one material; some (e.g., mooshroom: bowl and shears) may eventually gate two.
  2. isInteractionSuppressed() — reads the implementer's own per-pet config flag (e.g. PetCow.CAN_GIVE_MILK). Returns true when the admin has disabled the interaction.

Per-pet flag names stay semantically rich (CanGiveMilk, CanBeSheared, CanGiveStew) because each implementer reads its own ConfigKey static field. The listener never names them. Mirrors PetNaturalDrop for the drop-event family.

  • Method Details

    • gatedInteractionItems

      Set<Material> gatedInteractionItems()
      The set of held-item materials that trigger this pet's gated vanilla interaction (e.g. BUCKET for cow milking, SHEARS for sheep shearing).
      Returns:
      the items that trigger the vanilla interaction
    • isInteractionSuppressed

      boolean isInteractionSuppressed()
      Returns true if the admin has disabled this pet type's vanilla interaction via the per-type config flag.
      Returns:
      true if the interaction is currently blocked