How do I put a runnable in an if statement?

Discussion in 'Plugin Development' started by solymosib10, Jul 3, 2021.

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

    solymosib10

    s it possible to put a runnable in an if statement, because I need it, if the player has a chiseled sandstone underneath it, then it should take the block out after 5 seconds, is it possible to do it this way or do I need another way? Intellij IDEA, java plugin minecraft. Code:
     

    Attached Files:

  2. Offline

    Strahan

    Yea, that's fine. I'd use Material instead of IDs though.
     
  3. Offline

    solymosib10

    I have to use getTypeId because: Cannot resolve symbol 'CHISELED_SANDSTONE'.
     
  4. Offline

    c7dev

    Check which version of spigot you're using, and what version of minecraft the plugin is running on. An error like that might be because of a difference in minecraft versions, where chiseled sandstone could have been changed to a different name or block in a later version.

    Also a small note, if it appears that the bukkit runnable isn't working, in your case it might be because in the runnable you're removing the block the player is in, rather than the one they're standing on. Not sure if that's on purpose, though.
     
  5. Offline

    Strahan

    Yea, also are you specifying the api version in the plugin.yml?
     
  6. Offline

    solymosib10

    If I enter it, will it work? I need it on a 1.8 server.
     
  7. Offline

    solymosib10

  8. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page