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.

Solved On break block genered naturally or placed players

Discussion in 'Skript' started by VOIDDER, May 17, 2021.

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

    VOIDDER Member

    Joined:
    Aug 23, 2018
    Messages:
    27
    Likes Received:
    0
    Help, I ran out of ideas on how to implement this...
    How to check if the block that the player broke was placed by the player or appeared naturally?

    on break:
    if event-block is coal ore:
    (and how to check, I don't know, help me plz)
     
  2. Best Answer:
    Post #2 by Minecoll_YT, May 19, 2021
  3. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    This is the only solution I can come up with

    Code (Text):
    1. on place:
    2.    add location of event-block to {playerblocks::*}
    3.  
    4. on break:
    5.     if {playerblocks::*} contains location of event-block:
    6.         send "block placed by player"
    7.     else:
    8.         send "block not placed by player"
    9.     remove location of event-block from {playerblocks::*}
    10.  
    11. command /removeplayerblocks [<text>]:
    12.     trigger:
    13.         loop {playerblocks::*}:
    14.             set block at loop-value to air
    15.         send "All blocks placed by players got removed"
    16.  
    Not tested, not sure if it works
     
  4. VOIDDER

    VOIDDER Member

    Joined:
    Aug 23, 2018
    Messages:
    27
    Likes Received:
    0
    Is there a possibility without recording? In the minecraft itself, is there no information whether this block was put or was generated. core protect takes data from somewhere...
     
  5. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Unfortunately this is the only solution I came up with. I'm not sure how core protect works, never used it.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...