please add proper op and gamemode selfcare #4

Closed
opened 2025-07-04 22:29:11 -04:00 by Parker2991 · 14 comments

please do so using the entity_status and game_state_change packets

please do so using the entity_status and game_state_change packets

mineflayer already keeps track of the player's game mode, you just need to handle the permission level part using entity status packet

mineflayer already keeps track of the player's game mode, you just need to handle the permission level part using entity status packet
Owner

well, things already work fine for me, not gonna delve into the friggin' protocol thing at least for now

well, things already work fine for me, not gonna delve into the friggin' protocol thing at least for now
Author

your selfcare is ass please do this

your selfcare is ass please do this
Author

someone can just cloop deop the bot and it wont op itself

someone can just cloop deop the bot and it wont op itself
Author
bot.init = async () => {
    bot.chat(`/op ${bot.username}`);
    await delay(1e3);
    bot.chat(`/gmc`);
    await delay(1e3);
    bot.chat(`/tp 1024 0 0`);
    await delay(1e3);
    bot.chat(`/setblock ~ ~-1 ~ repeating_command_block`);
}

this wont work in the long run

```js bot.init = async () => { bot.chat(`/op ${bot.username}`); await delay(1e3); bot.chat(`/gmc`); await delay(1e3); bot.chat(`/tp 1024 0 0`); await delay(1e3); bot.chat(`/setblock ~ ~-1 ~ repeating_command_block`); } ``` this wont work in the long run
Owner
setInterval(async () => {
    if (commandQueue.length === 0) return;
    (runCommand => runCommand(commandQueue.shift()))
        (async command => {
            for (let remainingRetries = 3; remainingRetries; remainingRetries--) {
                try {
                    commandBlock = bot.findBlock({ matching: bot.registry.blocksByName.repeating_command_block.id });
                    bot.setCommandBlock(commandBlock.position, command, {
                        mode: 1,
                        trackOutput: false,
                        conditional: false,
                        alwaysActive: true
                    });
                    return;
                } catch {
                    bot.init();
                    await delay(60e3);
                }
            }
            bot.chat("&7Uh-oh, something went wrong.");
            createFile(require('path').join(__dirname, '.die_requested'));
            bot.quit("maxRetriesExceeded");
        });
}, 1e3);

it does op itself but only when necessary, pas de problème

```js setInterval(async () => { if (commandQueue.length === 0) return; (runCommand => runCommand(commandQueue.shift())) (async command => { for (let remainingRetries = 3; remainingRetries; remainingRetries--) { try { commandBlock = bot.findBlock({ matching: bot.registry.blocksByName.repeating_command_block.id }); bot.setCommandBlock(commandBlock.position, command, { mode: 1, trackOutput: false, conditional: false, alwaysActive: true }); return; } catch { bot.init(); await delay(60e3); } } bot.chat("&7Uh-oh, something went wrong."); createFile(require('path').join(__dirname, '.die_requested')); bot.quit("maxRetriesExceeded"); }); }, 1e3); ``` it does op itself but only when necessary, pas de problème
Author

that is not how you do selfcare 😭

that is not how you do selfcare 😭
Owner

done

done
Author

one more request mabe set the interval to 1000 or 500 ms

one more request mabe set the interval to 1000 or 500 ms
Author

cuz 60000ms is way too long for selfcare

cuz 60000ms is way too long for selfcare
Owner

well that's how i like it since deopping doesn't happen all the time, pretty much nobody uses this bot, it saves system resources for my smol vps, and this is not a real-time system anyway

well that's how i like it since deopping doesn't happen all the time, pretty much nobody uses this bot, it saves system resources for my smol vps, and this is not a real-time system anyway
Author

600000ms makes no sense for selfcare

600000ms makes no sense for selfcare
Author

its not even selfcare at that point

its not even selfcare at that point
Owner

problem solved

problem solved
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Plovie/plobot#4
No description provided.