Owndrops plugin

Discussion in 'Archived: Plugin Requests' started by dark_hunter, Jun 25, 2011.

  1. Offline


    Wanted to know if this can be made. When you break items or blocks the drops only show for you then after a time they show for all, for all those who have played Runescape would understand.
    TheTrixsta likes this.
  2. Offline


    ill start this :D
    dark_hunter likes this.
  3. Offline


    Good luck @TheTrixsta, hope to turns out great.
  4. Offline


    @dark_hunter still doing research but cant find anything in the javadocs to help :(
  5. Offline


    Isn't there a player pickup event you could toy around with?
  6. Offline


    I doubt you could make it only 'show' for one person, thats probably down to the minecraft client. Making the drops so they can only be picked up by the editor is very likely to be possible.
  7. Offline


    Cool idea. Would be nice so people can't steal your items while mining.
    But is it possible?
    dark_hunter likes this.
  8. Offline

    Celtic Minstrel

    There's four parts to this suggestion... one is that dropped items belong to a certain player, another is that others can't pick up your items, and the third is that they can't see them. The second and third rely on the first. And the fourth part is that after some set time the ownership expires.

    The second is relatively simple; just catch and potentially cancel the item pickup event.

    The third may be a bit harder. It's theoretically possible to show different entities to each player, but I don't think there is any API to handle such things. Unless there's a setVisibility method in Entity; I vaguely remember hearing something about something like that awhile back.

    The first is probably the hardest part; you would need to (at minimum) catch the vehicle/block/entity/painting damage events to determine who dropped the items, and then catch the item spawn event to assign ownership of the items to that player. There may be some quirks to it, though, especially if used in conjunction with certain other plugins such as OtherBlocks (though OtherBlocks might help you figure out how to do it, since it does a similar thing). It's probably not quite as easy as it sounds, anyway; nevertheless, I'm fairly sure it would be possible.

    The final part is really easy if you've figured out how to do the third; just set a timer.
  9. Offline


    It doesn't have to been hidden, just not be able to be picked up then after some time, then after that, they can pick it up.
  10. Offline

    Celtic Minstrel

    Nevertheless, it is possible to make it hidden.
  11. Offline


    There's almost guaranteed to be a really obscure CraftWorld/CraftServer command that sends an ItemStack destroy or whatever packet, similar to Packet29EntityDestroy that is used to make players invisible.

    I'd say that this plugin isn't technically challenging so much as it is to find the methods you need and to get everything in order.
  12. Offline

    Celtic Minstrel

    Uh, I would have assumed that packet 29 is the one you need, since when sitting on the ground an item is an entity.
  13. Offline


    You want to give this a shot? I'm working on 3 plugins at the moment. :D
    EDIT: Yeah, item drops are entities.
    You could "claim" drops by using getNearbyEntities (there's probably a better way but that's a quick and dirty solution) to the location where the drops are to make a list of the drops, then send out Packet29 as needed and set a timer on them. The rest is obvious.
  14. Offline


    I don't believe this would be possible without a client Mod.
    Notch I think would need to implement this himself.

    (^^ that's if you're looking for the drop to be hidden ^^)

    But you could disable the ability to pick it up for others pretty easily.
  15. Offline


    No, it is possible :D
  16. Offline

    Celtic Minstrel

    So am I. :p I'm not going to claim this one at this time. Might consider it eventually if no-one else gets to it in the meantime, though.

Share This Page