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

BlockBuilder.flammable() #908

Open
Lurrae opened this issue Oct 5, 2024 · 0 comments
Open

BlockBuilder.flammable() #908

Lurrae opened this issue Oct 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Lurrae
Copy link

Lurrae commented Oct 5, 2024

Describe the feature

Like how you can set the .hardness(), .resistance(), etc. of a block, it'd be really nice if you could set the flammability of a block! Judging by the Minecraft wiki's explanation of block flammability (see this page), there would probably have to be a couple of bonus arguments, and I could see it being set up like so:

event.create('kubejs:test_planks')
    ...
    .flammable(5, 20, true)

In this example, the first argument sets the "ignite odds" of the block (how likely it is for fire to spread to the block every fire tick), the second argument sets the "burn odds" of the block (how likely the block is to disappear every fire tick), and the third argument sets whether or not the block can be ignited by lava. If either ignite odds or burn odds are 0 (the default values) the block will not burn at all, so if you don't set .flammable your block won't burn at all, as should be expected
Perhaps there could even be a secondary, simpler-to-use method that looks like this:

event.create('kubejs:test_log')
    ...
    .flammable('minecraft:oak_log')

This just has one argument, taking an existing block's ID and using it to set the flammability statistics to match that block. This has the advantage of not needing to know the exact statistics of the block you want to copy, but of course gives you a bit less control over the specifics of how flammable a block is

Additional info

To my knowledge, there is no easy way to make a flammable block; there's not even an addon that supports it as far as I'm aware. You MIGHT be able to fudge it with .randomTick(), but with how many factors play in to block flammability, it'd be nearly impossible to get a 1:1 recreation of fire spread the way it works for other blocks.
Making blocks flammable seems like something that should be easy to do, especially considering just how common it is for a block to want to be flammable (for example, if someone makes a custom type of wood, they're gonna want almost every block they make to be flammable).

@Lurrae Lurrae added the enhancement New feature or request label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant