most recent 30 from gaming.stackexchange.com2026-03-01T05:21:03Zhttps://gaming.stackexchange.com/feeds/question/396850https://creativecommons.org/licenses/by-sa/4.0/rdfhttps://gaming.stackexchange.com/q/3968503just4funn9https://gaming.stackexchange.com/users/2894752022-04-18T13:57:26Z2022-06-09T06:15:40Z
<p>I'm currently making a trading system on my Minecraft server. You drop an item that spawns a dropper with a small UI. There are 2 empty slots where both players will put a custom player head from their inventory. These heads are the collectibles on my server. But my problem is that I can't prevent players from just taking the heads and leaving. I tried to give the heads inside of the dropper a custom nbt but I don't know how to do that. I also can't just clear the heads from the inventory because a player can have more than one head. I don't want to use data packs or plugins for this but I'm out of ideas...</p>
https://gaming.stackexchange.com/questions/396850/how-do-i-prevent-other-players-from-taking-items-out-of-a-dropper-1-18-2/397652#3976521user291314https://gaming.stackexchange.com/users/02022-06-09T05:59:35Z2022-06-09T06:15:40Z<pre><code>/data merge block [pos] {Lock:"[password]"}
</code></pre>
<ul>
<li><p><code>[pos]</code> means the position of the dropper (you need to place it down first)</p>
</li>
<li><p><code>[password]</code> means the password to unlock it (if you want it permanently locked just spam a bunch of random chars)</p>
</li>
</ul>
<p>To change the password, do the same command but with a different Lock key value.</p>