Chopped,Mined etc Items go straight to inventory!!

Discussion in 'Archived: Plugin Requests' started by Daniel Few, May 25, 2011.

  1. Offline

    Daniel Few

    Heya
    I was wondering if someone could make a plug-in which does this:

    When you mine a block, instead of it dropping on the ground and waiting to be picked up, it goes straight into your inventory.

    Im guessing this could be done by cancelling the block destroy drop event and giving you the item instead.

    I have looking through the Bukkit API but am not ready to make my own yet.
    Thanks
    -DanJames
     
  2. Offline

    captainawesome7

  3. Offline

    Daniel Few

    If you could that would be great, and thanks for replying. I'm opening my RPG server Friday, do you think you would be able to before then if possible? Sorry to be a pain :(
    -DanJames
     
  4. Offline

    captainawesome7

    @Daniel Few Actually, I'm super lazy, so adding all of the "special cases" (times where the broken block doesn't equal the drop) is just too much.
     
  5. Offline

    Daniel Few

    @captain
    Ok, don't worry :) I'll do it myself when I have time, I'll just have to have the drops until I can :p
    Thanks anyway for replying :)
    Btw what do you mean by 'Special Cases'
    -DanJames
     
  6. Offline

    captainawesome7

    @Daniel Few Well, creating a plugin that gets the player, player's inventory, and the dropped block and then creating an item stack with the same ID as the block and adding it to the player's inventory takes about 5 minutes. BUT, when you break a diamond ore, you don't get diamond ore, now do you? Same goes for grass, redstone, all blocks that have different item icons (redstone, doors), stairs, etc.. And you would have to set the durability for wool, steps, saplings, and logs as well. I'm just lazy :p
    I can get this done by Friday though. I will probably do it tomorrow if that's okay.
     
  7. Offline

    Daniel Few

    Sorry to be a pain, but did you manage to do this, if you didn't it really doesn't matter, just so that if you did it didn't go to waste :)
    -DanJames
     
  8. Offline

    captainawesome7

    @Daniel Few Well, I started it but changed it into a different plugin that did a completely different thing (CustomDrops) and totally forgot what the original purpose was. The only problem with what you want is that the block break events won't be picked up by LogBlock, WorldGuar, or any other logging plugin.
     
  9. Offline

    Daniel Few

    @cap
    Well for what i want to use it for, i do not believe that will be an issue. However i know you'd want to release it and it would mean making it compatible for others.
    If it's too much don't worry :) But thanks for considering it.
    -DanJames
     
  10. Offline

    Daniel Few

    Anyone else interested in making this?
    Please ask if you need more information..
    -DanJames

    Can anyone suggest me with ideas on how this could be made, if you don't want to make it yourself?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  11. Offline

    captainawesome7

    @Daniel Few It's pretty easy, you just need to add a block listener, and use onBlockBreak. Then just pop in some code that just makes new itemstacks with the id of the broken block, with exceptions (grass, stone), you basically need to add code for every time in minecraft when you don't get exactly what you break. Also, you need to add durability for wool, etc. Not hard, but will take a while.
     
  12. Offline

    Daniel Few

    @captainawesome7
    What do you mean, 'durability for wood' :/
    I have looked through the API so feel free to use code in your post :p
    -DanJames
     
  13. Offline

    captainawesome7

    @Daniel Few lol I mean wool, but it does carry over for logs. I can put some code in here later, I'm too lazy to set up the plugin, but the main code is very basic
     
  14. Offline

    Daniel Few

    @captainawesome7 kk thanks. I can do all the long bits such as doing it for each block, i'm just not sure of the main code :p
    -DanJames
     

Share This Page