Need help with block levitation.

Discussion in 'Plugin Development' started by guthman01, Feb 7, 2016.

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

    guthman01

    I am coding an ability type plugin and I need some help. I need to make a plugin that

    1. Removes an item from your inventory when a command is run, and keeps removing that item, 1 per second, until another command is run. When this starts, the below action happens, and when it stops, the below action stops. This sort of acts as an "ammunition" or "Mana" system.

    2. Shoots 4 blocks in different directions (Forward, Behind, Left, and Right). I need the actually block to move and appear. It also needs to do about 2 hearts of damage when the block hits a player entity. It has a range of about 10 blocks, and when it lands/hits someone it disappears.

    I know how to make a simple plugin, as well as some event handling, I just need some help with those two things. Please don't try and code the entire plugin, I don't mind some snippets, but I really want to try and grow as a developer. Thanks!
     
  2. Offline

    teej107

    @guthman01 Do you want someone to help you write this?
     
  3. Offline

    Evonoucono

    I don't think asking for help with something this big is going to get you any. That is not the point of the Plugin Development forum. Give your plugin an attempt, and if you have any problems and you can't find a solution on your own/by Google then you can make a post here asking for help. Your asking for something too broad.
     
  4. I agree with @Evonoucono give it a shot, post bugs here, and we will help u out
     
  5. Offline

    guthman01

    Ok, thanks for the feedback. Could I start by asking you about starting something with a command, and then stoping it with another, as well as that mana/cost system I explained?
     
  6. Offline

    teej107

  7. Offline

    Evonoucono

    @guthman01
    For a toggle command you can enable something for a player by adding their name/uuid to an arraylist and remove it with another command. To see if it's enabled for the player just check if it contains the players name/uuid. (the contents of the arraylist will be erased on reload/on disable.) If you want a toggle that applies to the entire server, just use a boolean variable that is not player specific, and change it to true/false.
    To remove an item every second in the inventory of a player look at the link teej gave. Schedular tasks allow for code to be delayed and or repeated multiple times which is probably what you need.
     
Thread Status:
Not open for further replies.

Share This Page