mojira.dev

Maximilian Ewald

Assigned

No issues.

Reported

MCPE-173406 itemUseOn not working with empty hand anymore Incomplete MCPE-162623 ItemTypes.air not working Awaiting Response MCPE-159185 Form not opening on chat event Awaiting Response MCPE-152430 Renaming players with GameTest will not allow you to target (duplicated) Duplicate MCPE-39850 Realms won't load addons since 1.8 Duplicate

Comments

I found a workaround, it's pretty nasty, but it works:

Give and clear command still use data.

You can use these commands with the typeId of the item and various data values (0-15) to detect if the amount of the item changes.

@tobiaspm

you can use this:

event.block.location

File added. Now running every 10 seconds and giving more information about the error. Tested with Windows 10 Edition.

I tried it with bedrock server software for linux on 1.19.22 & 1.19.30 in chat using windows 10 edition as client.

 

Steps to reproduce

  1. Run a server and join with a client.

  2. Give the client op

  3. Try running the following command in chat:
    /transferserver griefergames.net 19132

Observed Result

The command is unknown.

Expected Result

The Player switches to the other server.

No, the new property does not fix the issue. I already built a workaround that detects the possible reasons and restarts the form if necessary. As I said an option to close open windows would fix the issue.

this example instantly triggers a form on any message

import * as UI from "mojang-minecraft-ui";
import { world } from 'mojang-minecraft';

world.events.beforeChat.subscribe((event)=>{
    form([{type:"textField"}],(result)=>{
        const obj={rawtext:[{
            text:JSON.stringify(result)
        }]};
        event.sender.runCommand(`tellraw @s ${JSON.stringify(obj)}`);
    }, event.sender);
})

export function form(data, onSubmit, playerData) {
    const form = new UI.ModalFormData();
    form.title("Form");
    for (let i = 0; i < data.length; i++) {
        const element = data[i];
        switch (element.type) {
            case "dropdown":
                form.dropdown(
                    element.label || "Dropdown",
                    element.hasOwnProperty("default") ? element.options : [...element.options].concat([""]),
                    element.hasOwnProperty("default") ? element.default : element.options.length
                );
                break;
            case "slider":
                form.slider(
                    element.label || "Slider",
                    element.hasOwnProperty("min") ? element.min : 0,
                    element.hasOwnProperty("max") ? element.max : 100,
                    element.hasOwnProperty("step") ? element.step : 1,
                    element.default
                )
                break;
            case "toggle":
                form.toggle(
                    element.label || "Toggle",
                    element.default || false,
                )
            case "textField":
                form.textField(
                    element.label || "Text Field",
                    element.default || ""
                )
                break;
            default:
                break;
        }
    }
    const promise = form.show(playerData);
    promise.then((result) => \{ if (!result.isCanceled) onSubmit(result) }, debug);
}

Hi,

here the link to a video that shows the bug.

https://www.dropbox.com/s/vjletm21482bvrr/Minecraft%202022-08-09%2011-40-41.mp4?dl=0

The form opens three seconds after the chat event (if the chat is closed).

  1. Get the PlayerData of a player. Eg: world.getPlayers()

  2. Change the nameTag: player.nameTag="TestName"

  3. Try to teleport that player via chat command: /tp "(Gamertag)" @s