Material.*_AXE

Discussion in 'Plugin Development' started by IHS1200, Apr 11, 2015.

Thread Status:
Not open for further replies.
  1. Is it possible to perform a if statement like such:

    Code:
    if (  inHand  ==  Material.*_AXE  )
    {
    //code
    }
     
  2. Invisible

    nverdier

    @IHS1200 You could check if the ItemStack#getType()#getName() ends with "_AXE".
     
  3. Would I need to do that in a for loop?
     
  4. Offline

    SuperOriginal

  5. Could I do:
    Code:
                if ( !Current . name ( ) . contains ( "AXE" ) )
                {
    
                    Event . setCancelled ( true );
                   
                }
     
  6. Invisible

    nverdier

    No...

    EDIT: Ninja'D by @SuperOriginal
     
  7. Offline

    Skionz

    It depends whether you are just ignoring naming conventions, or you have a class named Event with a static setCancelled method and a class named Current with a static name method.
     
  8. Invisible

    nverdier

    God that spacing is killing my eyeballs.
     
Thread Status:
Not open for further replies.

Share This Page