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


 

108
Online

8.7k
Users

922
Topics

11.9k
Posts