been trying to fix this for the past couple days, its annoying and i have no idea what to do in order to fix it
basically, im trying to make a custom crafting system (kinda like in hypixel skyblock). I have a button that the player can press when the required recipe is met (basically when he put all the ingredients in for the item that he's trying to craft) upon pressing that button it should craft the item instantly, however sometimes you have to spam the button so it actually crafts the item. I have no clue what could cause this.
Code:
[doublepost=1661370579,1661351900][/doublepost]bump
[doublepost=1661431735][/doublepost]bump
[doublepost=1661520739][/doublepost]bump
basically, im trying to make a custom crafting system (kinda like in hypixel skyblock). I have a button that the player can press when the required recipe is met (basically when he put all the ingredients in for the item that he's trying to craft) upon pressing that button it should craft the item instantly, however sometimes you have to spam the button so it actually crafts the item. I have no clue what could cause this.
Code:
Code:
options:
farmingboots: leather boots named "&aFarming Boots" with lore "&7Health: &a+15 ||&7Speed &a+2 || ||&a&lUNCOMMON BOOTS || ||&7Current Enchants:" with hidden enchantments
enchantedwheat: wheat named "&aEnchanted Wheat" with lore "&a&lUNCOMMON ITEM" with hidden enchantments
#custom crafting
function openCrafting(p: player):
open virtual chest inventory with size 5 named "Crafting" to {_p}
set slot 0 of {_p}'s current inventory to white stained glass pane named " "
set slot 1 of {_p}'s current inventory to white stained glass pane named " "
set slot 2 of {_p}'s current inventory to white stained glass pane named " "
set slot 3 of {_p}'s current inventory to white stained glass pane named " "
set slot 4 of {_p}'s current inventory to white stained glass pane named " "
set slot 5 of {_p}'s current inventory to white stained glass pane named " "
set slot 6 of {_p}'s current inventory to white stained glass pane named " "
set slot 7 of {_p}'s current inventory to white stained glass pane named " "
set slot 8 of {_p}'s current inventory to white stained glass pane named " "
set slot 9 of {_p}'s current inventory to white stained glass pane named " "
set slot 10 of {_p}'s current inventory to white stained glass pane named " "
set slot 11 of {_p}'s current inventory to white stained glass pane named " "
set slot 15 of {_p}'s current inventory to white stained glass pane named " "
set slot 16 of {_p}'s current inventory to white stained glass pane named " "
set slot 17 of {_p}'s current inventory to white stained glass pane named " "
set slot 18 of {_p}'s current inventory to white stained glass pane named " "
set slot 19 of {_p}'s current inventory to white stained glass pane named " "
set slot 20 of {_p}'s current inventory to white stained glass pane named " "
set slot 24 of {_p}'s current inventory to white stained glass pane named " "
set slot 25 of {_p}'s current inventory to lime stained glass pane named "&aCraft"
set slot 26 of {_p}'s current inventory to white stained glass pane named " "
set slot 27 of {_p}'s current inventory to white stained glass pane named " "
set slot 28 of {_p}'s current inventory to white stained glass pane named " "
set slot 29 of {_p}'s current inventory to white stained glass pane named " "
set slot 33 of {_p}'s current inventory to white stained glass pane named " "
set slot 34 of {_p}'s current inventory to white stained glass pane named " "
set slot 35 of {_p}'s current inventory to white stained glass pane named " "
set slot 36 of {_p}'s current inventory to white stained glass pane named " "
set slot 37 of {_p}'s current inventory to white stained glass pane named " "
set slot 38 of {_p}'s current inventory to white stained glass pane named " "
set slot 39 of {_p}'s current inventory to white stained glass pane named " "
set slot 40 of {_p}'s current inventory to white stained glass pane named " "
set slot 41 of {_p}'s current inventory to white stained glass pane named " "
set slot 42 of {_p}'s current inventory to white stained glass pane named " "
set slot 43 of {_p}'s current inventory to white stained glass pane named " "
set slot 44 of {_p}'s current inventory to white stained glass pane named " "
command crafting:
trigger:
openCrafting(player)
function clearCraftingGrid(p: player):
#first row
set slot 12 of {_p}'s current inventory to air
set slot 13 of {_p}'s current inventory to air
set slot 14 of {_p}'s current inventory to air
#second row
set slot 21 of {_p}'s current inventory to air
set slot 22 of {_p}'s current inventory to air
set slot 23 of {_p}'s current inventory to air
#third row
set slot 30 of {_p}'s current inventory to air
set slot 31 of {_p}'s current inventory to air
set slot 32 of {_p}'s current inventory to air
on inventory click:
if inventory name of player's current inventory is "Crafting":
if name of clicked item is " ":
cancel event
if name of clicked item is "&aCraft":
cancel event
if slot 21 of current inventory of player is 64 {@enchantedwheat}:
if slot 23 of player's current inventory is 64 {@enchantedwheat}:
if slot 30 of player's current inventory is 64 {@enchantedwheat}:
if slot 32 of player's current inventory is 64 {@enchantedwheat}:
if slot 31 of player's current inventory is air:
wait 1 tick
clearCraftingGrid(player)
wait 1 tick
set slot 22 of player's current inventory to {@farmingboots}
[doublepost=1661431735][/doublepost]bump
[doublepost=1661520739][/doublepost]bump