Checking if an item is valid

Discussion in 'Plugin Development' started by Starfire1337, Jul 30, 2014.

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

    Starfire1337

    Is there any way to check if a line on a sign is a valid item? Also - is there any way to be able to use itemnames defined in essentials - and not having to use DIAMOND_BLOCK or COBBLESTONE.
     
  2. Offline

    MCForger

    Starfire1337
    Import Essentials.jar into your build path and once you get an instance of Essentials use:
    Code:java
    1. getItemDb();
     
  3. Offline

    Starfire1337

    MCForger
    Would it return a boolean value?
     
  4. Offline

    MCForger

  5. Offline

    Starfire1337

    MCForger
    What would you need to check if it is a valid item though?
     
  6. Offline

    MCForger

    Starfire1337
    The method will throw an Exception if it is not known. You can also just check if ItemStack != null.
     
  7. Offline

    Starfire1337

  8. Offline

    MCForger

Thread Status:
Not open for further replies.

Share This Page