Closed 20Whey closed 1 year ago
It did crash at first when I ran. But there are some issues I need to point out. Why not just use "cNm" in the seventh line? I need to mention that there is nothing wrong with your "breakBlock". Although this is a bit weird, I can't reproduce it now. If you still can't get it to work, a short video might help me understand why. English is not my first language, so I can't use it very well, good luck.
May be patched in 1.8.4 - Reopen if it persists
I'll test it out, thank you for the follow up!
Issue description: all was well, I was programming in some sort of pseudo block place detection with utilisation of mouse events and item stacks. after I finished getting mouse button ids, the code just stopped running inexplicably. I restarted my game, rejoined, added checks for other events, tested in local and only a server restart resolved the issue. no errors appeared in my console or client log. the code I was using will be below incase it's useful Versions:
offending script
function mouseClicked(event) { var cStack = event.player.getHeldItem(); var LStack = event.player.getTempData("lItem"); if(cStack != null){ if (cStack.getName() != LStack){ var cNm = cStack.getName(); event.player.sendMessage(event.player.getHeldItem().getName()); event.player.setTempData("lItem", cNm); }}}
function breakBlock(event){ event.player.sendMessage("cring"); }