In the d.ts file, the defaultValue property of the textFieldOptions parameter for the textField method in ModalFormData is defined as accepting both string and minecraftserver.RawMessage types. However, when a RawMessage object is provided, it results in a form creation error: "Error creating form. Received invalid form json. Error: /content/1/default: Invalid type for property. Expected 'string' got 'object'." This behavior directly contradicts the interface definition.
Attachments
Comments 2
Steps to Reproduce:
1. new ModalFormData() .textField('text1', 'text2', defaultValue: {translate:'translate.text'})
2. After editing the script, enter the game to display the ModalFormData UI
Observed Results:
UI error: "Error creating form. Received invalid form json. Error: /content/1/default: Invalid type for property. Expected 'string' got 'object'"
Expected Results:
It should correctly parse the object type to satisfy the minecraftserver.RawMessage type.
Your report does not have enough information to reproduce the issue.
Please include the following information to help us understand your problem:
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki