[VaiLáPóCaralho] Problem with the event.

Discussion in 'Spigot Plugin Development' started by CristianoTRS, Jul 11, 2018.

  1. I can't place the event prints below:

    1. PRINT ALL CMD

    2. THE ERROR
     

    Attached Files:

  2. Why do you have a method in a method?
    onCommand and dmg are two separate methods that you can't declare inside on another.
     
  3. So what am I supose to do if i want to do this
     

    Attached Files:

  4. first of all learn java. Not to be snarky but doesn't seem like you have a grasp of the language itself. Second of all are you trying to stop damage if player is in Adventure mode?
     
  5. NONONONONO When I put /dano off it allow the damage and puts player in adventure mode
     
  6. In that case, still put the method outside of the else statement. And in dmg check if player is in Adventure mode and then deal damage otherwise cancel the event. Or if they are always in adventure make a list and add their UUID so if there is damage AND player uuid is in the list, cancel the event.
     
  7. Is that correct?
     

    Attached Files:

  8. Only one method needed for the listener (DanOff or DanOn). Also you need to add EventHandler on top of the listener