How?

Discussion in 'Plugin Development' started by ElCreeperHD, Aug 1, 2015.

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

    ElCreeperHD

    Im making a plugin and i want to change a part of the MOTD of the server with a string but i can t. How i can do that?
    My code:
    Code:
    public class ScrimmEvents implements Listener{
        String player = "Test";
          @EventHandler(priority=EventPriority.MONITOR)
          public void onServerListPing(ServerListPingEvent event)
          {
            event.setMotd("§a§lScrimmage of" getString.("player"));
          }
    
    }
    
     
  2. Offline

    teej107

    @ElCreeperHD You should really get comfortable with Java before trying to write Bukkit plugins. Your code shows that you don't have a knowledge of Java.
     
  3. 1. Remove the EventPriority
    2. Whats this:
    ? That won't even compile
     
  4. Offline

    moe097

    "event.setMotd("§a§lScrimmage of" getString.("player"));" makes no sense.
    You don't put a period after the method name when calling it, as it is a method and has parameters. You also don't use quotation marks when using a variable either. You would do it like: "getString(player);" as earlier in the code you defined the variable "player" as a string.
    Even then though your code is still messed up in many ways.

    You can learn java here: https://docs.oracle.com/javase/tutorial/
    You don't have to be an expert java programmer before learning bukkit, but you should definitely know the basics and how to call a method, use variables, ect.
     
    Last edited: Aug 1, 2015
  5. Offline

    ChintziSecilMC

    @ElCreeperHD K ill help you here but ill try not to spoon feed, first its cool to see you are starting off but you should try some tutorials to help you with the basics of starting bukkit plugins, try either TheBCBros or Pogo - Coding and More , next for coloring strings in bukkit you need to use ChatColor.<What ever color you wish> and to put 2 strings together you need to use the '+' character for example: player.sendmessage(ChatColor.RED + "Hello player, " + ChatColor.GREEN + player.getName()); that would send a player a message in red saying hello player <their name>
     
  6. Offline

    ElCreeperHD

    1. Why?
    2. I know that the get string is not going to work. Im asking how to do that.
     
  7. Offline

    MCMatters

    THIS THREAD THO LMAOOOO
     
  8. Offline

    ElCreeperHD

    I saw that tutorials, but for that it don t helped me...
     
  9. Offline

    MCMatters

  10. ARE YOU SERIOUS?! TheBCBroz makes the WORST tutorials that are outdated and he teaches bad code practices
     
  11. Offline

    ChintziSecilMC

    @ElCreeperHD did you try this video ?

    @FisheyLP Pardon me for helping gosh

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

    ElCreeperHD

    Thats true, they help only for specific things and in the practice they didn t help.

    a

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

    MCMatters

    @ElCreeperHD if you add me on Skype mcmatters123 ill give you java/bukkit lessons
     
  14. Offline

    ElCreeperHD

    The video doesn t helped me!
     
  15. Offline

    ElCreeperHD

    Problem not solved.
     
  16. Offline

    moe097

    @ElCreeperHD
    Nobody is going to solve the problem for you. Learn java, then bukkit. Everyone has given you enough information to solve your problem.
     
    teej107 likes this.
Thread Status:
Not open for further replies.

Share This Page