Solved Bukkit Developer/API Documents for Newbies?

Discussion in 'Plugin Development' started by aberts10, Apr 21, 2015.

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


    I've been working on updating a old plugin called "Physix" to make it cleaner and easier to update in the future, and I've come here in a last desperation because I could find very little on the bukkit api.... I cannot find any resources for my specific needs, and I'm not 100% sure that my approach will work. As this is a Physics plugin I need to be able to Detect block position on player place, Check For other blocks that are touching the first one to the top/bottom and sides, and count out how many blocks are connected to the first one that the player placed up to a configured limit (Ex: 5). Move all '5' blocks to the lowest point possible without deleting or moving the blocks below, and if the player tries to extend beyond that configured 5 block limit without creating a pillar that is connected to other solid blocks directly below then it will all fall to the lowest point possible.

    While I know that this sounds like a lot for my first project in bukkit, It would be extremely helpful if someone could give me some ideas, A point in the right direction, or the most preferable: Where I can find more about Spigot/Bukkit api. I do have some background in other programming languages so I am not a total beginner in this sector, but I am definitely not seasoned in any way with Modules/Api development in java.

    In simple terms/complex terms depending on how you view it, here's what I plan on doing with bukkit's API (This is just to make sure I covered everything as exact as I can). I create a infinite update loop to constantly check for a player block-place event. It sends the type of block to another part in the Plugin to check against the blacklist which then if it passes returns true and then executes the Block drop function. The block drop function checks the number of blocks away from the last Ground connected block, and if its more than the configured horizontal block limit size in the config it will fire the Block-fall function which will change all (5) block's horizontal positions that are 1 block past the last verticle connection to the ground to the lowest possible position without going into the terrain.
    Last edited: Apr 21, 2015
  2. Offline


  3. Offline


    Simply react to the BlockPlaceEvent. As @meguy26 said above, read up on what Bukkit actually does for you as most of what you explained is fairly simple implementation. Since you state you know programming, you should fairly quickly be able to get up to speed on Bukkit.

    Once you do, post some code of what you have attempted and we can nudge you in the right direction a bit better.
  4. Offline


    Does the blockplace event cover everything i need? Will it let me Search for blocks at different vectors/ XYZ cords? Or do i need to use another event something along the lines of 'blockdetection' to get the XYZ cordanites which i can seperate and use update the Y cordanites of each block and change all of them as close to 0-11 (Bedrock) without breaking any blocks and if a block is in the way only go say 4 down? Like i said, i am not at all experienced with API development so this is all new to me, i mostly had a friend help me with my chat projects as he was alot more experienced and Gave me a 'template' to work off of.
    Last edited: Apr 22, 2015
  5. Offline


    BlockPlaceEvent fires when a player places a block and what block it is. You don't need an event to get a block at a specific location as you can do that whenever you want unless you are specifically waiting for something to happen before doing so.
  6. Offline


    Well after i get the block place i can't just move it five blocks down and be done. I need to check every block related to that player placed one. Is it connected to the ground already? Is it floating, if so move it to the ground? How far away from this player placed block is the last 'structure' that is holding up the Building. I need to be able to detect blocks and move blocks. And BlockPlaceEvent seems to only Check when a player places a block. I need something else that will fire after the BlockPlace to check for block locations so that i can then calculate where to move the blocks and ether Keep track of the first blocks and create new ones in the diffrent location, or teleport them to a diffrent location.

    I made some confusion here: i needed a event to fire off the Check's so that it would carry out the task correctly.
    Last edited: Apr 22, 2015
  7. Offline


    @aberts10 If you have a doubt of what stuff you have access in an event, you can always check the javadocs for it (someone linked them before)

    You can't place blocks in the air normally, so this event won't be called in this case in normal conditions.
    For structures, you need to calculate that manually, if possible.
  8. Offline


    I understand. think i confused everyone a bit... But i meant to say that i needed to have a event so that i could See if the player placed a block, and apply gravity to the correct number of blocks. Im currently looking through the docs to see what classes/Events i can use. Thanks.
Thread Status:
Not open for further replies.

Share This Page