Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import("util.command");
- import("util.callAsync");
- import("chat.tellraw");
- init();
- function init()
- {
- command("kill @e[type=ArmorStand,name=!validate]");
- command("summon ArmorStand -1 10 0 {CustomName:cursor,NoGravity:true}");
- command("scoreboard players set @e[type=ArmorStand,name=cursor] stdInteger 0");
- command("stats entity @e[type=ArmorStand,name=cursor] set SuccessCount @e[type=ArmorStand,name=cursor] stdInteger");
- int arg;
- main();
- }
- function main()
- {
- isCmd("set", function()
- {
- parseArg(function()
- {
- int variable = arg;
- });
- });
- isCmd("out", function()
- {
- tellraw(variable);
- });
- }
- function parseArg(delegate callback)
- {
- arg = -1;
- static for(static int i = 0; i <= 3; i++)
- {
- command("execute @e[type=ArmorStand,name=cursor] ~ ~ ~ testforblock ~ ~ ~ minecraft:wall_sign -1 {Text2:\\"\\\\\"{0}\\\\\"\\"}".format(i)); //"
- command("execute @e[type=ArmorStand,name=cursor,score_stdInteger_min=1] ~ ~ ~ scoreboard players set arg stdInteger {0}".format(i));
- }
- callback();
- }
- function isCmd(string label, delegate callback)
- {
- async if("execute @e[type=ArmorStand,name=cursor] ~ ~ ~ testforblock ~ ~ ~ minecraft:wall_sign -1 {Text1:\\"\\\\\"{0}\\\\\"\\"}".format(label)) //"
- {
- callback();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement