Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ScriptAPI): async API for tick scheduling #5613

Draft
wants to merge 9 commits into
base: nextgen
Choose a base branch
from

Conversation

MukjepScarlet
Copy link
Contributor

@MukjepScarlet MukjepScarlet commented Feb 14, 2025

(HELP NEEDED)

Note: this is not tickHandler

(This is rewrited) Script example:

    mod.on("chatReceive", async (event) => {
        const message = event.getMessage();
        Client.displayChatMessage(`${message} ${new Date().getMilliseconds()}`);
        await ticks(3);
        Client.displayChatMessage(`${message} ${new Date().getMilliseconds()}`);
        await seconds(1);
        Client.displayChatMessage(`${message} ${new Date().getMilliseconds()}`);
        await until(() => mc.player.isOnGround());
        Client.displayChatMessage(`${message} ${new Date().getMilliseconds()}`);
        await conditional(20, mc.player.isOnGround);
        Client.displayChatMessage(`${message} ${new Date().getMilliseconds()}`);
    });

This is already usable, but some exceptions will happen while calling. I want someone can help me about that. Thanks.

relates to #5597

@sqlerrorthing
Copy link
Contributor

sqlerrorthing commented Feb 14, 2025

(HELP NEEDED)

where?

@MukjepScarlet
Copy link
Contributor Author

(HELP NEEDED)

where?

check TODO

@MukjepScarlet
Copy link
Contributor Author

I was inspired while writing #5693 .
I will implement a async provider API for JS in this PR soon.

@MukjepScarlet MukjepScarlet changed the title feat(ScriptAPI): sequenceHandler feat(ScriptAPI): async API for tick scheduling Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants