1

Inventory swap?

web_warrior_geo_1's Avatar web_warrior_geo_12/28/24 1:57 pm
1 emeralds 103 1
2/28/2024 3:12 pm
michaelo's Avatar michaelo
anyone know the easiest/simplest way to swap 2 players' inventories?
Posted by web_warrior_geo_1's Avatar
web_warrior_geo_1
Level 1 : New Miner
1

Create an account or sign in to comment.

1

3
02/28/2024 3:12 pmhistory
Level 32 : Artisan Chef
michaelo
michaelo's Avatar
One way would be to use the shulker box trick. You copy the inventories to shulker boxes, and then alter the loot table of the shulker boxes to drop their contents when mined, which means you can use the loot command to give a player the loot from them (downside is it won't keep the right slots). It's a bit complicated, here's a better explanation/tutorial:
https://www.reddit.com/r/MinecraftCommands/wiki/questions/modifyinventory/

Alternatively you could copy the players' inventories to storage, and then iterate through the inventory lists to give each item using the /item command and macros.

Unfortunately all methods are a bit tricky, if you're unsure I'd recommend getting some closer help from someone, for example from the Minecraft Commands discord or Datapack Hub.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome