chatevent?



  • @Override
    public void notify(ChatMessageEvent chatMessageEvent) {
    String x1 = chatMessageEvent.getSource();
    if(x1.equals(ChatMessageType.ACTION)&& x1.equals("You've caught a orange salamander."))
    salamanderCount++;

    }
    

    Where am i going wrong?

    not working at all


  • Script Writer

    To get the messageType you need to use chatMessageEvent.getType()
    To get the chat message string you need to use chatMessageEvent.getMessage()

    if (chatMessageEvent.getType() == ChatMessageType.FILTERED &&
    		chatMessageEvent.getMessage().equals("You've caught a orange salamander."))  {
    	salamanderCount++;	
    }
    

  • Script Writer

    You’re checking if the source where the message came from equals your given string


 

82
Online

11.3k
Users

1.1k
Topics

14.7k
Posts