1

My Plugin code Is Not Working..

MLGChris333 4/4/16 6:16 am
497
4/4/2016 6:51 am
Here is the code.... It won't work - when I do /plugins it shows no plugins

The code is supposed to give a player a diamond pickaxe when they type /bb
I will also give my config.xml file.

BB.java Is Below.
===========================================
package com.enjin.mlgplugins333.BB;

import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public class BB extends JavaPlugin {




@Override
public void onEnable() {
getLogger().info("BB Has Been Enabled.");
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(cmd.getName().equalsIgnoreCase("BB")) {
Player.sendMessage("Giving Diamond Pickaxe.");
ItemStack pick = new ItemStack(Material.DIAMOND_PICKAXE);
Player.getInventory().addItem(pick);
return true;

}



return false;

}





@Override
public void onDisable() {
getLogger().info("BB Has Been Disabled.");

}
}
===============================================
config.xml Is Below
===============================================
main: com.enjin.mlgplugins333.BB.BB
version: 1.0
name: BB

commands:
BB:

================================================

I also use eclipse btw..

Please help!
Posted by
MLGChris333
Level 4 : Apprentice Miner
1

  Have something to say?

JoinSign in

10

Scott
04/04/2016 6:23 am
Level 40 : Master Droid
Its not config.xml, its config.yml
1
Scott
04/04/2016 6:23 am
Level 40 : Master Droid
Right click on the project > new > other > call it plugin.yml
1
Scott
04/04/2016 6:26 am
Level 40 : Master Droid
And you did not do the YML correct, so I made one for you: http://pastebin.com/HtrnWPvF
1
MLGChris333
04/04/2016 6:35 am
Level 4 : Apprentice Miner
No... I think it's now my code. D: Please help
1
Scott
04/04/2016 6:40 am
Level 40 : Master Droid
In the yml, that you made an XML, you missed Description. use my template.
1
MLGChris333
04/04/2016 6:44 am
Level 4 : Apprentice Miner
I have fixed that.. But it still is not working
1
Scott
04/04/2016 6:41 am
Level 40 : Master Droid
There is nothing wrong with your code, looking at it.
1
Scott
04/04/2016 6:47 am
Level 40 : Master Droid
Use my template, you are missing things in your YML. Copy and paste it.
1
MLGChris333
04/04/2016 6:51 am
Level 4 : Apprentice Miner
Please..
1
MLGChris333
04/04/2016 6:47 am
Level 4 : Apprentice Miner
hmmm... When I join on 1.9, it says "I am outdated! I am still on {0}"


Any help?
1

Welcome