zPurity

how to make a minecraft plugin

Nov 11th, 2016
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. How to Make a Minecraft Plugin:
  2. Steps:
  3. 1. Download : https://www.eclipse.org/downloads/download.php?file=/oomph/epp/neon/R1/eclipse-inst-win64.exe
  4. 2. Go through configuration
  5. 3. Create a Java file > Click the the Window with a yellow star on the top left (located on the icon row (first icon))
  6. 4. ONLY NAME IT, Click next then finish MAKE SURE U NAME IT WITH me.(name)
  7. 5. Create a Package> Which is the icon that is brown and has a star in the right corner (located on the top left) Put it under the src file
  8. 6. Create a class > click the icon with a green circle with a C inside it! then rename it ONLY
  9. 7. Here is what u put in it. THIS IS AN ANTI CURE PLUGIN
  10.  
  11.  
  12. package me.YOURNAME;
  13.  
  14. import org.bukkit.Bukkit;
  15. import org.bukkit.ChatColor;
  16. import org.bukkit.event.EventHandler;
  17. import org.bukkit.event.Listener;
  18. import org.bukkit.event.player.AsyncPlayerChatEvent;
  19. import org.bukkit.plugin.java.JavaPlugin;
  20.  
  21. public class AntiCurse extends JavaPlugin implements Listener {
  22.  
  23. @EventHandler
  24. public void onPlayerChat(AsyncPlayerChatEvent e) {
  25. for (String word : e.getMessage().split(" ")) {
  26. if (getConfig().getStringList("badwords").contains(word)) {
  27. e.setCancelled(true);
  28. e.getPlayer().sendMessage(ChatColor.GOLD + "" + ChatColor.BOLD + "(!) " + ChatColor.YELLOW + "Please don't say that word again! Its a bad word.");
  29. }
  30. }
  31. }
  32.  
  33. public void onEnable() {
  34. getConfig().options().copyDefaults(true);
  35. saveConfig();
  36. Bukkit.getServer().getPluginManager().registerEvents(this, this);
  37. }
  38. }
  39.  
  40.  
  41. 8. THEN right click (YOURNAME) folder and create a new file. name it config.yml then inside that put
  42. badwords:
  43. - example1
  44. - example2
  45.  
  46. 9. then same thing but create a new file and name it plugins.yml then inside that put
  47. name: YOURPLUGIN NAME
  48. version: 1.0
  49. main: me.YOURNAME.AntiCurse
  50. description: Stop cursing!
  51.  
  52. 10. THen when ur done right click the folder and export it. Click on Java then JAR file
  53. 11. UNCHECK .classpath and .project
  54. 12. put the plugin in the folder you want to put it in
Advertisement
Add Comment
Please, Sign In to add comment