-
Notifications
You must be signed in to change notification settings - Fork 4
Clan Events
Hempfest edited this page Feb 14, 2021
·
9 revisions
// Modify the clan chat channel
@EventHandler
public void onClanChat(ClanChatEvent event) {
}
// Modify the ally chat channel
@EventHandler
public void onAllyChat(AllyChatEvent event) {
}
// Modify what happens when a user attempts to claim land.
@EventHandler
public void onLandClaim(LandPreClaimEvent event) {
}
// Modify what happens when a user attempts to un-claim land.
@EventHandler
public void onLandUnClaim(LandUnClaimEvent event) {
}
// Modify what happens when users enter claimed land
@EventHandler
public void onClaimResidence(ClaimResidentEvent event) {
}
// Modify what happens when users enter wilderness (unclaimed-land)
@EventHandler
public void onWildernessInhabitance(WildernessInhabitantEvent event) {
}
// Set custom raidshield titles / time intervals
@EventHandler
public void onRaidShieldChange(RaidShieldEvent event) {
}
// Modify what happens when a user interacts with claimed land
@EventHandler
public void onClaimInteract(ClaimInteractEvent event) {
}
// A helpful event that gets triggered when a player kills another player
@EventHandler
public void onPlayerKill(PlayerKillPlayerEvent event) {
}
// A helpful event that triggers when a player hits another player.
@EventHandler
public void onPlayerHit(PlayerPunchPlayerEvent event) {
}
// A helpful event that triggers when a player shoots another player.
@EventHandler
public void onPlayerShoot(PlayerShootPlayerEvent event) {
}
// Insert your own tab completion results for the /clan command
@EventHandler
public void onTabInsert(TabInsertEvent event) {
}
// Insert your added commands into the help menu for the /clan command
@EventHandler
public void onHelp(CommandHelpEvent event) {
}
// Insert information into the /clan info channel
@EventHandler
public void onInfo(ClanInformationAdaptEvent event) {
}
// Insert information into the /clan info <otherClan> channel
@EventHandler
public void onInfoOther(OtherInformationAdaptEvent event) {
}
// Insert your own /clan sub-commands
// All successful code blocks must end with event.setReturn(value);
@EventHandler
public void onCommand(SubCommandEvent event) {
}
// As seen in episode 1 of clans development, create and customize *your own* chat channels.
@EventHandler
public void onCommand(CustomChatEvent event) {
}
(Event builders are redundant to some, but its a way to automatically structure your custom event with clans utilities like StringLibrary and ClanUtil)
public class CustomNamedEvent extends ClanEventBuilder {
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public ClanUtil getUtil() {
return Clan.clanUtil;
}
@Override
public StringLibrary stringLibrary() {
return Clan.clanUtil;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
(Creating an asynchronous event)
public class CustomNamedEvent extends AsyncClanEventBuilder {
private static final HandlerList handlers = new HandlerList();
public CustomNamedEvent(boolean isAsync) {
super(isAsync);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@Override
public ClanUtil getUtil() {
return Clan.clanUtil;
}
@Override
public StringLibrary stringLibrary() {
return Clan.clanUtil;
}
public static HandlerList getHandlerList() {
return handlers;
}
}