Plugin Help

Discussion in 'Plugin Development' started by TCWilliford, Aug 10, 2012.

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

    TCWilliford

    Resolved, please delete
     
  2. Offline

    Jogy34

    config: http://wiki.bukkit.org/Introduction_to_the_New_Configuration

    Death Messages:
    1. Use a PlayerDeathEvent
    2. use event.setDeathMessage(String messsage) to set the death message
    ban:
    1. In the onCommand method override the ban command.
    2. When a player is banned they still stay in the game until they are either kicked or they leave so you have to manually kick the player.
    3. Use player.kickPlayer(String message) to kick the player using 'message' as the kick reason
    kick:
    1. Use a PlayerKickEvent
    2. Use event.setReason(String kickReason) to set the reason for the player being kicked
    whitelist:
    1. I don't know why you would need this considering that if you aren't whitelisted you typically can't get on the server in the first place if the server uses a whitelist and if they don't there isn't really a need to whitelist someone.
    2. Either way I would say to make a command (or override one if there already is one) to set the specified player to be whitelisted then send the player a message
     
  3. Offline

    TCWilliford

    Thanks!! Also, one last thing, how would i do this.

    OP types /settp <name> and it saves that location then a player type /<name> and gets teleported there?
     
  4. Offline

    Jogy34

    Save it to a config, something like this:
    Code:
    name:
        world: world
        x: ####
        y: ####
        z: ####
    
    also save it to a hashmap with a String for the name and the location(for faster retrieving) then when a player types the name either get it from the hashmap or the config and use:
    Code:
    player.teleport(world, x, y, z);
    //or
    player.teleport(location);
    
    To actually teleport the player.

    If the location is in a different world then I believe you have to make sure the world is loaded by doing this:
    Code:
    getServer().createWorld(new WorldCreator(worldName));
    
    That will either load a world or create a new world so you have to be careful with it if you don't want a thousand different worlds.
     
  5. Offline

    TCWilliford

    Do you have Skype? If so add TCWilliford
    please! :)
     
  6. Offline

    Jogy34

    I have skype but no microphone
     
  7. Offline

    TCWilliford

    Its okay we can just type! :))
     
  8. Offline

    chaseoes

    People like you are the downfall of forums.
     
  9. Offline

    TCWilliford

    How so?
     
Thread Status:
Not open for further replies.

Share This Page