Stop Items Merging?

Discussion in 'Plugin Development' started by MrTwiggy, Feb 4, 2013.

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

    MrTwiggy

    Hey, there. Here's my situation and what I'm trying to do.

    I'm trying to create an item 'explosion' of sorts, where I spawn several Item's (dropped items) in a location and launch them in random directions with a random velocity. However, if I do this using world.dropItem(item info) and set the velocities, it will spawn them and launch them, but then clumps of the items merge together (IE: They were stack sizes of 1 item, but that merged into stacks of 3-4) and mess with the velocity/look of it.

    Anyone have any solutions for something like this? Any way to stop them from merging? I saw another thread with a potential solution of just sending fake item entity packets to the players, however, if I send the Entity packet (0x1E) to create an entity, I won't be able to send a packet to modify the velocity / delete the entity later, since those require EID's, which as far as I'm aware only exist for real Entities.

    Any help would be appreciated.
     
  2. Offline

    RealDope

    So if you do:

    Code:JAVA
    1.  
    2. world.dropItem(new ItemStack(Material.APPLE, 1);
    3. world.dropItem(new ItemStack(Material.APPLE, 1);
    4.  


    They still group together?
     
  3. Offline

    MrTwiggy

  4. Offline

    ohtwo

    Are you by any chance running Spigot?
     
  5. Offline

    MrTwiggy

    Yes, I am. Why? Would this affect it?

    EDIT: Err, actually, I'm not sure. I was, but I may have accidentally swapped. How do I deal if I'm running it atm?
     
  6. Offline

    Jeyge

    Spigot is what causes the items to merge. There are also a couple of plugins that could do it too although the plugins won't do as good of a job as Spigot. If you want to turn it off, I seem to remember there was an option to do that in the bukkit.yml file.
     
  7. Offline

    Phinary

    Open bukkit.yml and change your item drop radius to 0. This is from spigot and/or CB++.
     
  8. Offline

    ohtwo

    Yep! Like the others said, it causes items to merge. It was added as to increase performance (less entities I guess).
     
  9. Offline

    Jeyge

    And it makes a huge difference. It really helps us when we switched to Spigot. People were leaving crap everywhere adding to the number of entities in the world but having the items join each other took care of that. As well as making it much easier to pick up groups of items while not having to try to run over everything.
     
    ohtwo likes this.
Thread Status:
Not open for further replies.

Share This Page