Make a Specified Custom Item execute an event ONLY if dropped on certain block

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

fighter_Ethan

Member
Mar 2, 2023
1
0
1
19
I've been trying to get a specific custom item created via skript to create a broadcast, but ONLY if the specified block that i drop it on is dirt. Here's the code I have now, after trying many different options:

Code:
on drop:
  set {item} to lime stained glass pane named "<grey>L1 Access"
  if event-item is {item}:
    if block at event-location is dirt:
      broadcast "Test"

No errors are returned, but on dropping the lime stained glass pane named L1 Access, nothing happens. What am I doing wrong?

Note: I have the following Skript addons:

Skripts
SharpSK
SKBee
Skellett
skLib
skRayFall
 
Block at event-location will *I believe* return the location of event-item. Since an item hardly ever gets stuck *inside* a block, this will rarely trigger. You should wait a second or two, then check the block *beneath* event-item. Alternatively, loop all blocks below event-location and check if loop-block is dirt. Another option, too, is to check the block beneath event-player (if event-player is set) to see if it's dirt. Hope this helped.
 
Status
Not open for further replies.