Advertisement
er1one

Разработка плагинов для Minecraft. Эпизод #1. Твой первый плагин

May 23rd, 2022
1,141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ru.er1one.firstplugin;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.player.PlayerJoinEvent;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public final class FirstPlugin extends JavaPlugin implements Listener {
  11.  
  12.     @Override
  13.     public void onEnable() {
  14.         getLogger().info("I've been started!");
  15.         Bukkit.getPluginManager().registerEvents(this, this);
  16.     }
  17.  
  18.     @EventHandler
  19.     private void onJoin(PlayerJoinEvent event) {
  20.         event.getPlayer().sendMessage(ChatColor.GOLD + "Wassup!");
  21.     }
  22. }
  23.  
Advertisement
RAW Paste Data Copied
Advertisement