Class GroupCreateEvent

java.lang.Object
org.bukkit.event.Event
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class GroupCreateEvent extends ResultEvent
Event triggered when a group is created within a dominion.

This event is triggered when a group is added. After a successful addition, the new group can be obtained via getGroup(). If the addition fails, getGroup() returns null.

  • Constructor Details

    • GroupCreateEvent

      public GroupCreateEvent(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull String groupName)
      Constructs a new GroupCreateEvent.
      Parameters:
      operator - the command sender who initiated the event
      dominion - the dominion to which the group belongs
      groupName - the name of the group being created
  • Method Details

    • setDominion

      public void setDominion(@NotNull @NotNull DominionDTO dominion)
      Sets the dominion to which the group belongs.
      Parameters:
      dominion - the dominion to set
    • getDominion

      @NotNull public @NotNull DominionDTO getDominion()
      Gets the dominion to which the group belongs.
      Returns:
      the dominion
    • setGroupNameColored

      public void setGroupNameColored(String groupName)
      Sets the name of the group with color codes.
      Parameters:
      groupName - the name of the group with color codes
    • getGroupNameColored

      public String getGroupNameColored()
      Gets the name of the group with color codes.
      Returns:
      the name of the group with color codes
    • getGroupNamePlain

      public String getGroupNamePlain()
      Gets the plain text name of the group without color codes.
      Returns:
      the plain text name of the group
    • setGroup

      public void setGroup(@NotNull @NotNull GroupDTO group)
      Sets the group being created.
      Parameters:
      group - the group to set
    • getGroup

      @Nullable public @Nullable GroupDTO getGroup()
      Gets the newly created group. If the addition fails, returns null.
      Returns:
      the newly created group, or null if the addition fails