Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to Make a Minecraft Plugin:
- Steps:
- 1. Download : https://www.eclipse.org/downloads/download.php?file=/oomph/epp/neon/R1/eclipse-inst-win64.exe
- 2. Go through configuration
- 3. Create a Java file > Click the the Window with a yellow star on the top left (located on the icon row (first icon))
- 4. ONLY NAME IT, Click next then finish MAKE SURE U NAME IT WITH me.(name)
- 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
- 6. Create a class > click the icon with a green circle with a C inside it! then rename it ONLY
- 7. Here is what u put in it. THIS IS AN ANTI CURE PLUGIN
- package me.YOURNAME;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.AsyncPlayerChatEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- public class AntiCurse extends JavaPlugin implements Listener {
- @EventHandler
- public void onPlayerChat(AsyncPlayerChatEvent e) {
- for (String word : e.getMessage().split(" ")) {
- if (getConfig().getStringList("badwords").contains(word)) {
- e.setCancelled(true);
- e.getPlayer().sendMessage(ChatColor.GOLD + "" + ChatColor.BOLD + "(!) " + ChatColor.YELLOW + "Please don't say that word again! Its a bad word.");
- }
- }
- }
- public void onEnable() {
- getConfig().options().copyDefaults(true);
- saveConfig();
- Bukkit.getServer().getPluginManager().registerEvents(this, this);
- }
- }
- 8. THEN right click (YOURNAME) folder and create a new file. name it config.yml then inside that put
- badwords:
- - example1
- - example2
- 9. then same thing but create a new file and name it plugins.yml then inside that put
- name: YOURPLUGIN NAME
- version: 1.0
- main: me.YOURNAME.AntiCurse
- description: Stop cursing!
- 10. THen when ur done right click the folder and export it. Click on Java then JAR file
- 11. UNCHECK .classpath and .project
- 12. put the plugin in the folder you want to put it in
Advertisement
Add Comment
Please, Sign In to add comment