### Example Reward File Content Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/reward-system A complete example of a reward file named 'MyCustomReward.yml' that grants a diamond, money, experience, and executes a command. ```yaml # plugins/VotingPlugin/Rewards/MyCustomReward.yml Items: Diamond: Material: 'DIAMOND' Amount: 1 Money: 5 EXP: 100 Commands: - 'say %player% was lucky' ``` -------------------------------- ### VotingPlugin Integration Example Source: https://context7.com/bencodez/votingplugin/llms.txt Demonstrates how to get plugin instances, access user data, interact with vote sites, and add custom rewards using the VotingPlugin API. ```java import com.bencodez.votingplugin.VotingPluginHooks; import com.bencodez.votingplugin.VotingPluginMain; import com.bencodez.votingplugin.user.VotingPluginUser; import com.bencodez.votingplugin.user.UserManager; import com.bencodez.votingplugin.objects.VoteSite; import com.bencodez.advancedcore.api.rewards.injected.RewardInject; import org.bukkit.Bukkit; import org.bukkit.entity.Player; public class VotingPluginIntegration { public void example() { // Get plugin instance VotingPluginMain plugin = (VotingPluginMain) Bukkit.getPluginManager() .getPlugin("VotingPlugin"); // Or use hooks VotingPluginHooks hooks = VotingPluginHooks.getInstance(); VotingPluginMain main = hooks.getMainClass(); UserManager userManager = hooks.getUserManager(); // Get user by various methods Player player = Bukkit.getPlayer("Steve"); VotingPluginUser userByPlayer = userManager.getVotingPluginUser(player); VotingPluginUser userByName = userManager.getVotingPluginUser("Steve"); VotingPluginUser userByUUID = userManager.getVotingPluginUser(player.getUniqueId()); // Work with user data int points = userByPlayer.getPoints(); userByPlayer.setPoints(100); userByPlayer.addPoints(50); userByPlayer.removePoints(25); int allTimeTotal = userByPlayer.getAllTimeTotal(); int monthlyTotal = userByPlayer.getMonthTotal(); int weeklyTotal = userByPlayer.getWeeklyTotal(); int dailyTotal = userByPlayer.getDailyTotal(); // Work with vote sites VoteSite site = plugin.getVoteSite("MinecraftServers"); if (site != null) { site.giveRewards(userByPlayer); boolean canVote = site.canVote(userByPlayer); long nextVoteTime = site.getNextVoteTime(userByPlayer); } // Trigger background update for offline rewards hooks.backgroundUpdate(player); // Add custom reward type hooks.addCustomReward(new RewardInject("MyCustomReward") { @Override public void onReward(Player player, String rewardName, ConfigurationSection section) { String customValue = section.getString("CustomValue", "default"); // Execute custom reward logic player.sendMessage("Custom reward: " + customValue); } }); } } ``` -------------------------------- ### Rewards Configuration Example Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteReminders Define rewards to be given when a reminder fires. This example sends a player message. Standard VotingPlugin reward placeholders are supported. ```yml Rewards: Messages: Player: "&aYou can vote now!" ``` -------------------------------- ### Reward File Example with AdvancedPriority Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/AdvancedPriority-Rewards An example of defining AdvancedPriority rewards in a separate YAML file (e.g., MyReward.yml) within the AdvancedCore/Rewards folder. This allows referencing rewards by file name from other plugins. ```yaml # MyReward.yml Rewards: AdvancedPriority: VIPReward: RequirePermission: true Permission: 'server.vip' Items: Diamond: Material: DIAMOND Amount: 3 NormalReward: Money: 50 ``` -------------------------------- ### Confirmation Menu Setup Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Enables a confirmation prompt before a player can purchase an item. The 'ShopConfirmPurchase' section configures the title and items for the confirmation GUI. ```yaml RequireConfirmation: true ``` ```yaml ShopConfirmPurchase: Title: Confirm Purchase? YesItem: Material: EMERALD_BLOCK Name: '&aYes' NoItem: Material: BARRIER Name: '&cNo' ``` -------------------------------- ### Reminder Conditions Example Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteReminders Specify conditions that must be met for a reminder to fire. This example requires the player to be able to vote on at least one site and have a minimum online time. ```yml Conditions: CanVoteAny: true MinOnlineTime: 2m ``` -------------------------------- ### Configure Proxy Setup (BungeeCord/Velocity) Source: https://context7.com/bencodez/votingplugin/llms.txt Set up network-wide vote tracking using BungeeCord or Velocity. Requires MySQL and specifies the communication method between proxy and backend servers. ```yaml # Proxy: plugins/VotingPlugin/bungeeconfig.yml # MySQL connection (required for all proxy methods) MySQL: Host: localhost Port: 3306 Database: votingplugin Username: root Password: password UseSSL: false # Communication method: PLUGINMESSAGING, REDIS, MQTT, SOCKETS, MYSQL Method: PLUGINMESSAGING # Proxy manages vote totals (recommended) BungeeManageTotals: true # Send votes to all servers or just player's current server SendVotesToAllServers: true # Allow votes from players who never joined AllowUnJoined: false # Queue votes until player comes online WaitForUserOnline: true # Global data synchronization GlobalData: Enabled: true # Server whitelist/blacklist Servers: - 'survival' - 'skyblock' BlockedServers: - 'hub' ``` -------------------------------- ### Add Custom HTTP Headers Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/webhooks Example of configuring custom HTTP headers for a webhook request. Values can include placeholders like {SERVER}. ```yaml Headers: Authorization: "Bearer YOUR_TOKEN" X-Server: "{SERVER}" ``` -------------------------------- ### Listening to PlayerVoteEvent (Java) Source: https://context7.com/bencodez/votingplugin/llms.txt Example of how to listen for the PlayerVoteEvent in Bukkit to hook into the vote processing. Ensure you have the VotingPlugin API available. ```java public void onPlayerVote(PlayerVoteEvent event) { // Your custom logic here } ``` -------------------------------- ### Define Command Reward Using Reward File Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Rewards Example of defining a command reward by referencing a reward file named 'command'. The content of 'command.yml' is shown. ```yaml Rewards: - command ``` ```yaml Commands: - 'command here' ``` -------------------------------- ### VotingPlugin PlaceholderAPI Placeholders for Scoreboards Source: https://context7.com/bencodez/votingplugin/llms.txt Example configuration for using VotingPlugin placeholders in a scoreboard. Ensure PlaceholderAPI is installed and configured. ```yaml # Example scoreboard configuration using VotingPlugin placeholders scoreboard: title: "&6Vote Stats" lines: - "&7Your Votes:" - "&f All-time: &a%votingplugin_total_alltime%" - "&f Monthly: &a%votingplugin_total_monthly%" - "&f Weekly: &a%votingplugin_total_weekly%" - "&f Daily: &a%votingplugin_total_daily%" - "" - "&7Vote Points: &e%votingplugin_points%" - "&7Can Vote: %votingplugin_canvote%" - "&7Sites Available: %votingplugin_sitesavailable%/%votingplugin_sitesavailabletotal%" - "" - "&7Vote Streaks:" - "&f Daily: &a%votingplugin_dailyvotestreak%" - "&f Weekly: &a%votingplugin_weeklyvotestreak%" - "&f Monthly: &a%votingplugin_monthvotestreak%" - "" - "&7Top Voter Position: &e#%votingplugin_top_month_position%" - "" - "&7Vote Party:" - "&f Current: &a%votingplugin_votepartyvotescurrent%" - "&f Needed: &c%votingplugin_votepartyvotesneeded% ``` -------------------------------- ### PlaceholderAPI Configuration Example Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/PlaceHolderAPI-placeholders This YAML snippet shows how to configure PlaceholderAPI settings within the Config.yml file. It controls the use of primary accounts for placeholders and defines the caching level and specific placeholders to cache. ```yaml # --------------------------------------- # PlaceholderAPI Placeholder Settings # --------------------------------------- # When enabled, the command /vote setprimaryaccount (playername) # will appear after restart. # The primary account is used instead of the player’s account # to fetch placeholders and vote reminders (useful for alts). UsePrimaryAccountForPlaceholders: false # Cache levels: # AUTO - Auto cache after use (recommended) # SPECIFIC - Cache only listed placeholders # NONE - Disable caching entirely PlaceholderCacheLevel: AUTO # Placeholders to always cache # Use for placeholders that appear frequently (like on scoreboards) # Remove "votingplugin_" prefix from listed placeholders CachedPlaceholders: [] # - Total_AllTime ``` -------------------------------- ### Ignore Time Changes on Startup Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Time-Changes Set 'IgnoreTime' to true in ServerData.yml to skip automatic time changes when the server starts. ```yaml IgnoreTime: true ``` -------------------------------- ### Creating a Custom Reward File Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/reward-system Example structure for a custom reward file located in the '/plugins/VotingPlugin/Rewards/' directory. This file defines items, money, experience, and commands. ```yaml Items: Diamond: Material: 'DIAMOND' Amount: 1 Money: 5 EXP: 100 Commands: - 'say %player% was lucky' ``` -------------------------------- ### INTERVAL Reminder Type Example Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteReminders Configure a reminder that triggers at a specified interval. Note the effective cooldown calculation for INTERVAL reminders. ```yml VoteReminders: IntervalReminder: Type: INTERVAL Interval: 30m Cooldown: 2h Conditions: CanVoteAny: true ``` -------------------------------- ### Define Command Reward Directly Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Rewards Example of directly defining a command reward. ```yaml Rewards: Commands: - 'command here' ``` -------------------------------- ### Inline Reward Definition Example Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/reward-system Defines items, money, experience, and commands directly within a configuration file. Ideal for simple, single-use rewards. ```yaml VoteSites: ExampleSite: Enabled: true Name: 'Example Voting Site' ServiceSite: 'example.com' VoteURL: 'https://example.com/vote' VoteDelay: 24 Rewards: Items: Diamond: Material: 'DIAMOND' Amount: 1 Money: 5 EXP: 100 Commands: - 'say %player% was lucky' ``` -------------------------------- ### Accessing User Data (Java) Source: https://context7.com/bencodez/votingplugin/llms.txt Example of how to access VotingPluginUser to manipulate player data. This requires the VotingPlugin API. ```java VotingPluginUser user = VotingPluginHooks.getUser(event.getPlayer()); // Access or modify user data ``` -------------------------------- ### Configure Delay Between Background Updates Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Performance-Settings Set the interval in minutes between background checks like sign updates or top voter sync. 3-10 minutes is ideal for most setups. ```yaml DelayBetweenUpdates: 3 ``` -------------------------------- ### Inline AdvancedPriority Rewards in VoteSites.yml Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/AdvancedPriority-Rewards Demonstrates defining AdvancedPriority rewards directly within a plugin configuration file, such as VoteSites.yml. This example shows a tiered reward system with chances for diamonds, emeralds, and a fallback message. ```yaml VoteSites: ExampleSite: Enabled: true ServiceSite: 'ExampleSite.com' VoteURL: 'https://example.com/vote' Rewards: AdvancedPriority: Reward1: Chance: 50 Items: Diamond: Material: DIAMOND Amount: 1 Reward2: Chance: 20 Items: Emerald: Material: EMERALD Amount: 1 Fallback: Messages: Player: 'Better luck next time!' # You can still define other rewards here; they run after AdvancedPriority Items: item1: Material: COAL Amount: 1 ``` -------------------------------- ### Choice Rewards Configuration (GUI Prompt) Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/All-Reward-Possibilities Allows players to choose one reward from a presented GUI. Each choice is defined with display properties and the specific rewards it grants. ```yaml EnableChoices: true Choices: Diamond: DisplayItem: Name: '&c3 Diamonds' Material: DIAMOND Amount: 3 Rewards: Items: Diamond: Material: DIAMOND Amount: 3 Iron: DisplayItem: Name: '&c15 Iron Ingots' Material: IRON_INGOT Amount: 15 Rewards: Items: Iron: Material: IRON_INGOT Amount: 15 ``` -------------------------------- ### Configure Immediate Command Reward Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Delayed-reward-command This snippet shows how to configure an immediate command reward. The '%player%' placeholder will be replaced with the player's name. ```yaml Rewards: Commands: - fly %player% ``` -------------------------------- ### Basic Shop Item Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Defines a simple purchasable item in the shop, including its display in the GUI, cost, and rewards. Set 'CloseGUI' to true to close the shop after purchase. ```yaml Shop: Diamond: Identifier_Name: Diamond DisplayItem: Material: DIAMOND Amount: 1 Name: '&bBuy a Diamond' Lore: - '&7Cost: &a3 Vote Points' Cost: 3 CloseGUI: true Rewards: Items: Diamond: Material: DIAMOND Amount: 1 ``` -------------------------------- ### VoteMilestone Trigger: Every Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Configures a VoteMilestone to trigger repeatedly based on a specific interval. This example triggers every 25 votes. ```yml Every: 25 ``` -------------------------------- ### Configure Stepped Milestones with Rewards Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Set up milestones that trigger at specific intervals within a range. Rewards are executed as commands. ```yaml VoteMilestones: SteppedMilestones: Enabled: true Total: ALLTIME_VOTES At: - "10..100 step 10" - "250..500 step 50" Rewards: Commands: - "eco give %player% %amount%" ``` -------------------------------- ### Get VotingPlugin Instance Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/API Retrieve the VotingPlugin instance from Bukkit's plugin manager. This is often a prerequisite for accessing other API features. ```java VotingPluginMain plugin = (VotingPluginMain) Bukkit.getPluginManager().getPlugin("VotingPlugin"); ``` -------------------------------- ### Define Basic Rewards Directly Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Rewards Configure rewards like money and commands directly in the main configuration. This method is recommended and automatically generates reward files for offline use if necessary. Do not edit generated files. ```yaml Rewards: Money: 100 Commands: - 'say %player%' # Anything that reward files can do can be done here # This auto converts into a reward file automatically # Items, etc # See ExampleBasic or ExamapleAdvanced in VotingPlugin/Rewards for all possible configurations # Be sure to follow proper spacing ``` -------------------------------- ### Configure Global MySQL Data Handling in BungeeSettings.yml Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Global-Data-Handling Enable and configure global MySQL data handling for inter-server communication within BungeeSettings.yml. Ensure 'Enabled' is true and specify MySQL connection details or use the main connection. ```yaml # Global MySQL data handling between server communications GlobalData: Enabled: false # Use existing MySQL connection from config.yml UseMainMySQL: true # Custom MySQL settings (if not using main) Host: '' Port: 3306 Database: '' Username: '' Password: '' MaxConnections: 1 # Must be identical on all servers Prefix: '' #UseSSL: true #PublicKeyRetrieval: false #UseMariaDB: false ``` -------------------------------- ### VoteMilestone Limit: Cooldown Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Applies a cooldown limit to a VoteMilestone, preventing it from re-triggering within a specified duration. This example sets a 12-hour cooldown. ```yml Limit: Type: COOLDOWN Duration: 12h ``` -------------------------------- ### Example: First-ever vote reward Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones A VoteMilestone configuration that triggers once when a player casts their very first vote. It rewards the player with in-game currency and displays a message. ```yml VoteMilestones: FirstVote: Enabled: true Total: ALLTIME_VOTES At: 1 Rewards: Messages: Player: "&aThanks for your first vote!" Commands: - "eco give %player% 100" ``` -------------------------------- ### Configure Backend Server for Proxy Support Source: https://context7.com/bencodez/votingplugin/llms.txt Enable and configure proxy support on backend servers. Ensures the server uses the same communication method as the proxy and identifies itself with a unique server name. ```yaml # Backend server: plugins/VotingPlugin/BungeeSettings.yml # Enable proxy support UseBungee: true # Match proxy method BungeeMethod: PLUGINMESSAGING # Server identifier Server: survival # MySQL connection (same as proxy) MySQL: Host: localhost Port: 3306 Database: votingplugin Username: root Password: password ``` -------------------------------- ### Example: First vote of the day reward Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones This VoteMilestone triggers when a player casts their first vote of the current day. It provides a simple in-game message to the player. ```yml VoteMilestones: FirstVoteToday: Enabled: true Total: DAILY_VOTES At: 1 Rewards: Messages: Player: "&eThanks for voting today!" ``` -------------------------------- ### Configure Priority-Based Reward Execution Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Specify a list of reward files to attempt execution in order. Only the first reward file that can be successfully given will be executed. This is an alternative to `AdvancedPriority`. ```yaml Priority: [] ``` -------------------------------- ### Configure Global MySQL Data Handling in bungeeconfig.yml Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Global-Data-Handling Enable and configure global MySQL data handling for inter-server communication. Ensure 'Enabled' is true and specify MySQL connection details or use the main connection. ```yaml # Global MySQL data handling between server communications GlobalData: Enabled: false # Use existing connection from config.yml UseMainMySQL: true # Custom MySQL settings (if not using main) Host: '' Port: 3306 Database: '' Username: '' Password: '' MaxConnections: 1 # Must be identical on all servers Prefix: '' #UseSSL: true #PublicKeyRetrieval: false #UseMariaDB: false # Time offset for time changes (must match across servers) TimeHourOffSet: 0 ``` -------------------------------- ### Votifier Working Console Message Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Votifier-Troubleshooting This message appears in the console when Votifier is functioning correctly and VotingPlugin receives a vote. It indicates that the basic Votifier setup is operational. ```log [VotingPlugin] Received a vote from service site 'SERVICESITEHERE' by player 'BenCodez'! ``` -------------------------------- ### Command Reward Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Configures a command to be executed as a reward for purchasing an item. The '%player%' placeholder can be used to target the purchasing player. ```yaml Rewards: Commands: - 'give %player% diamond 1' ``` -------------------------------- ### Example: Reward every 10 total votes Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones A VoteMilestone that triggers every time a player accumulates a total of 10 votes. It grants the player a 'vote' crate. ```yml VoteMilestones: Every10Votes: Enabled: true Total: ALLTIME_VOTES Every: 10 Rewards: Commands: - "crate give %player% vote 1" ``` -------------------------------- ### DisplayItem Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Configures the visual representation of an item in the GUI, including material, amount, name, and lore. If not present, the plugin falls back to a legacy format. ```yaml DisplayItem: Material: DIAMOND Amount: 1 Name: '&bBuy a Diamond' Lore: - '&7Cost: &a3 Vote Points' ``` ```yaml Material: DIAMOND Amount: 1 Name: '&bBuy a Diamond' Lore: - '&7Cost: &a3 Vote Points' ``` -------------------------------- ### Configure Random Reward File Execution Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Specify a list of reward files from which one will be randomly selected and executed. An empty list means no reward files will be given. ```yaml RandomReward: [] ``` -------------------------------- ### Configure Delayed Command Execution Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Delayed-reward-command Use this configuration to set up a command that executes after a specified delay. Ensure 'Enabled' is set to true to activate the delay. ```yaml Rewards: Delayed: Enabled: true Hours: 1 Minutes: 0 Seconds: 0 Commands: - fly %player% ``` -------------------------------- ### Disable Advanced Tab Completion Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Performance-Settings Set to true to disable checking permissions for tab completion. May improve command responsiveness slightly for large permission setups. ```yaml DisableAdvancedTab: false ``` -------------------------------- ### VoteMilestone Trigger: At (List) Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Sets up a VoteMilestone to trigger when the total vote count matches any value in the provided list. This example triggers at 25, 50, or 100 total votes. ```yml At: - 25 - 50 - 100 ``` -------------------------------- ### Small Server VoteBroadcast Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Vote-Broadcast-System A simple backend configuration for small servers, broadcasting every vote. ```yaml Type: EVERY_VOTE ``` -------------------------------- ### Defining a Specific Vote Reminder Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteReminders Define individual vote reminders with specific triggers, priorities, delays, cooldowns, conditions, and rewards. This example shows a 'LOGIN' type reminder. ```yml VoteReminders: OnLogin: Type: LOGIN Priority: 50 Delay: 3s Cooldown: 3m Conditions: CanVoteAny: true Rewards: Messages: Player: "&aWelcome back! You can vote now on &e%sitesavailable%&a sites." ``` -------------------------------- ### Disable Extra Background Update Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Performance-Settings Set to false to disable additional player data checks across servers. Only needed in multi-server setups where updates don't trigger correctly. ```yaml ExtraBackgroundUpdate: false ``` -------------------------------- ### Reference Single Reward File Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Rewards Alternatively, you can reference a single reward file by its name. ```yaml Rewards: 'RewardFile1' ``` -------------------------------- ### Rarity Tiers Example with AdvancedPriority Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/AdvancedPriority-Rewards Defines rewards with different rarity tiers (Rarest, SecondRarest, Fallback) using AdvancedPriority. Rewards are evaluated in order, with rarer rewards having a lower chance to succeed. ```yaml AdvancedPriority: Rarest: Chance: 1 Items: item: Material: DIAMOND Amount: 5 Messages: Player: 'You got rare item' SecondRarest: Chance: 5 Items: item: Material: DIAMOND Amount: 1 Messages: Player: 'You got second rare item' Fallback: Items: item: Material: DIRT Amount: 1 Messages: Player: 'You got normal item' ``` -------------------------------- ### System and Debug Commands Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Commands-&-Permissions Commands for system updates, debugging, and background tasks. ```APIDOC ## POST /av/Config/TempDebug ### Description Enable debug mode, effective until the next reload or restart. ### Method POST ### Endpoint /av Config TempDebug ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Debug mode enabled temporarily." } ``` ## POST /av/Config/TempExtraDebug ### Description Enable extra debug mode, effective until the next reload or restart. ### Method POST ### Endpoint /av Config TempExtraDebug ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Extra debug mode enabled temporarily." } ``` ## POST /av/UpdateCheck ### Description Check for available updates for the VotingPlugin. ### Method POST ### Endpoint /av UpdateCheck ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Update check initiated." } ``` ## POST /av/BackgroundUpdate ### Description Force a background update for the VotingPlugin. ### Method POST ### Endpoint /av BackgroundUpdate ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Background update forced." } ``` ## POST /av/ClearOfflineVotes ### Description Clear all offline votes. ### Method POST ### Endpoint /av ClearOfflineVotes ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "All offline votes cleared." } ``` ## POST /av/Test ### Description Test voting speed for a player on a specific site, for debugging purposes. ### Method POST ### Endpoint /av Test (Player) (sitename) (number) ### Parameters #### Path Parameters - **Player** (Player) - Required - The player to test. - **sitename** (sitename) - Required - The name of the site. - **number** (number) - Required - The number of votes to simulate. ### Request Example ```json { "player": "examplePlayer", "sitename": "exampleSite", "votes": 5 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Voting speed test initiated." } ``` ## POST /av/TestSpam ### Description Test voting spam speed for a player on a specific site, for debugging purposes. ### Method POST ### Endpoint /av TestSpam (Player) (sitename) (number) ### Parameters #### Path Parameters - **Player** (Player) - Required - The player to test. - **sitename** (sitename) - Required - The name of the site. - **number** (number) - Required - The number of votes to simulate. ### Request Example ```json { "player": "examplePlayer", "sitename": "exampleSite", "votes": 10 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Voting spam speed test initiated." } ``` ## POST /av/TestReward ### Description Test reward speed for a player, for debugging purposes. ### Method POST ### Endpoint /av TestReward (Player) (reward) (number) ### Parameters #### Path Parameters - **Player** (Player) - Required - The player to test. - **reward** (reward) - Required - The reward to test. - **number** (number) - Required - The number of rewards to simulate. ### Request Example ```json { "player": "examplePlayer", "reward": "exampleReward", "count": 3 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Reward speed test initiated." } ``` ## POST /av/Placeholders ### Description List available placeholders for the VotingPlugin. ### Method POST ### Endpoint /av Placeholders ### Request Example ```json {} ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Available placeholders listed." } ``` ``` -------------------------------- ### Enable VoteShop Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Enable the VoteShop feature by setting 'Enabled' to true in the Shop.yml configuration. ```yaml VoteShop: Enabled: true Name: VoteShop ``` -------------------------------- ### Example: Multiple exact vote milestones Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones This configuration sets up a VoteMilestone that triggers at specific total vote counts (25, 50, and 100). When triggered, it broadcasts a message to all players indicating the player's achievement. ```yml VoteMilestones: BigMilestones: Enabled: true Total: ALLTIME_VOTES At: - 25 - 50 - 100 Rewards: Broadcast: Message: "&6%player% reached %amount% total votes!" ``` -------------------------------- ### Configure Advanced Priority Rewards Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Set up a sequence of rewards with individual chances and requirements. Rewards are attempted in order, and the first one that meets all its criteria is executed. This allows for complex fallback mechanisms. ```yaml AdvancedPriority: # Similar to priority, but no need to have to use reward files # Add requirements under each reward # Will go in order from list here and try to run each of the following rewards... # This name can be anything, but they need to be different Reward1: Chance: 50 # Any other requirement here # If any requirement fails, the next will be attempted Messages: Player: 'You got first reward' Reward2: Chance: 20 Messages: Player: 'You got second reward' # Fallback, 100% chance Fallback: Messages: Player: 'You got unlucky' ``` -------------------------------- ### VoteMilestone Trigger: At (Ranges) Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Defines a VoteMilestone to trigger for vote counts within specified ranges, with optional step intervals. This example triggers for totals between 10 and 100 (step 10) and between 250 and 500 (step 50). ```yml At: - "10..100 step 10" - "250..500 step 50" ``` -------------------------------- ### Enable Extra Debugging Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/faq Set DebugLevel to EXTRA in Config.yml for detailed troubleshooting. For proxy issues, also enable BungeeDebug in BungeeSettings.yml and on the proxy itself. ```yaml DebugLevel: EXTRA ``` ```yaml BungeeDebug: true ``` -------------------------------- ### Conditional Item Distribution with JavaScript Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Distribute items based on a JavaScript condition. The `ConditionalJavascript` expression must return a value that determines which item (true or false path) is given. This example uses `User.canVoteAll()` to check voting status. ```javascript User.canVoteAll() ``` ```yaml Items: Item1: ConditionalJavascript: 'User.canVoteAll()' Conditional: false: Material: 'REDSTONE_BLOCK' Amount: 1 true: Material: 'EMERALD_BLOCK' Amount: 1 ``` -------------------------------- ### Disable Online Mode in VotingPlugin Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Online-Offline-Mode Set 'OnlineMode' to false in Config.yml to resolve UUIDs purely by player name. This is recommended for servers exclusively using offline-mode UUIDs or for hybrid setups where UUID consistency across online and offline players is critical. ```yaml OnlineMode: false ``` -------------------------------- ### Basic Command Reward Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/All-Reward-Possibilities Executes a list of commands for the player. Commands can be run as console or player and support placeholder parsing. ```yaml Commands: - 'say %player% received a reward!' ``` -------------------------------- ### Configure Timed Reward Execution Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Schedule a reward file to run at a specific time of day. Uses 24-hour format relative to the server's local time zone. Enabled must be true to activate. ```yaml Timed: Enabled: false Hour: 12 Minute: 0 ``` -------------------------------- ### Configure Reward File with Webhook Notifications Source: https://context7.com/bencodez/votingplugin/llms.txt Set up rewards for players and configure webhook notifications for specific events. Supports simple messages, Discord embeds, and raw JSON payloads. ```yaml # Reward file with webhook notifications # plugins/VotingPlugin/Rewards/VoteWithWebhook.yml Money: 100 Commands: - 'give %player% diamond 1' WebhookReward: Webhooks: # Simple Discord message - webhook: "discord-votes" content: enabled: true message: ":ballot_box: {PLAYER} voted on {SERVICE_SITE}!" # Discord embed - webhook: "discord-votes" content: enabled: false embed: enabled: true title: "New Vote Received!" description: "**{PLAYER}** voted on **{SERVICE_SITE}**" color: "#00ff00" footer: enabled: true message: "Total votes: {TOTAL_ALLTIME}" # Raw JSON for custom APIs - webhook: "custom-api" json: | { "event": "vote", "player": "{PLAYER}", "uuid": "{UUID}", "site": "{SERVICE_SITE}", "server": "{SERVER}", "timestamp": "{TIMESTAMP}" } ``` -------------------------------- ### Vote Site Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Commands-&-Permissions Commands for creating, configuring, and managing vote sites. ```APIDOC ## POST /av/VoteSite/Create ### Description Create a new VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) Create ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite to create. ### Request Example ```json { "sitename": "newSite" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "VoteSite newSite created." } ``` ## POST /av/VoteSite/SetServiceSite ### Description Set the ServiceSite for a VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) SetServiceSite (string) ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite. - **string** (string) - Required - The ServiceSite value. ### Request Example ```json { "sitename": "exampleSite", "serviceSite": "exampleService" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "ServiceSite set for exampleSite." } ``` ## POST /av/VoteSite/SetVoteURL ### Description Set the VoteURL for a VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) SetVoteURL (string) ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite. - **string** (string) - Required - The VoteURL value. ### Request Example ```json { "sitename": "exampleSite", "voteURL": "http://example.com/vote" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "VoteURL set for exampleSite." } ``` ## POST /av/VoteSite/SetPriority ### Description Set the Priority for a VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) SetPriority (number) ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite. - **number** (number) - Required - The Priority value. ### Request Example ```json { "sitename": "exampleSite", "priority": 10 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Priority set for exampleSite." } ``` ## POST /av/VoteSite/SetVoteDelay ### Description Set the VoteDelay for a VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) SetVoteDelay (TEXT) ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite. - **TEXT** (TEXT) - Required - The VoteDelay value. ### Request Example ```json { "sitename": "exampleSite", "voteDelay": "12h" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "VoteDelay set for exampleSite." } ``` ## POST /av/VoteSite/SetEnabled ### Description Set the Enabled status for a VoteSite. ### Method POST ### Endpoint /av VoteSite (sitename) SetEnabled (boolean) ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite. - **boolean** (boolean) - Required - The Enabled status (true/false). ### Request Example ```json { "sitename": "exampleSite", "enabled": true } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Enabled status set for exampleSite." } ``` ## POST /av/VoteSite/Check ### Description Check to see if a VoteSite is valid. ### Method POST ### Endpoint /av VoteSite (sitename) Check ### Parameters #### Path Parameters - **sitename** (sitename) - Required - The name of the VoteSite to check. ### Request Example ```json { "sitename": "exampleSite" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "VoteSite exampleSite is valid." } ``` ``` -------------------------------- ### Referencing a Custom Reward File in VoteSites.yml Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/reward-system Shows how to link a custom reward file ('MyCustomReward') to a specific voting site configuration. Ensure the reward file exists in the '/Rewards/' directory. ```yaml VoteSites: ExampleSite: Rewards: - 'MyCustomReward' ``` -------------------------------- ### Configure Vote Points Milestones with Rank Rewards Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteMilestones Set up milestones based on accumulated vote points, triggering rank changes via commands. ```yaml VoteMilestones: PointRewards: Enabled: true Total: POINTS At: - 100 - 500 - 1000 Rewards: Commands: - "lp user %player% parent add vip" ``` -------------------------------- ### Configure Delayed Reward Execution Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Reward-Examples Set a delay before a reward file is executed. Specify hours, minutes, and seconds for the delay. Enabled must be true to activate. ```yaml Delayed: Enabled: false Hours: 1 Minutes: 0 Seconds: 0 ``` -------------------------------- ### Configure MySQL Connections Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/Performance-Settings Set the maximum number of MySQL connections. Using more than 2 connections rarely provides any benefit and only increases resource usage. ```yaml MaxConnections: 1 ``` -------------------------------- ### ExtraItems Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/voteshop Adds display-only items to the GUI that are not purchasable. These are useful for providing information or visual elements without offering them as rewards. ```yaml ExtraItems: Info: DisplayItem: Material: BOOK Name: '&eShop Info' Lore: - '&7Use vote points to purchase rewards' ``` -------------------------------- ### Advanced Window Tracking Configuration Source: https://github.com/bencodez/votingplugin/wiki/VotingPlugin/VoteStreak-System Sets a specific look-back window (AllowMissedPeriod) and validates a minimum number of successful periods with limited misses. This ensures a balance between consistency and flexibility. ```yaml AllowMissedPeriod: 7 Amount: 5 AllowMissedAmount: 1 ```