Packages and commands

To create a package you will need to go to the "Packages" section in the Buycraft control panel. From there you will be able to create packages and categories and view your existing content. 
On the package edit page, you can change all the settings relating to that package. Further down the page, you will see the settings for the package and then you will find the commands section.
Buycraft uses plugin commands to define what a player will receive after purchasing the package. It can be a collection of default Minecraft commands or plugin commands.  Commands are then executed on the server when a player purchases the package.

Commands execute on your server in the order that they appear in the control panel. You can drag the commands to the order which you would like them to execute.

You can also find more advanced settings for each command from the popup after clicking the blue edit button like specific servers, require online/offline, delay and repeat commands.

Command types

There are a few different types of commands which will execute based on the status of a payment. For types other than Initial and Expiry, make sure that you have the IPN/Pingback/Webhooks set up for the gateway you are using, otherwise, your webstore might not get the notification to change the status of the payment or execute these commands. You can find the setup guides for those in the gateway guides  HERE.

Initial commands

Initial commands will execute when the player first purchases the package. An example would be to give the player a Diamond pickaxe - to do this you would enter the command "give {name} 279 1". The {name} variable will replace the variable with the players Minecraft username. You can also use {uuid} which will replace the variable with the UUID of the player who has purchased.

Expiry commands

Expiry commands will be executed after the period you set on your package edit page. An example of this would be removing permissions from a player after their package has expired. These commands are also executed when a player cancels their subscription.

Renewal commands

Renewal commands are executed when the player is charged for a renewal of their subscription. 

Chargeback commands

These commands will be executed if a player opens a dispute or a chargeback on the payment. An example of this type of command would be to banning the user if they perform a chargeback.

Refund commands

These commands will be executed if you refund a customer. This could be used to remove the package from their account.

Command variables

  • {name} - The customers Minecraft username.
  • {uuid} - The UUID of the player.
  • {transaction} - The transaction ID of the payment.
  • {price} - The amount paid.
  • {currency} - The currency of the payment.
  • {time} - The time of purchase, e.g. 15:30.
  • {date} - The date of purchase, e.g. 01/01/2012.
  • {email} - The email address of the customer.
  • {ip} - The IP address of the customer.
  • {packageId} - The ID of the package.
  • {packagePrice} - The price of the package.
  • {packageExpiry} - The expiry length of the package (days).
  • {packageName} - The name of the package.
  • {purchaserName} - The name of the player who purchased a gift package. 
  • {purchaserUuid} - The UUID of the player who purchased a gift package.
For more details on custom variables see our  Variables article.

Still need help? Contact Us Contact Us