Element chatRange = scriptEntry.getElement("range");
dB.report(scriptEntry, getName(), talkers.debug() + targets.debug() + message.debug() + chatRange.debug());
// Create new speech context
DenizenSpeechContext context = new DenizenSpeechContext(TagManager.cleanOutputFully(message.asString()),
scriptEntry, chatRange.asDouble());
if (!targets.isEmpty()) {
for (dEntity ent : targets.filter(dEntity.class)) {
context.addRecipient(ent.getBukkitEntity());
}
}
for (dEntity talker : talkers.filter(dEntity.class)) {
Entity entity = talker.getBukkitEntity();
if (entity != null) {
context.setTalker(entity);
new DenizenSpeechController(entity).speak(context);
}
else {
dB.echoDebug(scriptEntry, "Chat Talker is not spawned! Cannot talk.");
}