Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add player receives actionbar event (#2326)
* Add player receives actionbar event * Add var to track whether event has been modified
- Loading branch information
Showing
9 changed files
with
180 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...main/java/com/denizenscript/denizen/events/player/PlayerReceivesActionbarScriptEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.denizenscript.denizen.events.player; | ||
|
||
public class PlayerReceivesActionbarScriptEvent extends PlayerReceivesMessageScriptEvent { | ||
|
||
// <--[event] | ||
// @Events | ||
// player receives actionbar | ||
// | ||
// @Regex ^on player receives actionbar$ | ||
// | ||
// @Group Player | ||
// | ||
// @Cancellable true | ||
// | ||
// @Warning Triggering new actionbar messages in this event will cause it to re-fire. | ||
// | ||
// @Triggers when a player receives any actionbar from the server. | ||
// | ||
// @Context | ||
// <context.message> returns an ElementTag of the actionbar. | ||
// <context.raw_json> returns an ElementTag of the raw JSON used for the actionbar. | ||
// | ||
// @Determine | ||
// "MESSAGE:" + ElementTag to change the actionbar. | ||
// "RAW_JSON:" + ElementTag to change the JSON used for the actionbar. | ||
// | ||
// @Player Always. | ||
// | ||
// --> | ||
|
||
public PlayerReceivesActionbarScriptEvent() { | ||
instance = this; | ||
} | ||
|
||
public static PlayerReceivesActionbarScriptEvent instance; | ||
public boolean modified; | ||
|
||
@Override | ||
public boolean couldMatch(ScriptPath path) { | ||
return path.eventLower.startsWith("player receives actionbar"); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "PlayerReceivesActionbar"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters