Items not stacking

Discussion in 'Spigot Plugin Development' started by BakedPotato_HD, May 13, 2016.

  1. Hello,
    My problem is:
    I want to drop an item somewhere and have it not being moved, but if someone drops another item close to the first item then they will stack together and the first item will be moved. I read that this wouldn't happen if the first item has a FixedMetadataValue. How could I give the item an FixedMetadataValue? or does anybody know another solution?
    Thanks
     
  2. This has been asked before, and answered many times over. Try searching next time ;)

    Code (Text):

    itemstack.setMetadata("Data Name", new FixedMetadataValue(plugin,"Data Value"));
     
     
  3. I was searching a lot and I really didn't find anything, sorry.
    Does it matter what I write instead of "Data Name" / "Data Value"?
    does
    Code (Text):
    item.setMetaData()
    also work?
    Thank you!