#1.25.1 Fuel Item Burnable Block
27 messages · Page 1 of 1 (latest)
https://github.com/BlockLegend001/TinyCoal/tree/1.21-NeoForge/src This GitHub branch is for the mod Tiny Coal's 1.21.3-1.21.5 versions I believe, this contains tiny versions of the coal and charcoal you could try replicating with your own items
Wait
Yeah this is better, this one is for Fabric
In your main mod file's onInitialize() Method is generally where you'd go about adding fuel sources in Fabric
As for creating a burnable block, I'll need to look at if they changed how to do it since 1.21.1, but in 1.21.1 it was as simple as adding .burnable() in the block's settings
e.g.:
public static final Block MAGIC_BLOCK = registerBlock("magic_block",
new Block(AbstractBlock.Settings.create()
.strength(3f)
.requiresTool()
.sounds(BlockSoundGroup.AMETHYST_BLOCK)
.burnable()));```
Alright realized I linked the wrong branches, give me one minute and I'll have your code templates for a fuel source and a burnable block ready @boreal iris
@Override
public void onInitialize() {
FuelRegistryEvents.BUILD.register(((builder, context) -> {
builder.add(ModItems.moddedFuel, 200);
//The value should be set to 200 per items you want to burn, if you want to burn 8 items, set it to 1600, etc.
}));```
Replace ModItems.moddedFuel with whatever item you want to set as your custom fuel
Refer to comment for how to determine which value to put instead of the 200
Essentially this still stands, assuming you do all the proper helper Methods and whatnot to add modded Blocks in general.
hi
Hi
it works but
dont like this the way they use this arrow funtions it force me to manually keep two list
FuelRegistryEvents.BUILD.register(((builder, context) -> {
builder.add(ItemInit.INGOT_CARBONO, 12800); // 64 iron ingots
builder.add(ItemInit.ROD_CARBONO, 400); // 2 iron ingots
}));
Two lists? What do you mean?
I'm not sure what you mean by this
I don't understand what the issue is
i have the big list of items inside mi ItemInit
from that list i have manually take the burnable items
and put them in main class inside the event
in ancient times just have ItemInit and inside two methods
one to just register items
other registering items and adding to FuelRegistry
So you would prefer being able to just call a Method in the onInitialize(); Method that would automatically list all of your fuels?
i like that idea
understand minecraft wont gonna change for and old man yelling to the clouds

I'll try to figure something out
Alright @boreal iris , what I figured out is to add the following Method to the ItemInit Class where you create the items:
public static void registerFuelItems() {
Burnableblockmod.LOGGER.info("Registering fuel sources for " + Burnableblockmod.MOD_ID);
FuelRegistryEvents.BUILD.register((builder, context) -> {
builder.add(ModItems.moddedFuel, 200);
builder.add(ModItems.moddedFuelTwo, 200);
builder.add(ModItems.moddedFuelThree, 200);
builder.add(ModItems.moddedFuelFour, 200);
builder.add(ModItems.moddedFuelFive, 200);
builder.add(ModItems.moddedFuelSix, 200);
});
//Replace values and fuels with your own fuels. Don't forget to still add the [ItemClass]. prefix to ensure it works outside the Class.
}```
Under the onInitialize() Method, you can then put the following:
```java
@Override
public void onInitialize() {
ModItems.registerFuelItems();
//Change the prefix to whatever class you put the Method in
}```
This essentially just puts FuelRegistryEvents thing in your ItemInit class
So for you it'd likely be:
//In the ItemInit Class
public static void registerFuelItems() {
FuelRegistryEvents.BUILD.register((builder, context) -> {
builder.add(ItemInit.INGOT_CARBONO, 12800); // 64 iron ingots
builder.add(ItemInit.ROD_CARBONO, 400); // 2 iron ingots
});
}```
```java
@Override
public void onInitialize() {
ItemInit.registerFuelItems();
}```
You will still need to list all of it in the Method and whatnot but at least now it'll be centralized to your ItemInit Class which is what I think you wanted to achieve.