Class MailEvent.ReadMail

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.MailEvent
com.pixelmonmod.pixelmon.api.events.MailEvent.ReadMail
Direct Known Subclasses:
MailEvent.ReadMail.Post, MailEvent.ReadMail.Pre
Enclosing class:
MailEvent

public abstract static class MailEvent.ReadMail extends MailEvent
Event fired when a player interacts with the mail item and opens it to read (or edit) it
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Fired after the player opens the screen
    static class 
    Fired before the open screen packet is sent Cancelling will stop the player from opening the screen

    Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.MailEvent

    MailEvent.EditMail, MailEvent.ReadMail, MailEvent.SealMail

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
    protected net.minecraft.world.item.ItemStack
     
    protected final boolean
     
    protected final String
     

    Fields inherited from class com.pixelmonmod.pixelmon.api.events.MailEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReadMail(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack itemStack, String author, String text, boolean sealed)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The author of the mail (if sealed) pulled from the NBT of the item To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event
    net.minecraft.world.item.ItemStack
    The mail item stack
    The text of the mail To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event
    boolean
    If the mail is sealed To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event

    Methods inherited from class com.pixelmonmod.pixelmon.api.events.MailEvent

    getPlayer

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

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

    • itemStack

      protected net.minecraft.world.item.ItemStack itemStack
    • author

      protected final String author
    • text

      protected final String text
    • sealed

      protected final boolean sealed
  • Constructor Details

    • ReadMail

      public ReadMail(@Nonnull net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack itemStack, String author, String text, boolean sealed)
  • Method Details

    • getItemStack

      public net.minecraft.world.item.ItemStack getItemStack()
      The mail item stack
      Returns:
      The mail
    • getAuthor

      @Nullable public String getAuthor()
      The author of the mail (if sealed) pulled from the NBT of the item To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event
      Returns:
      The author
    • getText

      public String getText()
      The text of the mail To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event
      Returns:
      The text
    • isSealed

      public boolean isSealed()
      If the mail is sealed To edit this edit the {@link this#getItemStack()}'s NBT in the Pre event
      Returns:
      If it's sealed