@Override
public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
// Fetch objects
Element text = scriptEntry.getElement("text");
AnnounceType type = (AnnounceType) scriptEntry.getObject("type");
FormatScriptContainer format = (FormatScriptContainer) scriptEntry.getObject("format");
Element flag = scriptEntry.getElement("flag");
// Report to dB
dB.report(scriptEntry, getName(),
aH.debugObj("Message", text)
+ (format != null ? aH.debugObj("Format", format.getName()) : "")
+ aH.debugObj("Type", type.name())
+ (flag != null? aH.debugObj("Flag_Name", flag) : ""));
String message = format != null ? format.getFormattedText(scriptEntry) : text.asString();
// Use Bukkit to broadcast the message to everybody in the server.
if (type == AnnounceType.ALL) {
DenizenAPI.getCurrentInstance().getServer().broadcastMessage(message);
}