#1.25.1 Fuel Item Burnable Block

27 messages · Page 1 of 1 (latest)

boreal iris
#

long history short i have a coal ingot and wanna use it as fuel for the furnace

also i need to make a custom wood block to catch fire burn a disappear as the vanilla wood does

steel loom
#

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()));```
steel loom
#

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

steel loom
boreal iris
#

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
    }));
steel loom
#

Two lists? What do you mean?

steel loom
#

I don't understand what the issue is

boreal iris
#

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

steel loom
boreal iris
#

i like that idea
understand minecraft wont gonna change for and old man yelling to the clouds

steel loom
steel loom
steel loom
#

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();
  }```
steel loom