• check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 12,775 views, 11 today
  • 871 downloads, 0 today
  • 24
  • 19
  • 10
RevonZev's Avatar RevonZev
Level 62 : High Grandmaster Dragon
76
This data pack is meant to be edited and as a template.
This data pack lets you compost any item (that you have been added manually. See below.) and change what the compost drops.

The custom compost item and drop that is made as a template when you install this data pack is Rotten Flesh item that have 20% chance to become composted and have a chance (after compost is full and clicked) 5/3/1 to drop dirt/coarse_dirt/diamond

To compost a custom item, the user must drop the item into the composter
To have the custom compost drop the user must drop a custom compostable item into the compost first

Before editing extract downloaded zip file into Custom Compost folder

How to add your own custom compost item:
  1. Go to "Custom Compost > data > c_compost > functions > item" and duplicate rotten_flesh.mcfunction
  2. Rename the duplicated file to your custom compost item. Let's use gravel item. so rename it to gravel.mcfunction
  3. Open gravel.mcfunction and change the code below
    execute as @e[type=item,nbt={Item:{id:"minecraft:rotten_flesh"}}] at @s if block ~ ~ ~ minecraft:composter unless block ~ ~ ~ minecraft:composter[level=7] unless block ~ ~ ~ minecraft:composter[level=8] run function c_compost:chance/50
    #From the code above, change it to this below. 100% chance.
    execute as @e[type=item,nbt={Item:{id:"minecraft:gravel"}}] at @s if block ~ ~ ~ minecraft:composter unless block ~ ~ ~ minecraft:composter[level=7] unless block ~ ~ ~ minecraft:composter[level=8] run function c_compost:chance/100

    Do note: beside 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 percent chance. You have to add the chances your self
  4. Go to "Custom Compost > data > c_compost > functions" and open main.mcfunction
  5. Below this code
    function c_compost:item/rotten_flesh
    Add this code (calls the function file you just made)
    function c_compost:item/gravel

How to add custom compost drop:
  1. Go to "Custom Compost > data > c_compost > loot_tables" and open c_compost.json
  2. Change it as you wish
CompatibilityMinecraft 1.15
Tags

1 Update Logs

v1.1 : by RevonZev 04/21/2020 8:59:52 pmApr 21st, 2020

Made it easier to add custom compostable item
Added composting sound
Added composting particles
Added Predicates for generating chances
Removed AoE for generating chances

Create an account or sign in to comment.

1
10/27/2020 4:18 pm
Level 22 : Expert Explorer
Felina_Lain
Felina_Lain's Avatar
You absolute beautiful perfecto, thank you!!!!!
1
04/24/2020 12:49 am
Level 1 : New Miner
Isaac_not_found
Isaac_not_found's Avatar
how do i create a custom compost drop
i don't know what code to change
1
04/24/2020 6:00 pm
Level 62 : High Grandmaster Dragon
RevonZev
RevonZev's Avatar
Learn loot tables, That's all I can say.
1
04/23/2020 6:01 pmhistory
Level 1 : New Miner
supersaiyansubtlety
supersaiyansubtlety's Avatar
1) Thanks for this! It baffles me that Mojang doesn't allow this sort of thing with simple recipe+loottable datapacks

2) Is there any way to obtain custom compost drops without player interaction?
A hopper only collected bone meal for me. Maybe implement an option to make the compost drop item instantly pop-off when the composter is full?
Edit: maybe the instant pop-off could be conditional on the composter being powered by redstone, or having a redstone block adjacent to it?
1
04/23/2020 6:20 pm
Level 62 : High Grandmaster Dragon
RevonZev
RevonZev's Avatar
Yes, it is possible. but with a tiny bit of performance reduction. If I have time, I'll see if I can do anything with the hoppers.
04/17/2020 6:15 pm
This reply was removed by the poster or a moderator.
1
04/17/2020 7:16 pm
Level 62 : High Grandmaster Dragon
RevonZev
RevonZev's Avatar
(Bottom of description)
1
04/17/2020 8:36 pm
Level 2 : Apprentice Miner
CanadianAvenger
CanadianAvenger's Avatar
missed that, thanks!
1
02/14/2020 3:07 pm
Level 32 : Artisan Miner
Cortexiphen
Cortexiphen's Avatar
Is there any reason this doesn't work with hoppers?
1
02/14/2020 6:28 pm
Level 62 : High Grandmaster Dragon
RevonZev
RevonZev's Avatar
Because I haven't implement it
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome