Class VisitorSpawnedEvent

java.lang.Object
com.minecolonies.core.colony.eventhooks.citizenEvents.AbstractCitizenEvent
com.minecolonies.core.colony.eventhooks.citizenEvents.VisitorSpawnedEvent
All Implemented Interfaces:
ICitizenEventDescription, IColonyEventDescription, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class VisitorSpawnedEvent extends AbstractCitizenEvent
The event handling a newly spawned visitor.
  • Field Details

    • VISITOR_SPAWNED_EVENT_ID

      public static final net.minecraft.resources.ResourceLocation VISITOR_SPAWNED_EVENT_ID
      This events id, registry entries use res locations as ids.
  • Constructor Details

    • VisitorSpawnedEvent

      public VisitorSpawnedEvent()
      Creates a new visitor spawned event.
    • VisitorSpawnedEvent

      public VisitorSpawnedEvent(net.minecraft.core.BlockPos eventPos, String citizenName)
      Creates a new visitor spawned event.
      Parameters:
      eventPos - the position of the hut block of the building.
      citizenName - the name of the building.
  • Method Details

    • getEventTypeId

      public net.minecraft.resources.ResourceLocation getEventTypeId()
      Description copied from interface: IColonyEventDescription
      Gets this event types registry id.
      Returns:
      this event types registry id.
    • getName

      public String getName()
      Description copied from interface: IColonyEventDescription
      Gets the name of this event type.
      Returns:
      the name of this event type.
    • loadFromNBT

      public static VisitorSpawnedEvent loadFromNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, @NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Loads the visitor spawned event from the given nbt.
      Parameters:
      compound - the NBT compound
      Returns:
      the colony to load.
    • loadFromFriendlyByteBuf

      public static VisitorSpawnedEvent loadFromFriendlyByteBuf(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Loads the visitor spawned event from the given packet buffer.
      Parameters:
      buf - the packet buffer.
      Returns:
      the colony to load.