Load Prices: type: world debug: false events: on server start: - if { - yaml load:/prices.yml id:prices - announce to_console "<&a>Loaded existing price list!" } else { - yaml create id:prices - foreach { - if == null { - foreach next } - yaml set ".current:1" id:prices - yaml set ".min:0" id:prices - yaml set ".max:2" id:prices } - yaml savefile:/prices.yml id:prices - announce to_console "<&a>Generated new Price list!" } SetPrice_Command: type: command debug: false name: setprice usage: /setprice (item) description: Set the price of the item specified, or item in hand. permission: prices.sets tab complete: - if queue clear - choose : - case 0: - determine - case 1: - determine ]> script: - if { - narrate "<&c>Prices are not loaded!" - queue clear } - if == 1 { - define Item - if == air { - narrate "<&c>Cannot set a price on air!" - queue clear } - define Cost - if == null { - narrate "<&c>Cost must be a number!" - queue clear } - yaml set : id:prices - yaml savefile:/prices.yml id:prices } else if == 2 { - define Item - if == null { - narrate "<&c>That's not a real item!" - queue clear } - define Item - if == air { - narrate "<&c>Cannot set a price on air!" - queue clear } - define Cost - if == null { - narrate "<&c>Cost must be a number!" - queue clear } - yaml set : id:prices - yaml savefile:/prices.yml id:prices } else { - narrate "<&6>Proper Syntax is:" - narrate "<&6>/setprice cost (e.g. /setprice 5) to set price of item in hand." - narrate "<&6>/setprice item cost (e.g. /setprice stone 5) to set the price of the item specified." } GetPrice Command: type: command name: getprice usage: /getprice description: Get the price of the item specified, or item in hand. permission: prices.get tab complete: - if queue clear - choose : - case 0: - determine - case 1: - determine ]> script: - if { - narrate "<&c>Prices are not loaded!" - queue clear } - if == 0 { - define Item - if == air { - narrate "<&c>Air does not have a price!" - queue clear } - narrate "<&6>The price of <&f> <&6>is <&f>.current]><&6>." } else if == 1 { - define Item - if == null { - narrate "<&c>That's not a real item!" - queue clear } - define Item - if == air { - narrate "<&c>Air does not have a price!" - queue clear } - narrate "<&6>The price of <&f> <&6>is <&f>.current]><&6>." }