(SOLVED) My Vote Listener

Discussion in 'Plugin Development' started by andrewginn, Oct 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    andrewginn

    Hello i have been making a vote listener for about 10 mins now and just remembered that i want a custom item to come through the vote. Is there a way to link the custom item and the vote listener together, so you receive the key. Also i am stuck on how to link a item, so when you right click a chest with the key you received from the vote you get a random chance.
    All I'm asking for is a bit of help on how to link the custom item to the votelistener and how to make the key you received from the vote interact with the chest and give you a lucky chance to win a prize. Thanks!
     
  2. Offline

    Funergy

  3. Offline

    andrewginn

    Funergy What code and where from? Be specific. Also if your here to get this plugin go away because im asking for help not giving out codes
     
  4. andrewginn im sorry, my english is not the best, the phrase "to come through the vote" can mean a few things in my language. do you want the item to be given to every player after the vote returned yes? or what exactly do you want to do? I understood so far:
    You've got a custom item made by you. And you've got a votemechanic made by you with a listener for it. And you want to make the item if the player right clicks a chest with it in his hand, there will be a random chance generated which may let you win a price. And you want the listener giving the custom items to the player/s if the vote returned true? is that what you meant?
     
  5. Offline

    Funergy

    andrewginn WOAH you are saying me that I wanna steal your code. I'm not going to copy codes from a nab.
    I just want to help you. you are asking for help. we want to understand you. You want to link that item to your vote listener. first we need to see your code to know how we can link it.
     
  6. Offline

    andrewginn

    Ok good thank god :) ok i have only made the listener do you want the listener code or what? Im confused. Also shmobi, yes every time they vote they receive the key, sorry im a nub i dont understand what that method means except public void :( sorry. Also the custom item video was a troll so i dont have a item. What i want to have as the item is a tripwire hook called a vote key. All the rest is right except the votemechanic i dont know what that is. Funergy Shmobi
     
  7. Offline

    Funergy

    andrewginn What you do is you create an itemstack with a tripwire hook called with the name ChatColor.RED+"Vote Key"

    then with the player interact event if he right clicks an enderchest then check if the item in his hand is a tripwire hook AND if the itemmeta display name is equal to ChatColor.RED+"Vote Key" and then you create a Random + the stuff you want them to receive
     
  8. andrewginn the code you saw is my signature xD this does not belong to this thread. i appears under every one of my posts. if you know so less about bukkit, do you even know more about java?
     
  9. Offline

    andrewginn

    Yes i know quite a bit about java its just memorising all the events and which ones fit together

    Funergy do you have the code for the rest except the itemstack, that would be greatly appreciated

    Funergy Wait i got it but how do i add a name to the itemstack?

    Funergy Shmobi http://pastebin.com/87xeap7W This is the coding what is the problem with it and i got a template from my friend so i could improve on it, but i still need your help

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  10. Offline

    CraftCreeper6

    andrewginn
    Your need to implement VoteListener too.
     
    Funergy likes this.
  11. Offline

    Funergy

Thread Status:
Not open for further replies.

Share This Page