world.beforeEvents.chatSend.subscribe(async (data) => {
const { message, sender: player } = data;
if (message === "-bp") {
let title = "bbb";
system.run(() => {
first(player, title);
});
}
});
export async function first(player, title, source) {
const form = new ChestFormData("45");
form.title(title);
form.pattern([
"_________",
"_________",
"_________",
"_________",
"xxyyyyyxx",
], {
x: { itemName: "glass", stackAmount: 1, texture: "textures/blocks/glass_red" },
y: { itemName: "glass", stackAmount: 1, texture: "textures/blocks/glass_orange" },
});
const response = await forceShow(player, form);
await system.waitTicks(2);
uiManager.closeAllForms(player);
second(player, title)(
}
Why i should cancel form to play the second ui? how to solve this so it will play second form when i closed chat?