I'm making an adventure map and at some point, the player had the choise to get an Item of this inventory twice by droping his item on a dropper and get it back twice on a chest.
Can this kind on stuff be made with a command block?
If I'm right, you want the player to drop an item into a hopper linked to a chest, and this chest would contain the item twice?
Well it's quite simple : the following command will do the job. However, you will need to trigger it once the item gets into the chest (something like comparator), and take care to make it only triggerable once so the player could not exploit it.
Some requirements : the player must only drop 1 item (not a stack) and the chest must be empty in order to work
/data modify block [Chest XYZ] Items[0].Count set value 2
How it works : The command search for the number of items in the first chest's filled slot, then set it to 2. Notice that even non-stackable items can be stacked this way. However, if the item has not reached the chest yet when the command triggers, nothing will change.
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
Hello guys.
There's the situation.
I'm making an adventure map and at some point, the player had the choise to get an Item of this inventory twice by droping his item on a dropper and get it back twice on a chest.
Can this kind on stuff be made with a command block?
Can somebody help me on that ?
Thanks a Lot.
Peace
It's a bit weird but you can clone a chest that contains the item.
You mean "Hopper"?
If I'm right, you want the player to drop an item into a hopper linked to a chest, and this chest would contain the item twice?
Well it's quite simple : the following command will do the job. However, you will need to trigger it once the item gets into the chest (something like comparator), and take care to make it only triggerable once so the player could not exploit it.
Some requirements : the player must only drop 1 item (not a stack) and the chest must be empty in order to work
How it works : The command search for the number of items in the first chest's filled slot, then set it to 2. Notice that even non-stackable items can be stacked this way. However, if the item has not reached the chest yet when the command triggers, nothing will change.
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).