WhileTrue do script
whileloop.js
function broadcastMessage() {
plugin.getServer().broadcastMessage("Hello, this is a broadcast message!");
}
// Function to start the broadcast loop
function startBroadcastLoop() {
while (true) {
broadcastMessage();
// Sleep for 10 seconds (20 ticks = 1 second in Minecraft)
java.lang.Thread.sleep(2000); // 10 seconds = 10,000 milliseconds = 20 ticks * 1000 milliseconds
}
}
// Start the broadcast loop
startBroadcastLoop();
Last updated