Solved Please help me!!

Discussion in 'Plugin Help/Development/Requests' started by Flawless_Programming, Oct 30, 2016.

Thread Status:
Not open for further replies.
  1. Hi. I have been programming for a long long while but things changed. Before i used eclipse when i was coding bukkit, everything were fine but something happend. All the plugins stopped working, i tryed to make new small plugins to see if my code were incorrect (which it wasn't). I downloaded intellij instead to see if that was working. In the beginning it did but today something happend again. When i put my plugins on the server, it tells the console it runs with the "onEnable" its also in the server if i type /plugin. However no commands are working and not eather any events. Its just like its reading the onEnable and then just stops. Do ANYONE know how to fix this and what the problem is. Alot of people have been trying to help me but nobody succed.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Well i just tryed to reinstall intellij so all that codes are probably gone. I'll make a new test plugin in 5 min and see if it works. Then i'll post it here

    Okey. I done a new small test plugin to see if anything is working. I can't rly see any problems in it since this worked before and not now but here's the code:

    Main class:


    Code:
    package me.flawless.ffa;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.entity.EntityExplodeEvent;
    import org.bukkit.event.player.PlayerDropItemEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    
    /** * Created by ***** on 2016-10-30. */public class core extends JavaPlugin {
    
    public void onEnable() {
    System.out.println("TEST has been enabled!");
    }
    
    public void onDisable() {
    System.out.println("TEST has been enabled!");
    }
    
    public boolean onCommand(Command cmd, CommandSender p, String label, String[] args) {
    if (cmd.getName().equalsIgnoreCase("testcommand")) {
    p.sendMessage(ChatColor.RED + "Hello");
    Bukkit.broadcastMessage("This is a broadcast message!");
    }
    return false;
    }
    
    @EventHandlerpublic void onEntityExplode(EntityExplodeEvent e) {
    e.setCancelled(true);
    }
    
    @EventHandlerpublic void onDrop(PlayerDropItemEvent e) {
    e.setCancelled(true);
    }
    }
    
    Plugin.yml:

    Code:
    name: ffa
    main: me.flawless.ffa.core
    version: 1.0
    commands: 
      testcommand: 
        description: This is a test command.
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 30, 2016
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    timtower Administrator Administrator Moderator

    @Flawless_Programming Works fine:
    Code:
    [20:07:44 INFO]: [ffa] Enabling ffa v1.0
    [20:07:44 INFO]: TEST has been enabled!
     
  6. @timtower no that's the problem, it is into the server and the console tells me it works fine. But if u look at the code above there is a command and two events. These does not run and i don't know why. Dosn't matter what i put in there. It does not run it. Any ideas why?
    @timtower
     
  7. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page