Im trying to make a custom ban plugin

Discussion in 'Plugin Development' started by Kay0sX, Oct 7, 2018.

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

    Kay0sX

    Im working on making my own ban plugin. Im new to working with Java and making plugins here is what I have so far https://github.com/beckers0347/GyroBan now im trying to make the command actually ban someone and I want to make a custom message when the person gets banned please help anyone
     
    FreakyPear5 likes this.
  2. Offline

    KarimAKL

    @Kay0sX I'm pretty sure you can do this by kicking the player with the message you want. Remember to kick them with the message on the PlayerLoginEvent so that the message is displayed again when they try to connect to the server.
     
  3. Well unfortunately you cant do player.ban(String reason). But u can do what @KarimAKL and add them to a config list and then when the join check if they are banned and when u ban them kick them aswell! Hope this helps!
     
  4. Offline

    KarimAKL

    @Shadow_tingBRO Or instead of making a list yourself you can add them to the "default ban list" like this:
    Code:Java
    1. Bukkit.getBanList(Type.NAME).addBan(player.getName(), "reason", date, "player who banned")

    Change NAME to IP if you want to ban an IP.
     
  5. funny i was about to say that
     
Thread Status:
Not open for further replies.

Share This Page