#Pickaxe Shop

1 messages · Page 1 of 1 (latest)

exotic jetty
#

how can i do this?

fickle lion
exotic jetty
#

i want it to open a menu when you dont have the tag

#

that lets you but it

#

@fickle lion

#

thats the new one

fickle lion
# exotic jetty

you mean that if you don't have the tag it opens another menu for you?

#

.

fickle lion
exotic jetty
#

no i need to know how to make a shop menu??

#

@fickle lion

fickle lion
#
const shoplist =[
"MINEA",
"MINEB",
]

funtion shop(player){
const form = new ModalFormData()
.title('')
.dropdown('select Mine:',shoplist)
form.show(player).then(r => {
let [selectlist] = r.formValues

world.sendMessage(`Mine : ${selectlist}`)
})
exotic jetty
#

how do i make it take the money away and give them a tag?

exotic jetty
coral flint
exotic jetty
exotic jetty
#
const chain = (player) => {
    new ActionFormData()
        .title('§fChain Kits§r')
        .body('Buy your Chain kits!')
        .button(`§cChain Kit I\n§f[Click To See Details]`, `textures/items/chainmail_chestplate`)
        .button(`§cChain Kit II\n§f[Click To See Details]`, `textures/items/chainmail_chestplate`)
        .button(`§cChain Kit III\n§f[Click To See Details]`, `textures/items/chainmail_chestplate`)
        .button(`§cChain Kit IV\n§f[Click To See Details]`, `textures/items/chainmail_chestplate`)
        .button(`§cClose Menu`, `textures/ui/realms_red_x`)
        .show(player).then((result) => {
            if (result.selection == 0) return Buykit(player, 500, `Chain Kit I`, 300, 115, 311)
            if (result.selection == 1) return Buykit(player, 1000, `Chain Kit II`, 300, 115, 309)
            if (result.selection == 2) return Buykit(player, 2500, `Chain Kit III`, 300, 115, 307)
            if (result.selection == 3) return Buykit(player, 5000, `Chain Kit IV`, 300, 115, 305)
        });
}```
#
function BuyItem(player, singleCost, itemDisplay, itemid, idId) {

    let BuyItem = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .slider(`\n§f1x ${itemDisplay} = ${singleCost}\n\nSelect amount`, 1, 128, 1, 1)
    BuyItem.show(player).then(res => {
        let TotalCost = singleCost * res.formValues[0]
        console.warn(getScore(player, "Money"))
        if (getScore(player, `Money`) < TotalCost) {
            player.sendMessage(`§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`)
        }
        if (getScore(player, `Money`) >= TotalCost) {
            overworld.runCommandAsync(`give "${player.name}" ${itemid} ${res.formValues[0]} ${idId}`)
            overworld.runCommandAsync(`scoreboard players remove "${player.name}" Money ${TotalCost}`)
            player.sendMessage(`§7[§a!§7]§7:§a Purchased ${res.formValues[0]} ${itemDisplay} For $${TotalCost}`);
        }
    }
    )
}```
#

@coral flint

coral flint
#

So what are you confused about?

exotic jetty
#

making it give me a tag instead of a kit

#

because i havent done this in ages

exotic jetty
#

@coral flint

exotic jetty
#

okay

exotic jetty
#

@exotic jetty

#

ive got this but this shows when i click on any of them

#

there isnt one

#

thats for my own anticheat

#

form just does this

#

nope

#

wait i fixed it

#

my main form had a double close button binded and it wasnt doing anything

#
          "panel_name": {
            "type": "panel",
            "size": [ 30, 30 ],
            "bindings": [
              {
                "binding_type": "view",
                "source_control_name": "image",
                "resolve_sibling_scope": true,
                "source_property_name": "(not (#texture = ''))",
                "target_property_name": "#visible"
              }```
#

lol

#

i need help with making this a one time thing and not a slider

#

like make it just 1 time

#

instead of this

#

@exotic jetty

#

.toggle(`TOGGLE`, false)

#

if i use a toggle

#

can this be used as a true?

#

so if it is pressed it will purchase

#

@exotic jetty

#

okay

#

it says undefined

#

@exotic jetty

tranquil arrow
#

You need a getScore function

exotic jetty
#

i do?

tranquil arrow
#
export function getScore(player, scoreboardValue) {
    try {
        return world.scoreboard.getObjective(scoreboardValue).getScore(player.scoreboardIdentity)
    } catch {
        return 0
    }
}

its not the best but it works just add this to your code

#

hmm weird

#

wait let me check

exotic jetty
#
const getScore = (objective, target = true) => {
    try {
        const obj = world.scoreboard.getObjective(objective);
        if (typeof target == `string`) {
            return obj.getScore(obj.getParticipants().find(v => v.displayName == target));
        }
        return obj.getScore(target.scoreboardIdentity);
    } catch (e) {
    }
};```
tranquil arrow
#
.textfield(`TEXTFIELD`, "test")
```you have here a error
```js
.textField(`TEXTFIELD`, "test")
```change it to this
exotic jetty
#

im not using that anymore and i know

tranquil arrow
exotic jetty
#

no

#

i dont use textfield

tranquil arrow
#

send the code

#

let me see

exotic jetty
tranquil arrow
#

the code working fine

#

I think your getScore function is broken

#

I use this code to open the form maybe try with this

world.beforeEvents.playerInteractWithEntity.subscribe((data) => {
    let {target} = data
    if (target.typeId === "minecraft:npc") {
        system.run(() => {
            Mine(data.player)
        })
        data.cancel =true
    }
})
exotic jetty
#
    let Home = new ActionFormData()
        .title(`§1§2§3§r`)
        .button(`§bWarps\n§fUseful Warps!`, "textures/uitexture/rules")
        .button(`§9Mines\n§fMines Navigation!`, "textures/uitexture/rules")
        .button(`§cShop\n§fBuy Some Storage!`, "textures/uitexture/chest")

        .show(player).then((result) => {
            if (result.selection === 0) Warps(player);
            if (result.selection === 1) Mines(player);
            if (result.selection === 2) Mine(player);

        });
}```
tranquil arrow
#

Yeah Ik that you use something else to open the form but It was a info

#

and I also found some issue with your BuyItem function

exotic jetty
#

what?

tranquil arrow
#

for what is the toggle usefull

#
function BuyItem(player, singleCost, itemDisplay, itemid, idId) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE`, true);

    BuyItemForm.show(player).then(res => {
        let TotalCost = singleCost
        let money = getScore(player, "Money");
        
        if (money < TotalCost) {
            player.sendMessage(`§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            player.runCommandAsync(`give @s ${itemid} 1 ${idId}`);
            player.runCommandAsync(`scoreboard players remove @s money ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§7:§a Purchased ${itemDisplay} For $${TotalCost}`);
        }
    });
}
exotic jetty
#

to make sure they want to buy it..

tranquil arrow
#

oh ok than wait

#

function BuyItem(player, singleCost, itemDisplay, itemid, idId) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE, you sure?`, true);

    BuyItemForm.show(player).then(res => {
if (res.canceled) return
        let TotalCost = singleCost
        let money = getScore("Money", player);
        if (res.formValues[0] == false) return player.sendMessage("§cPressure canceled!")
        if ((money < TotalCost)) {
            player.sendMessage(`§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            player.runCommandAsync(`give @s ${itemid} 1 ${idId}`);
            player.runCommandAsync(`scoreboard players remove @s money ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§7:§a Purchased ${itemDisplay} For $${TotalCost}`);
        }
    });
}

#

here with the toggle

exotic jetty
#

alright

tranquil arrow
exotic jetty
#

okay

#

how do i give them a tag instead of a item? @tranquil arrow

tranquil arrow
#

player.addTag("here the tag")

#

and if you want remove
player.removeTag("here the tag")

exotic jetty
#

but that would add the same tag for all of them.

tranquil arrow
#

do you mean like this?

player.addTag(`${itemDisplay}`)
exotic jetty
#

huh

#

if (response.selection == 0) return BuyItem(player, 200, `Mine B`, `minecraft:totem_of_undying`, 0)

#

instead of the minecraft:totem_of_undying can it be a tag?

tranquil arrow
#

yes

exotic jetty
#

how?

tranquil arrow
#

just write the name of the tag and than in the BuyItem function remove the give item thing and add ```js
player.addTag(${itemDisplay)

exotic jetty
#

i dont understand this tho

tranquil arrow
#

like this

function BuyItem(player, singleCost, itemDisplay, tag) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE, you sure?`, true);

    BuyItemForm.show(player).then(res => {
        if (res.canceled) return
        let TotalCost = singleCost
        let money = getScore("Money", player);
        if (res.formValues[0] == false) return player.sendMessage("§cPressure canceled!")
        if (money < TotalCost) {
            player.sendMessage(`§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            player.addTag(`${tag}`)
            player.runCommandAsync(`scoreboard players remove @s money ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§7:§a Purchased ${itemDisplay} For $${TotalCost}`);
        }
    });
}
exotic jetty
#

so i remove the totem?

tranquil arrow
#

and the usage

BuyItem(player, 200, `Mine B`, "mine_b")
exotic jetty
#

if (response.selection == 0) return BuyItem(player, 200, `Mine B`, `minecraft:totem_of_undying`, 0)

#

okay

#

wait so is my ${itemDisplay} mine_b now?

tranquil arrow
tranquil arrow
exotic jetty
#

oh okay

tranquil arrow
#

and ${tag} is the tag name

exotic jetty
#

okay

#

@tranquil arrow

tranquil arrow
exotic jetty
#

yws..

tranquil arrow
#

wait send the code

exotic jetty
#

this isnt defined

#
  let BuyItemForm = new ModalFormData()
    .title(`§8Buy ${itemDisplay}`)
    .toggle(`TOGGLE, Are you sure?`, true);

  BuyItemForm.show(player).then((res) => {
    if (res.canceled) return;
    let TotalCost = singleCost;
    let Money = getScore("Money", player);
    if (res.formValues[0] == false)
      return player.sendMessage("§cPressure canceled!");
    if (Money < TotalCost) {
      player.sendMessage(
        `§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`
      );
    } else {
      player.addTag(`${tag}`)
      player.runCommandAsync(`scoreboard players remove @s Money ${TotalCost}`);
      player.sendMessage(
        `§7[§a!§7]§7:§a Purchased ${itemDisplay} For $${TotalCost}`
      );
    }
  });
}```
tranquil arrow
#

no you didn't use the function what I send

exotic jetty
#

i did

tranquil arrow
#

function BuyItem(player, singleCost, itemDisplay, itemid, idId) its not the same as function BuyItem(player, singleCost, itemDisplay, tag)

exotic jetty
#

wait nvm

#

thank you

tranquil arrow
#

Your welcome

exotic jetty
tranquil arrow
#

@exotic jetty

exotic jetty
#
function BuyItem(player, singleCost, itemDisplay, tag, tag2) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE, Are you sure?`, true);

    BuyItemForm.show(player).then(res => {
        if (res.canceled) return
        let TotalCost = singleCost
        let MONEY = getScore("MONEY", player);
        if (res.formValues[0] == false) return player.sendMessage("§cPressure canceled!")
        if (MONEY < TotalCost) {
            player.sendMessage(`§7[§c!§7]§7: §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            player.addTag(`${tag}`)
            player.addTag(`${tag2}`)
            player.runCommandAsync(`scoreboard players remove @s MONEY ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§7:§a Purchased ${itemDisplay} For $${TotalCost}`);
        }
    });
}```
tranquil arrow
#

I made a list in the Mine function

tranquil arrow
#

this is what you wanted

exotic jetty
#

okay

exotic jetty
#

@tranquil arrow

#

this is what i had before tho

#

so how does the tags work with eachother?

tranquil arrow
exotic jetty
#

how do they work with eachother?

#

because thats the tags they need

tranquil arrow
#

in the list there is a category called tag: and in there change the tags to yours

exotic jetty
#

huh?

#

i dont understand what you mean

tranquil arrow
#

use this function

#

and this

function BuyItem(player, singleCost, itemDisplay, tag, requiredMineTag) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE, are you sure?`, true);

    BuyItemForm.show(player).then(res => {
        if (res.canceled) return;
        let TotalCost = singleCost;
        let money = getScore("Money", player);
        if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
        if (money < TotalCost) {
            player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            if (requiredMineTag && !player.hasTag(requiredMineTag)) {
                return player.sendMessage(`§7[§c!§7]§c You need to purchase Mine ${requiredMineTag?.substring(1)} first.`);
            }
            player.addTag(`${tag}`);
            player.runCommandAsync(`scoreboard players remove @s money ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
        }
    });
}
exotic jetty
#

okay

#

but then mine is not defined

tranquil arrow
exotic jetty
#

no..

tranquil arrow
#

than It should work

exotic jetty
#
    let Home = new ActionFormData()
        .title(`§1§2§3§r`)
        .button(`§bWarps\n§fUseful Warps!`, "textures/uitexture/rules")
        .button(`§9Mines\n§fMines Navigation!`, "textures/uitexture/rules")
        .button(`§cShop\n§fBuy Your Choice Of Mines Or Pickaxes!`, "textures/uitexture/chest")

        .show(player).then((result) => {
            if (result.selection === 0) Warps(player);
            if (result.selection === 1) Mines(player);
            if (result.selection === 2) MineShop(player);

        });
}```
tranquil arrow
exotic jetty
#

i have that

tranquil arrow
#

send a ss of your code that you use

exotic jetty
#

it works

tranquil arrow
#

Bc you named the function Mines and not Mine

exotic jetty
#

it works

tranquil arrow
#

oh nvm wait

exotic jetty
#

but i dont know ifd it gives me both tags

#

idk

tranquil arrow
exotic jetty
#

huh

tranquil arrow
#

for example

I buy mine b and than I buy mine c I have both tags

#

BB and CC

exotic jetty
#

i want it to give two tags BB & B

tranquil arrow
#

oh

exotic jetty
#

and CC & C

#

and so on

tranquil arrow
#

why did you not tell me that

exotic jetty
#

i thought it was clear..

tranquil arrow
#

no I didn't know

exotic jetty
#

if (response.selection == 24) return BuyItem(player, 20000000, `Mine Z`, `ZZ`, `Z`)

tranquil arrow
#

wait

exotic jetty
#

this before

#

with the two tags

tranquil arrow
#

here now

function BuyItem(player, singleCost, itemDisplay, tag, requiredMineTag) {
    let BuyItemForm = new ModalFormData()
        .title(`§8Buy ${itemDisplay}`)
        .toggle(`TOGGLE, are you sure?`, true);

    BuyItemForm.show(player).then(res => {
        if (res.canceled) return;
        let TotalCost = singleCost;
        let money = getScore("money", player);
        if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
        if (money < TotalCost) {
            player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        } else {
            if (requiredMineTag && !player.hasTag(requiredMineTag)) {
                return player.sendMessage(`§7[§c!§7]§c You need to purchase Mine ${requiredMineTag?.substring(1)} first.`);
            }
            if (player.hasTag(tag)) return player.sendMessage(`§7[§c!§7]§c You already buyed this Mine.`);
            player.addTag(`${tag}`);
            player.addTag(`${tag.substring(1)}`);
            player.runCommandAsync(`scoreboard players remove @s money ${TotalCost}`); 
            player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
        }
    });
}
tranquil arrow
tranquil arrow
exotic jetty
heavy canyon
#

💀

exotic jetty
tranquil arrow
exotic jetty
tranquil arrow
#

bruh Idk what script do you use bc for me its working fine

exotic jetty
#

it gives two tags?

tranquil arrow
#

yes

#

BB and B ..

exotic jetty
#

bro what

#

this doesnt give two tags thopugh

#

this is just one

tranquil arrow
tranquil arrow
# exotic jetty

its does I made it like it give BB and than its remove one B and give the tag

#

here like this

            player.addTag(`${tag}`); //give BB
            player.addTag(`${tag.substring(1)}`); //give B
exotic jetty
#

i have that

tranquil arrow
#

yeah than It should work

exotic jetty
#

it doesnt

tranquil arrow
#

for me its working

exotic jetty
#

okay wait

#

it works

#

thank you.

tranquil arrow
#

👍🏽

exotic jetty
#

@tranquil arrow

#

if (result.selection === 1) player.addTag(`BB`)

#

how do i make it that you have to have a tag to give a tag?

tranquil arrow
#

if (player.hasTag("idk") {
player.addTag("idk2")
}

exotic jetty
#

okay thank you

exotic jetty
#
    new ChestFormData('9')
        .title('§l§bPickaxe Shop')
        .button(0, '§l§4Back', ['', '§r§cGo Back A Page!'], 'textures/icons/Back')
        .button(2, '§r§dTier I Pickaxe', ['', 'Unbreaking I', 'Efficiency I'], 'minecraft:iron_pickaxe', 1, true)
        .button(3, '§r§dTier II Pickaxe', ['', 'Unbreaking I', 'Efficiency II'], 'minecraft:iron_pickaxe', 1, true)
        .button(4, '§r§dTier II Pickaxe', ['', 'Unbreaking I', 'Efficiency III'], 'minecraft:iron_pickaxe', 1, true)
        .button(5, '§r§dTier IV Pickaxe', ['', 'Unbreaking II', 'Efficiency IV'], 'minecraft:iron_pickaxe', 1, true)
        .button(6, '§r§dTier V Pickaxe', ['', 'Unbreaking II', 'Efficiency V'], 'minecraft:iron_pickaxe', 1, true)
        .button(8, '§l§bNext', ['', '§r§9Go To The Next Page!'], 'textures/icons/Next')
        .show(player).then(response => {
            if (response.selection === 0) return (player);
            if (response.selection === 2) return (player);
            if (response.selection === 3) return (player);
            if (response.selection === 4) return (player);
            if (response.selection === 5) return (player);
            if (response.selection === 6) return (player);
            if (response.selection === 8) return (player);
            if (response.canceled) return;
            world.sendMessage(`${player.name} has chosen item ${response.selection}`);
            secondarymenu(player);
        })
};```
#

i have this for my chest form

exotic jetty
#

is there anyway to do this

#

Pickaxe Shop

runic imp
#

if you mean the 9 slots then you have modify the json ui

#

I wonder it was made for images to be dropped it

#

nope

#

it does support 9 so idk what you mean by this

runic imp
exotic jetty
#

thats from my mine shoip

#

wym?

#

okay

#

okay

#

doesnt work

#

yes

#

i have

#

no

#

okay

#

what should i return?

#

if (money >= 200 && response.selection === 2) return player.runCommandAsync(`structure load ${pickaxe}`);

#

how do i make the ${pickaxe} be defined?

heavy canyon
exotic jetty
#

i do know js

heavy canyon
#

no you do not

exotic jetty
#

and im trying to define a structure that loads.

heavy canyon
#

well pickaxe is an argument from the function BuyPick

#

you pass through the name of the structure

exotic jetty
#

yes

exotic jetty
#

yeah

#

its when i add this

#

Itemshop.button(4, `§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`);

#

the 4,

exotic jetty
#

okay but this isnt useful when it doesnt even work

#

okay

#

huh

heavy canyon
#

"i know js"

exotic jetty
#

okay

exotic jetty
#

it works but i only have one button

#
function BuyPick(player, singleCost, itemDisplay, pickaxe) {
    let BuyItemForm = new ModalFormData()
        .title(`§f${itemDisplay}`)
        .textField(`§fPurchase §a${itemDisplay} §eare you sure§f?\n`, '§oType Confirm...')
        .toggle(``, true);
    BuyItemForm.show(player).then(res => {
        if (res.canceled) return;
        let TotalCost = singleCost;
        let MONEY = getScore("MONEY", player);
        if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
        if (MONEY < TotalCost) {
            player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        }
            player.runCommandAsync(`scoreboard players remove @s MONEY ${TotalCost}`);
            player.runCommandAsync(`structure load ${pickaxe} ~ ~ ~`); 
            player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
        }
    )};


function PickShop(player) {
    let Picks = [
        { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
        { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
        { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
        { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
        { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },


    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");

    Picks.forEach((Pick) => {
        Itemshop.button(`§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`);
    });

    Itemshop.show(player).then(response => {
        let selectedPick = Picks[response.selection];
        if (selectedPick) {
            BuyPick(player, selectedPick.cost, selectedPick.name, selectedPick.pickaxe);
        }
    });
}```
heavy canyon
exotic jetty
#

is it not?

#

now when I press that one and only button it does this..

#

and it workd

heavy canyon
#

no minecraft version has chestformdata which is what he asked

#

there are addons for it but thats not what he asked

exotic jetty
#

yes i know

runic imp
#

And check and charge a scoreboard and give the item

runic imp
#

the latter stuff I presume?

exotic jetty
#

i want it to show all five of these { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" }, { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" }, { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" }, { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" }, { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },

#

but instead it shows 1 and its the 5th one

runic imp
#

i would be the slot

#

it defaults to first one I think that is why its the last in the array that shows

exotic jetty
#

yeah

runic imp
#

for it to look like above i + 2 should do it

exotic jetty
#

thats what i have

exotic jetty
runic imp
# exotic jetty .
let Picks = [
        { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
        { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
        { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
        { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
        { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
];
Picks.forEach((Pick,i) => {
        Itemshop.button(i+2,`§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`, 'minecraft:iron_pickaxe');
    });```
exotic jetty
#
  let Picks = [
    { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
    { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
    { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
    { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
    { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
  ];
  let Itemshop = new ActionFormData().title("§bPicks");
  Picks.forEach((Pick, i) => {
    Itemshop.button(
      i + 2,
      `§b${Pick.name}\n§a$${Pick.cost}`,
      `${Pick.name}`,
      "minecraft:iron_pickaxe"
    );
  });

  Itemshop.show(player).then((response) => {
    let selectedPick = Picks[response.selection];
    if (selectedPick) {
      BuyPick(
        player,
        selectedPick.cost,
        selectedPick.name,
        selectedPick.pickaxe
      );
    }
  });
}```
exotic jetty
#

@runic imp

runic imp
exotic jetty
#

yes

#

but im trying to see if that would work too

#
        let Picks = [
            { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
            { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
            { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
            { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
            { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");
    Picks.forEach((Pick,i) => {
            Itemshop.button(i+2,`§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`, 'minecraft:iron_pickaxe');
        });
      
        Itemshop.show(player).then((response) => {
          let selectedPick = Picks[response.selection];
          if (selectedPick) {
            BuyPick(
              player,
              selectedPick.cost,
              selectedPick.name,
              selectedPick.pickaxe
            );
          }
        });
      }```
#

this error

exotic jetty
exotic jetty
#
function BuyPick(player, singleCost, itemDisplay, pickaxe) {
    let BuyItemForm = new ModalFormData()
        .title(`§f${itemDisplay}`)
        .textField(`§fPurchase §a${itemDisplay} §eare you sure§f?\n`, '§oType Confirm...')
        .toggle(``, true);
    BuyItemForm.show(player).then(res => {
        if (res.canceled) return;
        let TotalCost = singleCost;
        let MONEY = getScore("MONEY", player);
        if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
        if (MONEY < TotalCost) {
            player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        }
            player.runCommandAsync(`scoreboard players remove @s MONEY ${TotalCost}`);
            player.runCommandAsync(`structure load ${pickaxe} ~ ~ ~`); 
            player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
        }
    )};


    function PickShop(player) {
        let Picks = [
            { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
            { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
            { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
            { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
            { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");
    Picks.forEach((Pick,i) => {
            Itemshop.button(i+2,`§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`, 'minecraft:iron_pickaxe');
        });
      
        Itemshop.show(player).then((response) => {
          let selectedPick = Picks[response.selection];
          if (selectedPick) {
            BuyPick(
              player,
              selectedPick.cost,
              selectedPick.name,
              selectedPick.pickaxe
            );
          }
        });
      }```
runic imp
#
function BuyPick(player, singleCost, itemDisplay, pickaxe) {
    let BuyItemForm = new ModalFormData()
        .title(`§f${itemDisplay}`)
        .textField(`§fPurchase §a${itemDisplay} §eare you sure§f?\n`, '§oType Confirm...')
        .toggle(``, true);
    BuyItemForm.show(player).then(res => {
        if (res.canceled) return;
        let TotalCost = singleCost;
        let MONEY = getScore("MONEY", player);
        if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
        if (MONEY < TotalCost) {
            player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
        }
        player.runCommandAsync(`scoreboard players remove @s MONEY ${TotalCost}`);
        player.runCommandAsync(`structure load ${pickaxe} ~ ~ ~`);
        player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
    }).catch(error => console.warn(error, error.stack));
};


function PickShop(player) {
    let Picks = [
        { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
        { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
        { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
        { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
        { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");
    Picks.forEach((Pick, i) => {
        Itemshop.button(i + 2, `§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`, 'minecraft:iron_pickaxe');
    });

    Itemshop.show(player).then((response) => {
        let selectedPick = Picks[response.selection];
        if (selectedPick) {
            BuyPick(
                player,
                selectedPick.cost,
                selectedPick.name,
                selectedPick.pickaxe
            );
        }
    }).catch(error => console.warn(error, error.stack));
}```
runic imp
exotic jetty
exotic jetty
runic imp
exotic jetty
#

no

exotic jetty
runic imp
#

looks like that

exotic jetty
#

no

runic imp
# exotic jetty no
function BuyPick(player, singleCost, itemDisplay, pickaxe) {
    let BuyItemForm = new ModalFormData()
        .title(`§f${itemDisplay}`)
        .textField(`§fPurchase §a${itemDisplay} §eare you sure§f?\n`, '§oType Confirm...')
        .toggle(``, true);
    BuyItemForm.show(player).then(res => {
        try {
            if (res.canceled) return;
            let TotalCost = singleCost;
            let MONEY = getScore("MONEY", player);
            if (res.formValues[0] == false) return player.sendMessage("§7[§c!§7]§c Purchase canceled!");
            if (MONEY < TotalCost) {
                player.sendMessage(`§7[§c!§7] §cYou cannot afford this! You need §f$${TotalCost}§c.`);
            }
            player.runCommandAsync(`scoreboard players remove @s MONEY ${TotalCost}`);
            player.runCommandAsync(`structure load ${pickaxe} ~ ~ ~`);
            player.sendMessage(`§7[§a!§7]§a Purchased ${itemDisplay} for $${TotalCost}`);
        } catch (error) {
            console.warn(error, error.stack);
        }
    });
};
#
function PickShop(player) {
    let Picks = [
        { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
        { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
        { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
        { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
        { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");
    Picks.forEach((Pick, i) => {
        Itemshop.button(i + 2, `§b${Pick.name}\n§a$${Pick.cost}`, `${Pick.name}`, 'minecraft:iron_pickaxe');
    });

    Itemshop.show(player).then((response) => {
        try {
            let selectedPick = Picks[response.selection];
            if (selectedPick) {
                BuyPick(
                    player,
                    selectedPick.cost,
                    selectedPick.name,
                    selectedPick.pickaxe
                );
            }
        } catch (error) {
            console.warn(error, error.stack);
        }
    });
}```
exotic jetty
runic imp
# exotic jetty

I wish they would stack traces back to errors in promise functions.

#

try catch all code in .then callbacks and asynchronous functions

runic imp
exotic jetty
runic imp
maiden shellBOT
#
Debug Result

There are 20 errors in this [code](#1218227466255077527 message):

message.js(3,23): Cannot find module './extensions/forms.js' or its corresponding type declarations.
message.js(8,3): 'obj' is possibly 'undefined'.
message.js(8,6): Argument of type 'boolean' is not assignable to parameter of type 'string | Entity | ScoreboardIdentity'.
message.js(35,5): 'error' is of type 'unknown'.
message.js(54,5): 'error' is of type 'unknown'.
message.js(71,5): 'error' is of type 'unknown'.
message.js(162,5): 'error' is of type 'unknown'.
message.js(187,5): 'error' is of type 'unknown'.
message.js(194,38): Object is possibly 'undefined'.
message.js(212,12): Cannot find name 'PickaxeShop3'. Did you mean 'PickaxeShop'?
message.js(214,5): 'error' is of type 'unknown'.
message.js(229,14): 'res.formValues' is possibly 'undefined'.
message.js(230,5): 'MONEY' is possibly 'undefined'.
message.js(237,5): 'error' is of type 'unknown'.
message.js(268,5): 'error' is of type 'unknown'.
message.js(285,14): 'res.formValues' is possibly 'undefined'.
message.js(286,5): 'MONEY' is possibly 'undefined'.
message.js(300,5): 'error' is of type 'unknown'.
message.js(343,18): Type 'undefined' cannot be used as an index type.
message.js(348,5): 'error' is of type 'unknown'.
runic imp
#
    try {
        const obj = world.scoreboard.getObjective(objective);
        return obj.getScore(target);
    } catch (e) {
    }
};```
you dont need to search for the identity anymore
#

its probably PickaxeShop3 not existing

exotic jetty
runic imp
exotic jetty
#

but im not calling an unexistent function

runic imp
fervent flare
#

🤔

runic imp
exotic jetty
#
(((ID + (ID < 256 ? 0 : number_of_1_16_100_items)) * 65536) + (!!enchanted * 32768)) || texture```
runic imp
# exotic jetty ```js (((ID + (ID < 256 ? 0 : number_of_1_16_100_items)) * 65536) + (!!enchanted...
function PickShop(player) {
    let Picks = [
        { name: "§r§dTier I Pickaxe", cost: 200, pickaxe: "tierIpickaxe" },
        { name: "§r§dTier II Pickaxe", cost: 500, pickaxe: "tierIIpickaxe" },
        { name: "§r§dTier III Pickaxe", cost: 1000, pickaxe: "tierIIIpickaxe" },
        { name: "§r§dTier IV Pickaxe", cost: 2500, pickaxe: "tierIVpickaxe" },
        { name: "§r§dTier V Pickaxe", cost: 5000, pickaxe: "tierVpickaxe" },
    ];
    let Itemshop = new ChestFormData('9').title("§bPicks");
    Picks.forEach((Pick, i) => {
        Itemshop.button(i + 2, `§b${Pick.name}`, [`§a$${Pick.cost}`], 'minecraft:iron_pickaxe');
    });

    Itemshop.show(player).then((response) => {
        try {
            let selectedPick = Picks[response.selection];
            if (selectedPick) {
                BuyPick(
                    player,
                    selectedPick.cost,
                    selectedPick.name,
                    selectedPick.pickaxe
                );
            }
        } catch (error) {
            console.warn(error, error.stack);
        }
    });
}```
item description has to be an array
exotic jetty
#

okay

exotic jetty
maiden shellBOT
#
Debug Result

There are 3 errors in this [code](#1218227466255077527 message):

<repl>.js:9:24 - error TS2304: Cannot find name 'ChestFormData'.

9     let Itemshop = new ChestFormData('9').title("§bPicks");
                         ~~~~~~~~~~~~~

``````ansi
<repl>.js:18:17 - error TS2304: Cannot find name 'BuyPick'.

18                 BuyPick(
                   ~~~~~~~

``````ansi
<repl>.js:26:33 - error TS18046: 'error' is of type 'unknown'.

26             console.warn(error, error.stack);
                                   ~~~~~

minor lodge
#

yup there is NO ChestFormData from server-ui

#

even if it is, the item placement is "slot" not button

runic imp
exotic jetty
#

when i click tier I it opens 3?

#

ohh i found out why