Cancel drops on break event

  • 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.

DarkBoy2005

Supporter
Apr 8, 2020
1
0
1
19
Hello. I'm trying to make a skript and I have a little problem. I'm trying to disable the drops but it won't work.


Code:
on block break:
    if event-block is coal_block:
        if "%region at player%" contain "pontbanya":
            if held item is diamond_pickaxe:
                if player's held item isn't enchanted:
                    event.setDropItems(false)
                    set event-block to air
                    set {_waited} to difference between {pboost.%player%.lastused} and now
                    if {_waited} is less than 10 minutes:
                        add 0.1 to {%player%.pont}
                        json("%player%", "||&e&lPontok &8// &a+0.1 pont||ttp:&7Össz pontok: &e%{%player%.pont}%||")
                        stop
                    add 0.01 to {%player%.pont}
                    json("%player%", "||&e&lPontok &8// &a+0.01 pont||ttp:&7Össz pontok: &e%{%player%.pont}%||")
                    stop
            cancel the event
            send "&e&lPontok &8// &cEzzel itt nem bányászhatsz."

Everything working except the "event.setDropItems(false)". Someone please help me
 
event.setDropItems(false)
This method didn't exist in 1.8

Use cancel event, set event-block to air
 
Status
Not open for further replies.