[event.getplayer().chat("/Spawn")] i really need this

Discussion in 'Plugin Development' started by xguysprison, Jul 19, 2014.

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

    xguysprison

  2. Offline

    Gamesareme

    Is that meant to be in a menu gui?
     
  3. Offline

    _LB

    You convert the name to lowercase, then immediately compare it to strings with capital letters. Those comparisons can never be true.
     
  4. Offline

    xguysprison

    Last edited by a moderator: Jun 9, 2016
  5. Offline

    _LB

    No, compare to "red" instead of "Red"
     
  6. Offline

    Necrodoom

    Use perform/dispatchCommand if you want to execute a command as something.
     
  7. Offline

    xguysprison

    _LB thx for the help it works now
     
  8. Offline

    Gamesareme

    wouldn't InventoryClickEvent be a better event to use?
     
  9. Offline

    xguysprison

    Last edited by a moderator: Jun 9, 2016
  10. Offline

    _LB

  11. Offline

    xguysprison

    _LB i dont really understand what he said
     
  12. Offline

    _LB

  13. Offline

    Gamesareme

    This is what I meant.
    Code:java
    1. @EventHandler
    2. public void onInvClick(InventoryClickEvent event){
    3. Inventory inv = event.getInventory();
    4. if(inv.getName().equals("Some Tital")){
    5. event.setCancelled(true);
    6. if(event.getCurrentItem() !=null){
    7. ItemStack item = event.getCurrentItem();
    8. String itemm = item.getItemMeta().getDisplayName();
    9. if(itemm.equalsIgnoreCase("red")){
    10. //do something
    11. }else if(itemm.equalsIgnoreCase("blue")){
    12. //do something
    13. }
    14. }
    15. }
    16. }
     
  14. Offline

    _LB

    Gamesareme He's probably using a framework that has custom events.
     
  15. Offline

    Gamesareme

    That would explain why I did not recognize the event. :/
     
Thread Status:
Not open for further replies.

Share This Page