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 our 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 Anyway to detect the hitten block of a projectile hit event?

Discussion in 'Skript' started by Aidanete, Aug 15, 2018.

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

    Aidanete Well-Known Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    8
    Here is my code, I want to make eggs destroy blocks, but I tested with event-block and didn't work, and this I used to replace it in my code doesn't remove the blocks. HELP!
    Code (Skript):
    1. on projectile hit:
    2.     projectile is an egg:
    3.         shooter is a player:
    4.             block at projectile is tnt:
    5.                 set block at location of projectile to air
    6.                 create an explosion of force 3 at the projectile
    7.                 stop trigger
    8.             block at projectile is ender chest:
    9.                 set block at location of projectile to air
    10.                 stop trigger
    11.             set block at location of projectile to air
     
  2. Best Answer:
    Post #2 by ShaneBee, Aug 16, 2018
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Hey
    So I was curious about this too (from something I worked on a while back) And I did some googling and found a solution.
    Thanks to @Snow-Pyon, he wrote an effect using Skript-Mirror which works like a charm, so I edited that into your Skript, I have tested this to make sure it works, and it does!
    Code (Skript):
    1. on projectile hit:
    2.     projectile is an egg:
    3.         shooter is a player:
    4.             if event.getHitBlock() is tnt:
    5.                 set block at event.getHitBlock() to air
    6.                 create an explosion of force 3 at the projectile
    7.                 stop trigger
    8.             if event.getHitBlock() is ender chest:
    9.                 set block at event.getHitBlock() to air
    10.                 stop trigger
     
    • Winner Winner x 1
  4. Aidanete

    Aidanete Well-Known Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    8
    Thank you very much, but I ask this on the add-on suggestions and btk5h tell me that way. As I'm creating an API/Addon (If you can tell me what is it, better) with skript-mirror, I created a syntax for this thing.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Sorry im having a little bit of a hard time understanding what you are saying.
    I saw what Btk5h said in the addon suggestion. I personally dont know much about skript mirror. I really want to get into learning it because it definitely holds a lot of power for creating more in your skript. That being said, I dont really know which option is better. I say go with whatever you feel more comfortable with.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.
Loading...