This Minecraft plugin, called Morevip, enables players to purchase VIP status within the game by clicking on a specific sign in the game world. The plugin utilizes two main third-party libraries: Vault for economy management and LuckPerms for player permissions management.
Description of Plugin Functionality:
- Configuration:
- The plugin loads its configuration from the config.yml file, which can contain settings such as the price for VIP status and the name of the VIP group.
- Dependencies:
- The plugin checks for the presence of two main dependencies: Vault and LuckPerms. If they are not present, the plugin automatically disables itself.
- Economy:
- It uses the Vault plugin to check and manage player balances.
- Permissions:
- It utilizes the LuckPerms plugin to assign players to the VIP group for a certain duration.
Main Features of the Plugin:
- Initialization:
- Upon enabling the plugin (onEnable), the configuration is loaded, and both the economy (Vault) and permission system (LuckPerms) are set up.
- If any dependencies are missing, the plugin shuts down and logs an error message.
- Player Interaction:
- The plugin listens for the PlayerInteractEvent, which detects when a player clicks on a block.
- If a player left-clicks on a sign with the text "VIPSHOP" and next line "buy", the plugin performs the following steps:
- It checks if the player has enough balance to purchase VIP status.
- If the player has enough money, it deducts the corresponding amount from their account.
- Using LuckPerms, it assigns the player to the VIP group for one month (30 days).
- It informs the player of a successful VIP purchase through a chat message.
- If the player doesn't have enough money, the plugin displays a message about the insufficient funds.
Technical Details:
- Configuration:
- The price for VIP and the name of the VIP group are loaded from the configuration file.
- Example configuration:
yaml
price: 1000.0
vip_group: vip
- Integration with LuckPerms:
- The plugin loads users using their UUID and assigns them a temporary node (Node) with the VIP group for one month.
- Integration with Vault:
- The plugin checks the player's balance and performs the deduction from their account.
This plugin provides players with a simple way to purchase VIP status directly in the game, automating the process without requiring intervention from server administrators.