Solved Anyway to detect the hitten block of a projectile hit 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.

Aidanete

Active Member
Apr 11, 2017
139
10
0
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_language.skript:
on projectile hit:
    projectile is an egg:
        shooter is a player:
            block at projectile is tnt:
                set block at location of projectile to air
                create an explosion of force 3 at the projectile
                stop trigger
            block at projectile is ender chest:
                set block at location of projectile to air
                stop trigger
            set block at location of projectile to air
 
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_language.skript:
on projectile hit:
    projectile is an egg:
        shooter is a player:
            if event.getHitBlock() is tnt:
                set block at event.getHitBlock() to air
                create an explosion of force 3 at the projectile
                stop trigger
            if event.getHitBlock() is ender chest:
                set block at event.getHitBlock() to air
                stop trigger
 
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.
 
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.
 
Status
Not open for further replies.