Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with fabric:components custom ingredient type #4170

Open
vico93 opened this issue Oct 16, 2024 · 2 comments
Open

Issues with fabric:components custom ingredient type #4170

vico93 opened this issue Oct 16, 2024 · 2 comments

Comments

@vico93
Copy link

vico93 commented Oct 16, 2024

I think i'm the only one that uses the very niche "fabric:type": "fabric:components" custom ingredient that Fabric introduces for .json recipes to fine-grained ingredient picking (basically, select only item with specific components - or NBT for older versions).

I did a recipe to make mud with a dirt block and a water bottle with the following .json:

{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:dirt"
        },
		{
			"fabric:type": "fabric:components",
			"base": {
				"item": "minecraft:potion"
			},
			"components": {
				"minecraft:potion_contents": {
					"potion": "minecraft:water"
				}
			},
		  "strict": true
		}
    ],
    "result": {
        "id": "minecraft:mud",
        "count": 1
    }
}

Although it worked - shows in REI and when i manually put the dirt and the water bottle on the crafting it outputs the mud block - i noticed some issues with this recipe:

First thing is that the water potion isn't pulled to the crafting table (while the other "normal" ingredient - dirt - goes normally) when the recipe is select with either the vanilla recipe book or REI:
2024-10-16_15 04 07
While the recipe is shown normally on REI's recipe preview (but clicking on + gives the same issue of the recipe book):
2024-10-16_15 04 13

The other thing is that, at least with water bottles, an empty bottle isn't returned to the inventory when the crafting is done - similar to how crafting with water/lava/milk buckets works. Maybe adding another field to specify the "return" item could be a solution to achieve consistency between bottle and bucket recipes, or just defining internally that filled bottles should return empty ones would be enough.

MC 1.21.1, Fabric 0.16.7 and Fabric API 0.106.0+1.21.1

@modmuss50
Copy link
Member

Hi, this sounds like a valid problem, I do wonder how this behaves in 1.21.2 as the recipe book works quite diffrently now.

I expect REI has its own logic for this so might be worth seeing if anyone has had this issue before over there?

As for the empty bottle, this is up to the item to impliment getRecipeRemainder() this is unlikely something we would do for potions.

@vico93
Copy link
Author

vico93 commented Oct 16, 2024

Hi, this sounds like a valid problem, I do wonder how this behaves in 1.21.2 as the recipe book works quite diffrently now.

I expect REI has its own logic for this so might be worth seeing if anyone has had this issue before over there?

As for the empty bottle, this is up to the item to impliment getRecipeRemainder() this is unlikely something we would do for potions.

So for the water bottle to leave a empty bottle that would require a separate mod?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants