How to change a sign into a redstone torch on login

Discussion in 'Plugin Development' started by jacklin213, Oct 17, 2012.

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

    jacklin213

    I need to know how to Select a sign using a command eg) /signtest
    When typing the command in It will say "Right Click Sign to be Selected"
    Then i want to be able to store the sign and every time someone logs on, I need the sign to change into a Redstone torch
     
  2. Offline

    nathanaelps

    ...So, you're asking how you can make a sign give a redstone pulse?

    Or are you asking how you would:
    1) locate a block,
    2) check that it's a sign
    3) ...that has certain text on it
    4) and save the position of the sign
    5) then, whenever somebody logs in,
    6) turn the block into a redstone torch,
    7) and then back into a sign
    8) ...that has certain text on it

    Because I bet somebody can answer the first question, but the list of questions should probably be asked in several pieces.

    Oh, wait... Did you just trick me into doing the design of your new plugin? FOR SHAME! FOR SHAME!
     
  3. Offline

    Woobie

  4. Offline

    Eballer48

    Seems like more of a plugin request.
     
  5. Offline

    Woobie

  6. Offline

    Eballer48

    Woobie
    jacklin213
    Well let me start ya out

    onCommand add the player's name (as a string) to a hashmap and send them the message "RIght Click Sign to be Selected" then on PlayerInteractEvent on action.RIGHT_CLICK_BLOCK check to see if the clickedBlock is a sign and then make sure event.getPlayer().getName() is a key in your hashmap (meaning that if a player's name is in the hashmap they can be in 'sign to torch' mode or whatever) then get the location save it to a file and setType(Material.REDSTONE_TORCH) also remove the user from the hashmap they are no longer in 'sign to torch' mode and then onEnable() read the location(s) and then getBlock.setType(Material.REDSTONE_TORCH).... I just told you how to do it.
     
  7. Offline

    jacklin213

    I just needed the idea of how to do it Eballer48 thanks that helps alot, though i have never worked with hashmaps before :( i need to go look it up

    to get the player name as a string is it
    Code:java
    1. Player p = (Player) sender;
    2. String playername = p.getName();

    then put the player name into hashmap?

    6 and How do i trick you into doing the design of my plugin? Im just asking on the basic way to do it like Eballer48 said , it helped me perfectly understand what to do

    Eballer48 would it still work if I stored the sign into a hashmap and call it when i need to change it into a red stone torch? or can u not put a sign into hashmap

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  8. Offline

    Woobie

    Why did you tag me?
     
  9. Offline

    jacklin213

    to tell you "I just needed the idea of how to do it"

    is this the right hashmap?

    Code:java
    1. public Map<Player, Boolean> pluginEnabled = new HashMap<Player, Boolean>();


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page