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.

How to check if hit entity is an itemframe?

Discussion in 'Skript' started by pepper82, Aug 6, 2018.

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

    pepper82 Member

    Joined:
    Jan 26, 2017
    Messages:
    272
    Likes Received:
    1
    Hi all,
    how would I check if the hit entity (on projectile hit) is an itemframe? Any way to do this?

    And how do I set a block at a specific location to an itemframe?
     
    #1 pepper82, Aug 6, 2018
    Last edited: Aug 6, 2018
  2. Drioz

    Drioz Member

    Joined:
    Jun 10, 2018
    Messages:
    35
    Likes Received:
    2
    You can do this using a different event.
    Code (Skript):
    1. on unhang: #Needs MundoSK
    2.     if hanged entity is an item frame:
    3.         message "success"
     
  3. pepper82

    pepper82 Member

    Joined:
    Jan 26, 2017
    Messages:
    272
    Likes Received:
    1
    And without mundosk?
    Also where does it check for projectile / arrow in your code?
     
  4. Drioz

    Drioz Member

    Joined:
    Jun 10, 2018
    Messages:
    35
    Likes Received:
    2
    I'm not here to spoonfeed you, I gave you how to check when the item frame gets taken down as a guideline.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    That was awfully rude of you. He was simply asking how to detect something, he didn't ask to have a full blown code written.

    Pepper I have tried to figure this out a few times, I will keep working on seeing if I can figure something out. Its stupid because an Item frame is an entity, yet for some reason when I check for an entity getting hit, its not registering.
     
    • Like Like x 1
    • Winner Winner x 1
  6. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Code (Skript):
    1. on damage of item frame:
    2.     damage cause = projectile
    3.     broadcast "%location of block at victim's location%"
    4.     cancel event
    :|
     
  7. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    Just want to note that an item frame is not a block. You won't be "setting a block", you'll just be spawning it in like you would any other entity.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...