Topic category: User side tutorials
So, I just wanted to make a quick little post sharing the solution I've created for a procedure that mimics composting action! There might be another solution to this that's easier than what I've done here, but oh well, this was what worked for me!
Basically, you start by creating a procedure element and then setting the trigger to when a player right clicks a block.
Next, I made it check if the block that's been right-clicked is a composter, if so, then it starts a new check for the item that the player is right-clicking the composter with.
Prior to this procedure, I made a new item tag and included all the items/blocks that I wanted to be compost-able in that tag. Then I used that same tag in this procedure so that the following actions work if one of the tagged items is being held!
Finally, the action that will be completed when all the above conditions had been met! It starts by spawning some compost particles around the block and then follows up with the important part of the procedure, setting the composter's blockstate to 1 level above what it is currently at! Integer property, I found is just a fancy name for blockstate names, in this case "Level" is the blockstate name for a composter! After setting the new block state, the procedure checks if the player is in creative mode, and if not then it takes away 1 of the item that the player is holding!
And that pretty much wraps it up! I hope this ends up helping some people, so they don't gotta struggle like I did!
In Item Extension, you can enable and define the chance of composting and conditions for it, but hey, you'll learn more doing this anyways