Class ZombieVillagerOutputEvent

java.lang.Object
org.bukkit.event.Event
simplexity.villagerinfo.events.ZombieVillagerOutputEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class ZombieVillagerOutputEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Called when information is to be displayed on a zombie villager
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    ZombieVillagerOutputEvent(org.bukkit.entity.ZombieVillager zombieVillager, org.bukkit.entity.Player player)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Builds the Component to send to the player
    Uses getTimeUntilConvertedMessageComponent(), getZombieVillagerHealthMessageComponent(), getZombieVillagerProfessionMessageComponent() if not null
    If all messages are null, uses NO_INFORMATION_TO_DISPLAY message from VillagerMessage enum
    Uses PLUGIN_PREFIX message from ServerMessage enum
    void
    Checks player's output toggle state and sets playerOutputToggleEnabled
     
    static org.bukkit.event.HandlerList
    Gets the handler list for this evene
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this evene
    net.kyori.adventure.text.Component
    Get the Component that is to be sent to the player
    org.bukkit.entity.Player
    Gets the player involved in this event
    Gets the number of ticks until converted
    net.kyori.adventure.text.Component
    Gets the Component for the Time Until Converted message
    Uses ZOMBIE_VILLAGER_NOT_CURRENTLY_CONVERTING and ZOMBIE_VILLAGER_CONVERSION_TIME messages from VillagerMessage enum
    Returns null if ConfigToggle.DISPLAY_ZOMBIE_VILLAGER_CONVERSION_TIME.isEnabled() is false
    org.bukkit.entity.ZombieVillager
    Gets the zombie villager involved in this event
    Gets zombie villager's current health
    net.kyori.adventure.text.Component
    Gets the component for the Zombie Villager Health Message
    Uses VILLAGER_HEALTH message from VillagerMessage enum
    Returns null if ConfigToggle.DISPLAY_HEALTH.isEnabled() is false
    Gets zombie villager's max health
    org.bukkit.entity.Villager.Profession
    Gets zombie villager's profession
    net.kyori.adventure.text.Component
    Gets the Component for the Zombie Villager Profession Message
    Uses VILLAGER_PROFESSION message from VillagerMessage enum
    Returns null if ConfigToggle.DISPLAY_PROFESSION.isEnabled() is false
    boolean
    Gets whether this event has been cancelled
    boolean
    Gets whether this zombie villager is currently converting
    boolean
    Gets playerOutputToggleEnabled
    void
    Sends outputComponent to player if the player's toggle is enabled
    void
    setCancelled(boolean cancel)
    Gets whether this event should be cancelled
    void
    setOutputComponent(net.kyori.adventure.text.Component outputComponent)
    Set the component that should be sent to the player
    void
    setOverridePlayerOutputToggleEnabled(boolean playerOutputToggleEnabled)
    Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settings

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • ZombieVillagerOutputEvent

      public ZombieVillagerOutputEvent(org.bukkit.entity.ZombieVillager zombieVillager, org.bukkit.entity.Player player)
  • Method Details

    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the handler list for this evene
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      HandlerList
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the handler list for this evene
      Returns:
      HandlerList
    • getCurrentGameTime

      public Long getCurrentGameTime()
    • isConverting

      public boolean isConverting()
      Gets whether this zombie villager is currently converting
      Returns:
      boolean
    • getZombieVillagerCurrentHealth

      public Double getZombieVillagerCurrentHealth()
      Gets zombie villager's current health
      Returns:
      Double
    • getZombieVillagerMaxHealth

      public Double getZombieVillagerMaxHealth()
      Gets zombie villager's max health
      Returns:
      Double
    • getZombieVillagerHealthMessageComponent

      public net.kyori.adventure.text.Component getZombieVillagerHealthMessageComponent()
      Gets the component for the Zombie Villager Health Message
      Uses VILLAGER_HEALTH message from VillagerMessage enum
      Returns null if ConfigToggle.DISPLAY_HEALTH.isEnabled() is false
      Returns:
      Component
    • getZombieVillagerProfession

      public org.bukkit.entity.Villager.Profession getZombieVillagerProfession()
      Gets zombie villager's profession
      Returns:
      Villager.Profession
    • getZombieVillagerProfessionMessageComponent

      public net.kyori.adventure.text.Component getZombieVillagerProfessionMessageComponent()
      Gets the Component for the Zombie Villager Profession Message
      Uses VILLAGER_PROFESSION message from VillagerMessage enum
      Returns null if ConfigToggle.DISPLAY_PROFESSION.isEnabled() is false
      Returns:
      Component
    • getTimeUntilConverted

      public Integer getTimeUntilConverted()
      Gets the number of ticks until converted
      Returns:
      Integer
    • getTimeUntilConvertedMessageComponent

      public net.kyori.adventure.text.Component getTimeUntilConvertedMessageComponent()
      Gets the Component for the Time Until Converted message
      Uses ZOMBIE_VILLAGER_NOT_CURRENTLY_CONVERTING and ZOMBIE_VILLAGER_CONVERSION_TIME messages from VillagerMessage enum
      Returns null if ConfigToggle.DISPLAY_ZOMBIE_VILLAGER_CONVERSION_TIME.isEnabled() is false
      Returns:
      Component
    • buildOutputComponent

      public void buildOutputComponent()
      Builds the Component to send to the player
      Uses getTimeUntilConvertedMessageComponent(), getZombieVillagerHealthMessageComponent(), getZombieVillagerProfessionMessageComponent() if not null
      If all messages are null, uses NO_INFORMATION_TO_DISPLAY message from VillagerMessage enum
      Uses PLUGIN_PREFIX message from ServerMessage enum
    • sendOutputToPlayer

      public void sendOutputToPlayer()
      Sends outputComponent to player if the player's toggle is enabled
    • setOutputComponent

      public void setOutputComponent(net.kyori.adventure.text.Component outputComponent)
      Set the component that should be sent to the player
      Parameters:
      outputComponent - Component
    • getOutputComponent

      public net.kyori.adventure.text.Component getOutputComponent()
      Get the Component that is to be sent to the player
      Returns:
      Component
    • checkPlayerPDC

      public void checkPlayerPDC()
      Checks player's output toggle state and sets playerOutputToggleEnabled
    • isCancelled

      public boolean isCancelled()
      Gets whether this event has been cancelled
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      boolean
    • setCancelled

      public void setCancelled(boolean cancel)
      Gets whether this event should be cancelled
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getZombieVillager

      public org.bukkit.entity.ZombieVillager getZombieVillager()
      Gets the zombie villager involved in this event
      Returns:
      ZombieVillager
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player involved in this event
      Returns:
      Player
    • isPlayerOutputToggleEnabled

      public boolean isPlayerOutputToggleEnabled()
      Gets playerOutputToggleEnabled
      Returns:
      boolean
    • setOverridePlayerOutputToggleEnabled

      public void setOverridePlayerOutputToggleEnabled(boolean playerOutputToggleEnabled)
      Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settings
      Parameters:
      playerOutputToggleEnabled - boolean