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!

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

Necessary expressions for addons

Discussion in 'Addon Suggestions' started by Aidanete, Aug 15, 2018.

  1. Aidanete

    Aidanete Active Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    9
    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!
     
  2. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    158
    Until it is added to Skript, you can get the hit block using skript-mirror
    Code (Skript):
    1. on projectile hit:
    2.   set {_hit block} to event.getHitBlock()
     
  3. Aidanete

    Aidanete Active Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    9
    And how do I create an expression like "hitten block" and then use it in this code:
    Code (Skript):
    1. on projectile hit:
    2.     projectile is an egg:
    3.         shooter is a player:
    4.             hitten block is tnt:
    5.                 set block at location of hitten block to air
    6.                 create an explosion of force 3 at location of hitten block
    7.                 stop trigger
    8.             hitten block is ender chest:
    9.                 set block at location of hitten block to air
    10.                 stop trigger
    11.             set block at location of hitten block to air
    I created this:
    Code (Skript):
    1. expression hitten block:
    2.     set {_h} to event.getHitBlock()
    3.     return {_h}
    Using the first code don't give errors but don't work to delete blocks
     
  4. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    158
    It would be something like
    Code (Skript):
    1. expression [the] hit block:
    2.   get:
    3.     return event.getHitBlock()
     
    • Like Like x 1
  5. Aidanete

    Aidanete Active Member

    Joined:
    Apr 11, 2017
    Messages:
    139
    Likes Received:
    9
    Lol, thank you very much! :emoji_smile:
     

Share This Page

Loading...