1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cancel drops on break event

Discussion in 'Skript' started by DarkBoy2005, Mar 1, 2021.

Thread Status:
Not open for further replies.
  1. DarkBoy2005

    Supporter

    Joined:
    Apr 8, 2020
    Messages:
    1
    Likes Received:
    0
    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 (Text):
    1. on block break:
    2.     if event-block is coal_block:
    3.         if "%region at player%" contain "pontbanya":
    4.             if held item is diamond_pickaxe:
    5.                 if player's held item isn't enchanted:
    6.                     event.setDropItems(false)
    7.                     set event-block to air
    8.                     set {_waited} to difference between {pboost.%player%.lastused} and now
    9.                     if {_waited} is less than 10 minutes:
    10.                         add 0.1 to {%player%.pont}
    11.                         json("%player%", "||&e&lPontok &8// &a+0.1 pont||ttp:&7Össz pontok: &e%{%player%.pont}%||")
    12.                         stop
    13.                     add 0.01 to {%player%.pont}
    14.                     json("%player%", "||&e&lPontok &8// &a+0.01 pont||ttp:&7Össz pontok: &e%{%player%.pont}%||")
    15.                     stop
    16.             cancel the event
    17.             send "&e&lPontok &8// &cEzzel itt nem bányászhatsz."
    Everything working except the "event.setDropItems(false)". Someone please help me
     
  2. FlameikTV

    FlameikTV Member

    Joined:
    May 22, 2020
    Messages:
    19
    Likes Received:
    2
    Hi,
    you can try to use cancel drops instead of event.setDropItems(false).
     
  3. Marc

    Marc Active Member

    Joined:
    Nov 27, 2020
    Messages:
    94
    Likes Received:
    0
    You can also just delete the block and give the player the block
     
  4. bence433

    bence433 Member

    Joined:
    Jul 7, 2019
    Messages:
    1
    Likes Received:
    0
    event.setDropItems(false)
    This method didn't exist in 1.8

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

Share This Page

Loading...