novashop_handler: type: world debug: true events: after player clicks item_flagged:price in novashop_inventory: - define inventory - define price - define lore - define lore <[lore].remove[<[lore].size>]> - inventory set d:<[inventory]> slot:23 o:]> - adjust <[inventory]> title:<&e>]> - inventory set d:<[inventory]> slot:5 o:Price: <&e><[price]> ]>].with_flag[confirm:<[price]>]> - inventory set d:<[inventory]> slot:7 o:Add +1;lore=<&7>+<[price]> ]>]> - inventory set d:<[inventory]> slot:16 o:Add +8;lore=<&7>+<[price].mul[8]> ]>]> - inventory set d:<[inventory]> slot:25 o:Add +16;lore=<&7>+<[price].mul[16]> ]>]> - inventory set d:<[inventory]> slot:3 o:Remove +1;lore=<&7>-<[price]> ]>]> - inventory set d:<[inventory]> slot:12 o:Remove +8;lore=<&7>-<[price].mul[8]> ]>]> - inventory set d:<[inventory]> slot:21 o:Remove +16;lore=<&7>-<[price].mul[16]> ]>]> - inventory open d:<[inventory]> after player clicks item_flagged:plus in novashop_confirm_menu: - define amt - define quantity ].quantity> - define price ].flag[price.buy]> - if <[quantity].add[<[amt]>]> > 64: - define price <[price].mul[64]> - else: - define price <[price].mul[<[quantity].add[<[amt]>]>]> - define quantity <[quantity].add[<[amt]>]> - define item ]> - inventory set d: slot:5 o:Price: <&e><[price]> ]>].with_flag[confirm:<[price]>]> - inventory adjust d: slot:23 quantity:<[quantity]> after player clicks item_flagged:minus in novashop_confirm_menu: - define amt - define quantity ].quantity> - define price ].flag[price.buy]> - if <[quantity].sub[<[amt]>]> <= 1: - define quantity 1 - else: - define price <[price].mul[<[quantity].sub[<[amt]>]>]> - define quantity <[quantity].sub[<[amt]>]> - define item ]> - inventory set d: slot:5 o:Price: <&e><[price]> ]>].with_flag[confirm:<[price]>]> - inventory adjust d: slot:23 quantity:<[quantity]> after player clicks item_flagged:confirm in novashop_confirm_menu: - define price - if : - define quantity - else: - define quantity ].quantity> - define item ]> - define matchable <[item].script.name.if_null[<[item].material.name>]> - if < <[price]>: - narrate "<&c>You don't have enough money!" - playsound sound:block_note_block_bass - flag customquantity:! - inventory close - stop - if !].quantity[<[quantity]>]>: - narrate "<&c>Your inventory can't fit x<[quantity]> <[matchable]>!" - playsound sound:block_note_block_bass - flag customquantity:! - inventory close - stop - give <[matchable]> quantity:<[quantity]> - money take quantity:<[price]> - narrate "<&7>You've bought <&e>x<[quantity]> <[item].display.if_null[<[item].material.translated_name>]> <&7>for <&a><[price]> ]><&7>." - playsound sound:entity_experience_orb_pickup - define category ].flag[category]> - run novashop_pages def.page:1 def.category:<[category]> - flag customquantity:! # Make one flag that mentions the quantity and when they finish with confirm, unflag them. on player clicks custom_quantity in novashop_confirm_menu: - if : - flag ashop:->: - inventory close - wait 5t - execute as_op "forms open custom_quantity" - else: - define inventory - define price ].flag[price]> - define item - narrate <[item]> - define matchable <[item].script.name.if_null[<[item].material.name>]> - inventory set d:<[inventory]> slot:1 o:black_wool - inventory set d:<[inventory]> slot:2 o:<[item]> #- inventory set d:<[inventory]> slot:2 o: - inventory open d:novashop_java_custom_amt on player prepares anvil craft item: - if matches novashop_java_custom_amt: - inventory update - determine passively novashop_confirm_purchase