mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-22 21:51:17 -09:00
15 lines
722 B
JavaScript
15 lines
722 B
JavaScript
(() => {
|
|
PluginAPI.dedicatedServer.appendCode(function () {
|
|
PluginAPI.addEventListener("processcommand", (event) => {
|
|
if (event.command.toLowerCase().startsWith("/talkback")) {
|
|
var message = event.command.substring("/talkback ".length);
|
|
if (
|
|
ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP").instanceOf(event.sender.getRef())
|
|
) {
|
|
event.sender.addChatMessage(ModAPI.reflect.getClassById("net.minecraft.util.ChatComponentText").constructors[0](ModAPI.util.str(message.toUpperCase())));
|
|
}
|
|
event.preventDefault = true;
|
|
}
|
|
});
|
|
});
|
|
})(); |