-
Notifications
You must be signed in to change notification settings - Fork 2
PluginMessageUtil usage
하이라이트 edited this page Mar 8, 2023
·
3 revisions
# bukkit
PluginMessageUtil.listen(MessageChannel("example:main")) {
Bukkit.broadcast(text(readUTF()))
}
PluginMessageUtil.bytes {
writeUTF("Hello, World!")
}
player.send(MessageChannel("example:main")) {
writeUTF("DataResponse")
writeUTF(data)
}
# bungee
# player is receiver
# "DataResponse" is SubChannel
PluginMessageUtil.listen(player, MessageChannel("example:main"), "DataResponse", filter = { true }) { player ->
data = readUTF()
}
server.send(MessageChannel("example:main")) {
writeUTF("DataReceived")
}