Here's my solution to the problem.
We will be using the /clear command to do this. The first concept that you need to understand is that using /clear @s glowstone 0 will not clear any items from the player's inventory, and will return with the amount of items in the players inventory. This is crucial to this working. Second, is that in 1.13, a new store feature was added to /execute, which allows the result of a command to be stored in a scoreboard. We can use this to our advantage.
The first thing we need to do is to create a scoreboard objective (dummy) that will store the result.
Second, we would use a command like this:
/execute as @a store result score @s items run clear @s glowstone 0
Hope this helps! ~Spiralio
1
A Short Note
I made this datapack planning on using it for a puzzle map. Then, during the puzzle making portions of it, I realized I really can't design puzzles... but hey! I figured I might as well publicly release the datapack as someone out there might have a use for it! You just install the datapack and you're good to go! The items it uses are LIME DYE, RED DYE, and CYAN DYE. It also has some block interactions, passing through regular glass and glass panes, as well as not doing anything when hitting red terracotta.
For more pictures, information, the download link, and more visit this link! It will take you to... well I guess its kind of like a wiki for it but it also has the download link at the top. If your going to use this datapack to make a map, I strongly suggest you read everything there!!
Don't worry about using this datapack in your maps or giving me credit for it, you can do whatever you want with whatever I make!
1
Is there a way? I can't find a way myself, unfortunately...
EDIT: Once again I figured it out directly after posting... there's a scoreboard objective "minecraft.custom:minecraft.bell_ring" that counts up as you ring a bell.
1
I think your doing too good of a job and this well get taken down, lmao.
1
You can also just summon it with a negative age in ticks, and add 1 tick to the life, then /execute when its age is -1 in another command block, eliminating the need for comparators. There are also faster ways to do this same thing with effect clouds, but they r more complicated and would take a lot longer to explain.
1
eyyy ur back
1
You shouldn't be playing Minecraft if you don't know how to click a button.. Also the red stone is fine. I've been doing red stone and command blocks for 5 years and it's just fine. I doubt you could make one with "better red stone" whatever that means because the redstone suits the purpose just fine.
1
You had slot.hotbar.0 instead of Slot:0b slot.hotbar.0 is only used for /replaceitem
Hope I helped!
1
?
1
Lol good luck. There was pretty much no map by that time xD
1
Try arguing this in court if you copy someone's idea. So calm down. He just wanted people to know that he made the first one.