๐๏ธ tryashtar ยท 41 points ยท Posted at 02:26:11 on November 6, 2015 ยท (Permalink)
GloomySevereAntarcticgiantpetrel
๐๏ธ tryashtar ยท 5 points ยท Posted at 02:30:14 on November 6, 2015 ยท (Permalink)
Hey. I made another thing with command blocks: Potion Bags. Throw five leather and one string on the ground to get a potion bag.
A potion bag works differently from a normal bucket in that its only right-click function is "attempt to open the bag." The bag will be opened if you are only holding one in a stack and there are potions in the bag.
Any bag can hold up to three potions. It works with every vanilla brewable potion, along with potions of luck and water bottles. It supports drinkable, splash, and lingering potions.
The bags are totally multiplayer-friendly. All the potion data is stored in the bag item itself. You can have multiple bags and your friend can have multiple bags, and they will all hold their own potions. Right-click to open the bag, throw potions onto the bag to store them. Remember it can only hold up to three.
This is a massive pile of nearly identical commands, so you need three one-click things to get this into your world. Here they are:
[deleted] ยท 3 points ยท Posted at 13:56:07 on November 6, 2015 ยท (Permalink)
[deleted]
๐๏ธ tryashtar ยท 3 points ยท Posted at 22:00:19 on November 6, 2015 ยท (Permalink)
Here's kind of a technical explanation:
As you probably know, you can store arbitrary NBT inside of items. Each bag was given three such tags, all compounds: Potion1, Potion2, and Potion3.
Each one of those compounds stores two strings and a byte: type, effect, and filled.
When you craft a bag, all three filled tags are set to 0. When you drop a potion, it tries to put itself in the first slot that isn't filled.
The potion gets scores based on what type (drink, splash, lingering) and what effect (harming, speed 2, long jump boost, etc.) it has.
If it can find a slot to occupy, it sets that slot's data to match its own.
When you right click, it creates an item entity for each "filled" slot, then does /entitydata to set its type and effect.
I hope that was understandable. If you have any other questions, just ask!
[deleted] ยท 2 points ยท Posted at 02:50:15 on November 7, 2015 ยท (Permalink)
[deleted]
๐๏ธ tryashtar ยท 2 points ยท Posted at 03:21:51 on November 7, 2015 ยท (Permalink)
Thank you, that really means a lot to me!
I do have a YouTube account (tryashtar), but no videos yet. Some people have expressed interest, so I might start making some short basic videos showing off contraptions I've made.I just need something better than Movie Maker :P
Guyguy22 ยท 3 points ยท Posted at 05:43:44 on November 6, 2015 ยท (Permalink)
Can you rename the potion bag for better organization, or will that cause the system to not work properly? Either way, I really like this :)
๐๏ธ tryashtar ยท 1 points ยท Posted at 05:54:57 on November 6, 2015 ยท (Permalink)
You can rename the bag and it will still work, but its name will be reset when it is opened or given a potion, unfortunately.
Guyguy22 ยท 1 points ยท Posted at 07:31:04 on November 7, 2015 ยท (Permalink)
That still makes chest organization and stuff like that much easier :D
[deleted] ยท 1 points ยท Posted at 02:27:54 on November 6, 2015 ยท (Permalink)*
[deleted]
๐๏ธ tryashtar ยท 2 points ยท Posted at 02:35:02 on November 6, 2015 ยท (Permalink)
Wow, you're quick!
The items get summoned at your feet, so you just won't pick them up.
kopasz7 ยท 0 points ยท Posted at 05:48:51 on November 6, 2015 ยท (Permalink)
Let me guess, you used the new tags to store the potions in string format in the item that's the obvious part to me but how do you detect the right click?
๐๏ธ tryashtar ยท 5 points ยท Posted at 02:30:14 on November 6, 2015 ยท (Permalink)
Hey. I made another thing with command blocks: Potion Bags. Throw five leather and one string on the ground to get a potion bag.
A potion bag works differently from a normal bucket in that its only right-click function is "attempt to open the bag." The bag will be opened if you are only holding one in a stack and there are potions in the bag.
Any bag can hold up to three potions. It works with every vanilla brewable potion, along with potions of luck and water bottles. It supports drinkable, splash, and lingering potions.
The bags are totally multiplayer-friendly. All the potion data is stored in the bag item itself. You can have multiple bags and your friend can have multiple bags, and they will all hold their own potions. Right-click to open the bag, throw potions onto the bag to store them. Remember it can only hold up to three.
This is a massive pile of nearly identical commands, so you need three one-click things to get this into your world. Here they are:
http://pastebin.com/a79PFRTS
http://pastebin.com/MQqtCgkL
http://pastebin.com/iR66M2ts
Enjoy!
[deleted] ยท 3 points ยท Posted at 13:56:07 on November 6, 2015 ยท (Permalink)
[deleted]
๐๏ธ tryashtar ยท 3 points ยท Posted at 22:00:19 on November 6, 2015 ยท (Permalink)
Here's kind of a technical explanation:
As you probably know, you can store arbitrary NBT inside of items. Each bag was given three such tags, all compounds:
Potion1,Potion2, andPotion3.Each one of those compounds stores two strings and a byte:
type,effect, andfilled.When you craft a bag, all three
filledtags are set to 0. When you drop a potion, it tries to put itself in the first slot that isn't filled.The potion gets scores based on what type (drink, splash, lingering) and what effect (harming, speed 2, long jump boost, etc.) it has.
If it can find a slot to occupy, it sets that slot's data to match its own.
When you right click, it creates an item entity for each "filled" slot, then does
/entitydatato set its type and effect.I hope that was understandable. If you have any other questions, just ask!
[deleted] ยท 2 points ยท Posted at 02:50:15 on November 7, 2015 ยท (Permalink)
[deleted]
๐๏ธ tryashtar ยท 2 points ยท Posted at 03:21:51 on November 7, 2015 ยท (Permalink)
Thank you, that really means a lot to me!
I do have a YouTube account (tryashtar), but no videos yet. Some people have expressed interest, so I might start making some short basic videos showing off contraptions I've made.I just need something better than Movie Maker :P
Guyguy22 ยท 3 points ยท Posted at 05:43:44 on November 6, 2015 ยท (Permalink)
Can you rename the potion bag for better organization, or will that cause the system to not work properly? Either way, I really like this :)
๐๏ธ tryashtar ยท 1 points ยท Posted at 05:54:57 on November 6, 2015 ยท (Permalink)
You can rename the bag and it will still work, but its name will be reset when it is opened or given a potion, unfortunately.
Guyguy22 ยท 1 points ยท Posted at 07:31:04 on November 7, 2015 ยท (Permalink)
That still makes chest organization and stuff like that much easier :D
[deleted] ยท 1 points ยท Posted at 02:27:54 on November 6, 2015 ยท (Permalink)*
[deleted]
๐๏ธ tryashtar ยท 2 points ยท Posted at 02:35:02 on November 6, 2015 ยท (Permalink)
Wow, you're quick!
The items get summoned at your feet, so you just won't pick them up.
ACWarrior ยท 1 points ยท Posted at 16:47:02 on November 6, 2015 ยท (Permalink)
A dream came true.
Truffleshuffleman13 ยท 1 points ยท Posted at 18:00:31 on November 6, 2015 ยท (Permalink)
Does it work with chocolate?
kopasz7 ยท 0 points ยท Posted at 05:48:51 on November 6, 2015 ยท (Permalink)
Let me guess, you used the new tags to store the potions in string format in the item that's the obvious part to me but how do you detect the right click?