Hi, i have made a mod that is kinda like Sync by iChun, i almost got everything working (everyclone has their own health, hunger, exp, and inventory) i added a multi clone support, so now i wanted to make an interface that generates a button everytime a clone has spawn, so when the user opened the interface it will show a button for every clone so here's some of my code:
//i have a custom function for addings tags for custom mobs, so here it detects if a new clone is added and it will add it to the allClones array
//i tried this, i obvs know what's wrong just wanted to know how to do it correctly
test = i + i
dummyname.splice(dummyname.length, 0, test);
test = (buttoncode);
test.(buttoncodelistener);
{
currentClone = i
clientMessage("Clone #" + currentClone + "has been selected");
}
test.setText("Clone #" + test);
}
};
The currentClonr will be undefine because obvs the value would be "i" instead of the return value of i during the loop (the UUID of the mob) if you get the idea pls help me
Hi, i have made a mod that is kinda like Sync by iChun, i almost got everything working (everyclone has their own health, hunger, exp, and inventory) i added a multi clone support, so now i wanted to make an interface that generates a button everytime a clone has spawn, so when the user opened the interface it will show a button for every clone so here's some of my code:
var currentClone;
var dummyname = [];
var allClones = [];
//this is the selected clone
for(let i of Entity.getAll()){
if(iData.getProperty(i + "_status", "isClone")==true){
allClones.splice(allClones.length, 0, i);
//i have a custom function for addings tags for custom mobs, so here it detects if a new clone is added and it will add it to the allClones array
//i tried this, i obvs know what's wrong just wanted to know how to do it correctly
test = i + i
dummyname.splice(dummyname.length, 0, test);
test = (buttoncode);
test.(buttoncodelistener);
{
currentClone = i
clientMessage("Clone #" + currentClone + "has been selected");
}
test.setText("Clone #" + test);
}
};
The currentClonr will be undefine because obvs the value would be "i" instead of the return value of i during the loop (the UUID of the mob) if you get the idea pls help me
Sorry for my terrible English
GUI?