so i am not so sure but, it's more of a question. is it a bug or intended behavior?
Here is a form:
const form = new ModalFormData()
.title("Ban Info")
.label("§eFill one of the following fields§c*")
.divider()
.textField("Reason§c*", "Required")
.divider()
.label("Ban Duration§c*")
.toggle("Permanent ban", { defaultValue: false })
.textField("Duration (e.g. 1w 2d 3h 4m)", "Optional")
.submitButton("Confirm Ban");
so i show it using a force show. here:
const res = await player.show(form);
if (res.canceled) return;
const filteredRes = filterRes(res);```
and now in that function:
```ts
function filterRes(res: ModalFormResponse): FilteredRes | null {
if (!res.formValues) return null;
let msg = '';
for (let i = 0; i < res.formValues.length; i++) {
msg += `\n${i}:${res.formValues[i]}`;
}
console.log(msg);
const reason = String(res.formValues[0]).trim();
const isPermanent = Boolean(res.formValues[2]);
const durationStr = String(res.formValues[3] || "").trim();
if (!reason) return null;
let expiresAt: number | false = false;
if (!isPermanent) {
const ms = parseDuration(durationStr);
if (ms <= 0) return null;
expiresAt = Date.now() + ms;
}
return { isPermanent, expiresAt, reason };
}```
now:
[Scripting][inform]-
0:undefined
1:undefined
2:bug
3:undefined
4:undefined
5:true
6:44d```
i am absolutely baffled.