Skript

Skript

743k Downloads

New beta: not setting canceled event-block to bedrock

British-Poetic opened this issue ยท 1 comments

commented

Skript/Server Version

17.05 23:20:09 [Server] [INFO] [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
17.05 23:20:09 [Server] [INFO] [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
17.05 23:20:09 [Server] [INFO] [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
17.05 23:20:09 [Server] [INFO] [Skript] Server Version: git-Purpur-"788c14f" (MC: 1.20)
17.05 23:20:09 [Server] [INFO] [Skript] Skript Version: 2.9.0-beta1 (skriptlang-github)
17.05 23:20:09 [Server] [INFO] [Skript] Installed Skript Addons: 
17.05 23:20:09 [Server] [INFO] [Skript]  - skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders)
17.05 23:20:09 [Server] [INFO] [Skript]  - skript-votifier-hook v1.1.0
17.05 23:20:09 [Server] [INFO] [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
17.05 23:20:09 [Server] [INFO] [Skript]  - SkBee v3.4.3 (https://github.com/ShaneBeee/SkBee)
17.05 23:20:09 [Server] [INFO] [Skript] Installed dependencies: 
17.05 23:20:09 [Server] [INFO] [Skript]  - Vault v1.7.3-b131
17.05 23:20:09 [Server] [INFO] [Skript]  - WorldGuard v7.0.9-SNAPSHOT+2247-5e81f3c

Bug Description

When i break any block with a third party plugin that cancels the event it doesent set the block to what its supposed to. Even though the new skript beta is meant to do this. it is passing the "if event-block is X:" condition (i have debugged) but not setting it to X block.

on any break:
    set {_block} to type of event-block

    if "%region at player%" contains "cave in world dimensions": 
        if event-block is coal ore, copper ore, lapis ore, redstone ore, iron ore, gold ore, emerald ore or diamond ore:
            set event-block to stone
            wait 160 seconds
            set event-block to {_block}
            stop
        if event-block is stone or andesite:
            set event-block to cobblestone
            wait 120 seconds
            if event-block is cobblestone:
                set event-block to {_block}
            stop
        if event-block is cobblestone:
            set event-block to bedrock
            wait 120 seconds
            if event-block is bedrock:
                set event-block to {_block}
            stop

    if "%region at player%" contains "nether_cave in world Nether": 
        if event-block is ancient debris:
            set event-block to netherrack
            wait 240 seconds
            set event-block to {_block}
            stop
        if event-block is nether gold ore or nether quartz ore:
            set event-block to netherrack
            wait 120 seconds
            set event-block to {_block}
            stop
        if event-block is netherrack:
            set event-block to bedrock
            wait 60 seconds
            if event-block is bedrock:
                set event-block to {_block}
            stop

Expected Behavior

Setting the block to bedrock, stone or cobblestone.

Steps to Reproduce

Use my code and use a plugin that cancels block break events.

Errors or Screenshots

I couldn't send file so i sent this imgur video link of me showing the issue.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

I cannot replicate this using the following code and a WorldGuard region set to deny block-break:

on any break:
    set event-block to stone

However, I can replicate using the built in spawn protection, which never fires a break event to start with, and is not something we can do anything about. Are you testing within your world's spawn protection?

Please also ensure you're using the version of skript-reflect made for 2.9 (you can get it in the testing discord)