Help with Item detection

Discussion in 'Plugin Development' started by Krippi, May 15, 2019.

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

    Krippi

    Hey,
    my problem is, that i want a listener who check if a specfic item is laying on a specfic block and than do something with that item. Or the same on the other hand, if under an item is a specific block and do something with that item.
    The reason for that is to detect a specfic order of blocks and if an item is laying on it it does something like ritual. (For Spigot 1.14)
    2019-05-15_19.11.52.png
     
  2. Offline

    Zombie_Striker

    @Krippi
    1. Listen to ItemSpawnEvent or PlayerDropItemEvent to get when an item is dropped.
    2. If the item is equal to the one you want to check for, create a new BukkitRunnable that repeats every second.
    3. Inside the runnable, do a check to determine if the item is on the ground. If it is, check if the block below it is a specific block. If it is, look for the other blocks.
     
  3. Offline

    Krippi

    @Zombie_Striker
    isnt it possible to create a listener that checks if an item is on the ground?
    Instead of using a BukkitRunnable.
     
  4. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page