First plugin, need help.

Discussion in 'Plugin Development' started by jmcneely, Aug 11, 2011.

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

    jmcneely

    I've been running a server for a while now and I've always wanted to develop my own plugins. I've read a tutorial and know a bit of what I'm doing but I still get really confused. It would be easier for me to learn if I had someone to guide me through and tell the dos and don'ts.

    I started a simple plugin to just basically disable the placement of TNT, anyone without the permission node can't place TNT. I've been looking at a plugin called TNTWarner and been using most of the coding that is already there but subtracting things I don't want or changing things I want changed.

    If anyone is kind enough to be my teacher I would really appreciate it. Here is the work I already have NoTNT, If the name is already taken I can change it.
     
  2. Offline

    thehutch

    No offence but please don't post this plugin to bukkit because there are hundreds of them already but of course make it, if it helps you learn it what I did first. But please don't post it and i'm sure someone would love to help you learn Java I myself am learning
     
  3. Offline

    codename_B

  4. Offline

    jmcneely

    Hahaha, no I wont be posting it. I already know bukkit is full of clone plugins. I just thought this would be simple enough to make it my first plugin and will only be using it on my server.

    Thanks, I'll take a look at it.

    I think I almost have it but I am getting 2 error. on the line:
    Code:
    public boolean checkpermissions(Player player, String string, Boolean standard)
        {
            return player.isOp() ? true : (usingpermissions ? Permissions.[U]has[/U](player,string) : standard);
        }
    For has it says "The method has(Player, String) is undefined for the type permission" I've been on this error for 2 days now and don't know what to do.
    Code:
    pm.registerEvent(Event.Type.BLOCK_PLACE, (Listener) [U]blockListener[/U], Event.Priority.Normal, this);
    For blockListener it says "blockListener cannot be resolved to a variable"
     
  5. Offline

    thehutch

    post your main class and blockListener
     
  6. Offline

    Nitnelave

    Well, for the first one, instead of Permissions.has, you have to use the instance of PermissionHandler you declared (see here).
    And for the second one, you have to declare blockListener before, as a BlockListener.
     
Thread Status:
Not open for further replies.

Share This Page