Doesn't display text when the event is executed

Discussion in 'Plugin Development' started by KoT_B_MaMe, May 27, 2022.

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


    Hi all. I am quite new to plugin development. I'm trying to create a very simple plugin, which should write text to the player when the player enters and display the second text when the right mouse button is pressed. Here is the code:

    package spamshit.yadebil;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.ItemStack;

    public final class Yadebil extends JavaPlugin {

    public void onEnable() {
    getLogger().info("SpamGovno is working!");}
    public void onDisable() {
    getLogger().info("SpamGovno is disabled!");}
    public void onJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    player.sendMessage(ChatColor.GREEN + "text1");}
    public void onItemClick(PlayerInteractEvent e) {
    if(e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
    ItemStack item = e.getItem();
    if(item == null) return;
    if(item.getType() == Material.DIRT){
    e.getPlayer().sendMessage("ты хуесос");
  2. Offline


  3. Offline


    why is your class final?
  4. Offline


    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page