#Export/Import FormData
1 messages · Page 1 of 1 (latest)
[index.js] ran with error: [TypeError: Incorrect number of arguments to function. Expected 0, received 1 at ActionFormData (native)
at <anonymous> (@DBE/systems/missions.js:45)
]
Wait
The last
You put function inside ActionFomrData?
import { mission } from "../systems/missions";
import { ActionFormData } from "@minecraft/server-ui";
export function mission(player) {
const form = new ActionFormData();
form.title("ui.missions.title");
form.button("");
form.button({ rawtext: [{ translate: "start" }] });
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ text: "\n" },
{ translate: "mission.text_1" },
{ text: "\n" },
{ translate: "mission.objective_1" },
],
});
form.show(player).then((response) => {
switch (response.selection) {
case 0:
if (player.hasTag("dbe:kaioken")) {
kaioken(player);
} else if (player.hasTag("dbe:kaioken_x3")) {
kaioken_x3(player);
} else if (player.hasTag("dbe:kaioken_x10")) {
kaioken_x10(player);
} else if (player.hasTag("dbe:kaioken_x20")) {
kaioken_x20(player);
} else
system.runTimeout(() => {
menu(player);
}, 1);
break;
case 1:
player.runCommandAsync(
'tellraw @initiator[scores={dbe:mission2=1..}] {"rawtext":[{"translate":"mission.error.2"}]}'
);
player.runCommandAsync(
"execute at @s[scores={dbe:mission2=0}] run function sagas/saiyan/mission_1"
);
break;
}
});
}
Then on another file
import { mission } from "../systems/missions";
// ...
mission(player)
?
I put the mission(player) in the form data of the ui.js archive and it isn't opening
And this too
The stable 1.19.81
Did the menu form is open?
Yes the menu form is opening but when i click in the mission button it not open
why not just use
if (response.selection == 0) {
[other if statments] {
[code]
}
}
why do u have to use switch
looks cleaner thats all
It's bec i prefer to create the scripts in an organized way in folders
is 0 mission button?
It is 1
alright
import { ActionFormData } from "@minecraft/server-ui";
import { menu } from "./[menu path]"
export function mission(player) {
const form = new ActionFormData();
form.title("ui.missions.title");
form.button("");
form.button({ rawtext: [{ translate: "start" }] });
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ text: "\n" },
{ translate: "mission.text_1" },
{ text: "\n" },
{ translate: "mission.objective_1" },
],
});
form.show(player).then((response) => {
switch (response.selection) {
case 0:
if (player.hasTag("dbe:kaioken")) {
kaioken(player);
} else if (player.hasTag("dbe:kaioken_x3")) {
kaioken_x3(player);
} else if (player.hasTag("dbe:kaioken_x10")) {
kaioken_x10(player);
} else if (player.hasTag("dbe:kaioken_x20")) {
kaioken_x20(player);
} else
system.runTimeout(() => {
menu(player);
}, 1);
break;
case 1:
player.runCommandAsync(
'tellraw @initiator[scores={dbe:mission2=1..}] {"rawtext":[{"translate":"mission.error.2"}]}'
);
player.runCommandAsync(
"execute at @s[scores={dbe:mission2=0}] run function sagas/saiyan/mission_1"
);
break;
}
});
}
that could be it im not sure
import { menu } from "./[menu path]"
what was the problem
A stpid issue XD
@fathom roverbut can u help me with this
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ text: "\n" },
{ translate: "mission.text_1" },
{ text: "\n" },
{ translate: "mission.objective_1" },
],
});
what about it
The lines are not below of each another
also could u test sum for me i cant get on mc rn
\n in stranslate
{"translate":"mission.title_1\n\n"}
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ text: "\\n" },
{ translate: "mission.text_1" },
{ text: "\\n" },
{ translate: "mission.objective_1" },
],
});
oh
Idk if it's works, but try it
no
try^
oh no
i mean in the .lang
wait thats where it is right?
wherever it is
do [text]\n
and remove { text: "\n" },
hm
that should work
Xd is what i understand XD
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ translate: "mission.text_1" },
{ translate: "mission.objective_1" },
],
});
Hmm
yep
;-;
u dont nee to ping
Oka
So what should i do now?
test
"didn't work?"
Yes
form.body({
rawtext: [
{ translate: "mission.title_1" },
{ text: "\n" },
{ translate: "mission.text_1" },
{ text: "\n" },
{ translate: "mission.objective_1" },
],
});
lmao
xará & br
Opa
@karmic ermineCan u help me pls
How can i test more than one score in getScore??