Necessary expressions for addons

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

Aidanete

Active Member
Apr 11, 2017
139
10
0
These are for me, necessary expressions/stuff in add-ons. Really I need these things. You can implement this in your addon, you can credit me but is unnecessary.

On crop smash:
Calls when a crop has been smashed and deleted, useful to cancel it! I have searched for this event and the things I tried didn't work
On jump:
Calls when someone jumps
Hitten block
Returns the block that a projectile in a projectile hit event collided to execute the event I really need this one!
 
Until it is added to Skript, you can get the hit block using skript-mirror
code_language.skript:
on projectile hit:
  set {_hit block} to event.getHitBlock()

And how do I create an expression like "hitten block" and then use it in this code:
code_language.skript:
on projectile hit:
    projectile is an egg:
        shooter is a player:
            hitten block is tnt:
                set block at location of hitten block to air
                create an explosion of force 3 at location of hitten block
                stop trigger
            hitten block is ender chest:
                set block at location of hitten block to air
                stop trigger
            set block at location of hitten block to air
I created this:
code_language.skript:
expression hitten block:
    set {_h} to event.getHitBlock()
    return {_h}
Using the first code don't give errors but don't work to delete blocks
 
And how do I create an expression like "hitten block" and then use it in this code:
code_language.skript:
on projectile hit:
    projectile is an egg:
        shooter is a player:
            hitten block is tnt:
                set block at location of hitten block to air
                create an explosion of force 3 at location of hitten block
                stop trigger
            hitten block is ender chest:
                set block at location of hitten block to air
                stop trigger
            set block at location of hitten block to air
I created this:
code_language.skript:
expression hitten block:
    set {_h} to event.getHitBlock()
    return {_h}
Using the first code don't give errors but don't work to delete blocks
It would be something like
code_language.skript:
expression [the] hit block:
  get:
    return event.getHitBlock()
 
  • Like
Reactions: ShaneBee