Can i make a form open if some entity at the world have a tag from this values
const dropdownVal = [ "§eYallow", "§bLight bleu", "selections", "§l%color.black" ];```
But this values are in another form
This the cod to more understanding
```js
function UIMenu(player){
const form = new ActionFormData()
.title(`TP MENU`)
.body(` §a§l» TELEPOT ADDON «§r `)
.button("CREAT TP", "textures/creat")//0
.button("TP LIST", "textures/list")//1
.button("DETAILS", "textures/setting")//2
.button("Back\n§r§7§oClick here")//3
.show(player).then(result => {
if (result.selection === 0){ creat(player)
}
if (result.selection === 1){ spawn(player)
}
if (result.selection === 2,"i need the condition her"){
list(player)
}
if (result.selection === 3){//3
Menu(player)
}
})
}
function creat(player){
const dropdownVal = [ "§eYallow", "§bLight bleu", "selections", "§l%color.black" ];
const form = new ModalFormData()
.title("CREAT WAYPOINT")
.textField("WAYPOINT", "waypoint")
.dropdown(`waypoint`, dropdownVal, 0)
.show(player)
.then(result => {
const [ waypoint, dropdown ] = result.formValues
const getDropdown = dropdownVal[dropdown];
const entity = player.dimension.spawnEntity("sh:menu", player.location)
entity.nameTag = `${getDropdown} ${waypoint}`
entity.addTag(waypoint)
})
}```