How to deny Water mixing with lava to make obsidian via skript??

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Can anyone help me to deny water to mix with lava to make obsidian?
code_language.skript:
on block form:
    event-block is obsidian
    cancel event

Perhaps something like this?
[doublepost=1501300056,1501299910][/doublepost]
code_language.skript:
on block form of obsidian:
    cancel event

I believe you were on the right track; however, getBlock() will return the block before the transformation. If we wait a tick, we can use the location of the getBlock() to get the new block.



code_language.skript:
on load:
    import "org.bukkit.event.block.BlockFormEvent"

on "org.bukkit.event.block.BlockFormEvent" with priority 5:
    wait 1 tick
    broadcast "%block at block at location of event.getBlock()%"

This should return cobblestone when water and lava meet.

So you can do something like this:

code_language.skript:
on load:
    import "org.bukkit.event.block.BlockFormEvent"

on "org.bukkit.event.block.BlockFormEvent" with priority 5:
    wait 1 tick
    block at event.getBlock() is cobblestone
    chance of 100%:
        set block at event.getBlock() to emerald ore
[doublepost=1501186991][/doublepost]It should also be know, during my testing, I believe the "on form" event is not broken- rather, it no longer supports an "of %blocktype%" argument. I say this because this also works:

code_language.skript:
on block form:
    event-block is cobblestone
    wait 1 ticks
    chance of 100%:
        set block at event-block to emerald ore

After testing the 'on block form' event for another forum post, I found that using the suffix "of %blocktype%" doesn't work. This may be an issue I was having, and I encourage OP to try the code himself.
 
Status
Not open for further replies.