Skip to content

Adding VoteSites

Ben edited this page Apr 7, 2024 · 33 revisions

See the default here

Creating VoteSite:

  • Vote on website, will cause file to be autocreated (recommended)
    • SiteName will be the service site by default
    • Service site will also be set (No need to do that manually)
  • Create site manually, take a look at the VoteSites.yml
  • Create ingame, /av gui (Middle click votesites)

Configuration:

  • Define rewards: Anything in the example reward files can be put under Rewards, as seen here

  • Enable the votesite and your all good to go

  • Name - Display name

  • VoteDelay is how often you can vote, this won't prevent votes but is used for stuff like /vnext

  • VoteDelayDaily - For those certain sites that need this

  • Item - Item to be disabled in certain GUI's (Will be a warning if this doesn't exist)

  • Priority - For sorting sites in the list (order they are shown)

  • VoteURL - URL in /vote or GUI's, highest priority is first

  • ServiceSite - This is how the plugin determines which voting site matches the one in the config, won't work if incorrect

  • ForceOffline - Execute rewards while player is offline (Otherwise not waiting until player is online)

    ExampleVoteSite:
      # Enable voteSite
      # If false, votesite will not be loaded by plugin
      # Default: false
      Enabled: false
      
      # Display name of voting site
      Name: 'ExampleVoteSite'
            
      # Priority of this site
      # Used for sorted list
      # High prority, higher on the list
      Priority: 5
      
      # If true, voteside will be hidden from some GUI's, similar to being disabled
      Hidden: false
            
      # The serviceName from the vote, has to be correct to work correctly
      # Gotten from voting on the site (will be in console/log)
      # Usually is the main part of the url(e.g. PlanetMinecraft.com), but not always
      # See console when you vote (it will notify you if the plugin didn't find a votingsite matching the service site
      ServiceSite: 'PlanetMinecraft.com'
    
      # vote url for /vote
      # Format for this can be set in Config.yml
      # Do not include colors here
      # If you need to force a url set the url as this:
      # VoteURL: '[Text="ANY TEXT TO CLICK ON HERE",url="URLHERE"]'
      VoteURL: 'link to vote URL here, used in /vote'
    
      # Time between votes in hours (used for /vote next)
      # Most sites are 24 hours
      VoteDelay: 24
      
      # Use to have a minute votedelay
      #VoteDelayMin: 30
      
      # Require waiting until votedelay time has pasted in order to accept vote
      # Recommend: false
      WaitUntilVoteDelay: false
      
      # Reset vote delay each day (for certain sites that do this)
      # Recommend: false
      VoteDelayDaily: false
      
      # Replaces offset, set the exact hour based on server time
      # Include server time offset when setting this
      # 2 = 2 am server time
      # Use 1-24
      #VoteDelayDailyHour: 14
      
      # If true, rewards can be executed offline (requires ForceOffline to be true in the reward)
      # Setting this to true will execute the reward offline while the player is offline
      # This basiclly disables offline voting if set to true, don't misinterpret this option
      ForceOffline: false
      
      # VoteSite Material for some GUI's
      # Removing this may result in an error, required on each site
      DisplayItem:
        Material: 'DIAMOND'
        Amount: 1
        
      # Reward to run when cooldown ends for this votesite
      # Enable PerSiteCoolDownEvents in Config.yml to use this
      #CoolDownEndRewards:
      #  Messages:
      #    Player: '&aTime to go vote on site1'
    
      # Rewards to give
      # https://github.com/BenCodez/AdvancedCore/wiki/Rewards
      Rewards:
        # Execute console commands
        Commands:
        - 'say hello'
        # Send player a message
        Messages:
          Player: 'You voted'
    # Site 2 example
    Site2:
      Enabled: false
      Name: 'Site2'
      ServiceSite: 'PlanetMinecraft.com'
      VoteURL: 'link to vote URL here, used in /vote'
      VoteDelay: 24
      DisplayItem:
        Material: 'DIAMOND'
        Amount: 1
      Rewards:
        Commands:
        - 'say hello'
        # Advanced example
        # 50% chance for reward1, if reward1 not given then 20% chance to get reward2, if reward2 not given then fallback
        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 reward will be attempted
            # Use permission requirement for rank based rewards
            #RequirePermission: true
            #Permission: 'permhere'
            Messages:
              Player: 'You got first reward'
          Reward2:
            Chance: 20
            Messages:
              Player: 'You got second reward'
          # Fallback, 100% chance, after other rewards fail chances
          Fallback:
            Messages:
              Player: 'You got unlucky'
              
        # Give 1 diamond
        Items:
          item1:
            Material: DIAMOND
            Amount: 1
    
        Messages:
          Player: 'You voted'
    

Extra Notes:

  • Service sites must be correct in order to work
  • Follow yml rules
Clone this wiki locally