Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved java.lang.ClassCastException: app.MP cannot be cast to com.runemate.game.api.hybrid.entities.Npc

Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,770
Code:
java.lang.ClassCastException: app.MP cannot be cast to com.runemate.game.api.hybrid.entities.Npc
 at com.runemate.maxiscripts.task.monkkiller.tasks.Attack.validate(Attack.java:82)
 at com.runemate.game.api.script.framework.task.TaskScript.onLoop(fsb:26)
 at com.runemate.game.api.script.framework.LoopingScript.run(lub:161)
 at com.runemate.game.api.script.framework.AbstractScript.start(jxb:216)
 at app.RK.run(tvb:44)
1.1.1 - OSRS
Code:
monk = (Npc) player.getTarget()

@Cloud Most likely my fault but isn't getTarget() ALWAYS going to return either an Npc or null?
 
Joined
Dec 10, 2014
Messages
3,255
Code:
java.lang.ClassCastException: app.MP cannot be cast to com.runemate.game.api.hybrid.entities.Npc
 at com.runemate.maxiscripts.task.monkkiller.tasks.Attack.validate(Attack.java:82)
 at com.runemate.game.api.script.framework.task.TaskScript.onLoop(fsb:26)
 at com.runemate.game.api.script.framework.LoopingScript.run(lub:161)
 at com.runemate.game.api.script.framework.AbstractScript.start(jxb:216)
 at app.RK.run(tvb:44)
1.1.1 - OSRS
Code:
monk = (Npc) player.getTarget()

@Cloud Most likely my fault but isn't getTarget() ALWAYS going to return either an Npc or null?
It could return a Player
 
Top