Discussion in 'Plugin Development' started by jolbol1, Jul 29, 2013.

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


    Hi, im trying to implement battle arena so i can make arenas for a the plugin im developing the trouble is im not sure what to do, i have two class files, the main one and the arena one and the game is called gungame. i have implemented it i think and i ran it all through the console. it retured a this error
    23:28:33 [SEVERE] java.lang.NullPointerException
    23:28:33 [SEVERE]    at mc.alk.arena.util.FileUtil.getInputStream(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController.loadFile(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController._registerCompetition(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController.registerCompetition(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController.registerCompetition(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController.registerCompetition(
    23:28:33 [SEVERE]    at mc.alk.arena.controllers.APIRegistrationController.registerCompetition(
    23:28:33 [SEVERE]    at mc.alk.arena.BattleArena.registerCompetition(
    23:28:33 [SEVERE]    at me.jolbol1.gungame.GunGame.onEnable(
    23:28:33 [SEVERE]    at
    23:28:33 [SEVERE]    at
    23:28:33 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    23:28:33 [SEVERE]    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(
    23:28:33 [SEVERE]    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(
    23:28:33 [SEVERE]    at net.minecraft.server.v1_6_R2.MinecraftServer.l(
    23:28:33 [SEVERE]    at net.minecraft.server.v1_6_R2.MinecraftServer.f(
    23:28:33 [SEVERE]    at net.minecraft.server.v1_6_R2.MinecraftServer.a(
    23:28:33 [SEVERE]    at net.minecraft.server.v1_6_R2.DedicatedServer.init(
    23:28:33 [SEVERE]    at
    23:28:33 [SEVERE]    at
    and it didnt let me do the command /gg
    heres my code
    GunGame Class
    package me.jolbol1.gungame;
    import mc.alk.arena.BattleArena;
    import mc.alk.arena.util.Log;
    import org.bukkit.configuration.file.FileConfiguration;
    public class GunGame extends JavaPlugin{
        public void onEnable(){
            /// Registers this plugin with BattleArena
            /// this: our plugin
            /// "Paintball": The name of our competition
            /// "pb": the name of our command alias ( who really wants to type in the entire word paintball?)
            /// PaintballArena.class: which arena should this competition use
            /// Register a Paintball
            BattleArena.registerCompetition(this, "GunGame", "gg", GunGameArena.class);
            /// create our default config if it doesn't exist
            /// Load our config options
  "[" + getName()+ "] v" + getDescription().getVersion()+ " enabled!");
        public void onDisable(){
  "[" + getName()+ "] v" + getDescription().getVersion()+ " stopping!");
        public void reloadConfig(){
        public void loadConfig(){
            /// Allow the damage to be set through the config.yml, if it exists and has the section: 'damage: <value>'
            /// Like 'damage: 15'
            FileConfiguration config = getConfig();
    Gungamearena class
    package me.jolbol1.gungame;
    import mc.alk.arena.objects.arenas.Arena;
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Player;
    import org.bukkit.event.entity.EntityDamageByEntityEvent;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    public class GunGameArena extends Arena{
        static int damage = 20;
        * This is how you create customized events.  You specify a method as a @MatchEventHandler
        * and give it at least one bukkit event as the first argument.  In this case its EntityDamageByEntityEvent
        * These events will ONLY be called when a match is ongoing
        * If the event returns a player (in this case it does) then the event only gets called when
        * 1) match is ongoing
        * 2) player is still alive in the match
        * @param event: Which bukkit event are we listening to
        public void onKill(PlayerDeathEvent e) {
            String prefix = ChatColor.GOLD + "[GunGame]" + ChatColor.RESET;
            Player killer = e.getEntity().getKiller();
            Player killed = e.getEntity();
            String killername = e.getEntity().getKiller().getName();
            if(killer.getInventory().contains(Material.WOOD_HOE)) {
                for (ItemStack i : killer.getInventory()) {
                    if (i.getType() == Material.WOOD_HOE
                          && i.hasItemMeta() && i.getItemMeta().hasDisplayName()
                          && i.getItemMeta().getDisplayName().equalsIgnoreCase("B23R")) {
                        ItemStack item = i;
                        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "shot give " + killername + " kap-40");
  2. Offline


    jolbol1 The problem is at this point:
    1. BattleArena.registerCompetition(this, "GunGame", "gg", GunGameArena.class);

    Could you show us the Class BattleArena
  3. Offline


    i dont have a battle arena class, thats in the jar battlearena. its a api
  4. Offline


    jolbol1 Ohh okay. I don't know how this API is working so I can't help you :( But there is something wrong in this line. Maybe you should check again the Page of the API to see how it normally should be?
  5. Offline


    BattleArena source code is found here.
Thread Status:
Not open for further replies.

Share This Page