feat: login message (and also command), for use with ayunboom

This commit is contained in:
ChomeNS
2025-06-18 20:11:09 +07:00
parent e5ca1786ae
commit 8832efeb05
4 changed files with 6 additions and 1 deletions

View File

@@ -1 +1 @@
3461
3462

View File

@@ -258,6 +258,8 @@ public class Bot extends SessionAdapter {
this.listener.dispatch(listener -> listener.connected(new ConnectedEvent(session)));
session.send(ServerboundPlayerLoadedPacket.INSTANCE);
if (!options.loginMessage.isBlank()) this.chat.send(options.loginMessage);
}
private void packetReceived (final ClientboundCustomQueryPacket packet) {

View File

@@ -166,6 +166,7 @@ public class Configuration {
public boolean resolveSRV = true;
public int reconnectDelay = 2000;
public int chatQueueDelay = 125;
public String loginMessage = "";
public EssentialsMessages essentialsMessages = new EssentialsMessages();
public CoreRateLimit coreRateLimit = new CoreRateLimit();

View File

@@ -140,6 +140,7 @@ bots:
# useCorePlaceBlock - uses the place block core instead of the main core. only used if useCore is enabled
# useChat - when the bot tellraws it will chat instead of using the core to run tellraw
# useSNBTComponents - if the server is >=1.21.5, it's pretty likely that you can enable this since 1.21.5 supports SNBT components
# loginMessage - the message to send when the bot received the login packet, this can also be a command, just prefix it with `/`
# coreCommandSpy - set to true if server supports enabling player's commandspy through command block, defaults to true
# logConnectionStatusMessages - logs connecting and disconnected messages to console (and the log file) and discord if set to true, defaults to true
# resolveSRV - whether to resolve SRV records on the server. the notchian minecraft doesn't resolve them
@@ -165,6 +166,7 @@ bots:
# useCorePlaceBlock: false
# useChat: false
# useSNBTComponents: true
# loginMessage: ''
# coreCommandSpy: true
# logConnectionStatusMessages: true
# resolveSRV: true