Config help ? Please.

Discussion in 'Plugin Development' started by Rileys, Apr 15, 2015.

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

    Rileys

    Hey Riley here, I'm trying to make a hug plugin.
    What it does, You type /hug and it sends a message to the other play who you hugged.
    I'm wanting it so i can change the message in the config, i tried something, however no message shows up in-game. And i'm not just trying to change the message, i'm trying to make it so they can select where the plays name goes. thanks in advance.



    My config:
    HugReceive: 'message %receive%'
    HugSend: 'message %sender%'
     
  2. Offline

    TheEntropy

    @Rileys Could you show us what you've already done so far?
     
    Rileys likes this.
  3. Offline

    Rileys

    Last edited: Apr 15, 2015
  4. Offline

    TheEntropy

    @Rileys I didn't see your code create a config. Did you just create one by hand, or is there another part of the code that creates the config? Also, on lines 52 and 54: you replace '&' with 'ยง'. If you're trying to get chat colors to work, try:

    Code:
    String toSend = ChatColor.translateAlternateColorCodes('&', "Your message here");
    
    Another thing: Are you absolutely sure you are receiving the String from the config? I would start there.
     
    Rileys likes this.
  5. Offline

    Rileys

    @TheEntropy How do i check if i'm receiving the string from my config?
     
  6. Offline

    mine-care

    @Rileys
    First things first,
    Dont store Players in Lists/Maps or generally in anything invloving long term storage unless they are handled properly (
    ( ArrayList<Player> cooldown = new ArrayList<Player>();)
    Prefer not to spawn tasks each time the command runs.

    You can debug to find out.

    Hope that helps.
     
    Rileys likes this.
  7. Offline

    Rileys

    @mine-care Hey thanks, although i'm still hacing trouble
    updated code: http://pastebin.com/y0iYwpPs
    my config, i have a feeling it has something to do with this, i can't figure out, anyway this is the way i learn, it makes it easier for me, if you could help me, then i use that knowelege on future plugins:

    config: http://pastebin.com/7yVd5Eap

    It's still not coming up with any messages in game when i do /hug <player> however if i do /hug after that, it tells me not to spam the command so it must be working, just not showing up
     
Thread Status:
Not open for further replies.

Share This Page