Need a little bit of help please

Discussion in 'Plugin Development' started by mason1370, Feb 23, 2012.

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

    mason1370

    So im working on a plugin that when the player types in the certain command like /return
    and then clicks on a certain block (so it has to run though the certain block ids to make sure it is one that can follow this code)
    when it clicks on one of the blocks that has the ids that match it will drop that block and then do damage to what there holding

    so it would work like /return then holding a shear and clicking on glass would drop glass and then do damage to the shears

    i was wondering what code you write to get it to run though the block id and then give you that back

    any help?
     
  2. Offline

    Nitnelave

    Do you have any programming background? If you don't, I would suggest starting by learning java.
    If you know what you're doing, though, you would have to keep a list of the layers who recently typed /return.
    You will also need to listen to a blockDamage or playerInteraction event, depending on what do you want the click to be. You get the block from the event, match the id against a hard-coded list (or one you load from a file), check the item the player has in hand (you get the player from the event, too), check the it is a tool (matching the id against another list) then change the damage value (don't forget to destroy the item if the value is 0). If all of the checks are ok, the you spawn a block or the corresponding ID, and destroy the targeted block.

    If it is your first plugin, you might want to start with something moree simple, like simply displaying text when a user types a certain command, for example. Get used to general plugin coding, listeners, and commands.

    Once you're done, you can think about permissions!
    Good luck!
     
  3. Offline

    mason1370

    thanks nitnelave im just starting out with java i know a good amount and though i would make some bukkit plugins i will try an easier one and then work up from there
     
  4. Offline

    Nitnelave

    Don't worry, we've all been through that. You'll see, in a month you'll have a very nice plugin!
     
Thread Status:
Not open for further replies.

Share This Page