I’m making a command where it will display a random block had been placed, but instead of that, it shows “right-hand side of ‘instanceof’ is not an object”. Is there something wrong with my command? Thanks in advance!
$(touser) has mined one $(eval a=$(urlfetch json https://pastebin.com/raw/z2Z3J9Tt);a[Math.floor(Math.random()*a.length)]). $(count) total blocks have been mined.
When you see this error it’s often due to bad syntax, in our case here, the missing quotes. And you weren’t creating an array with your block types from the pastebin, so you would have had the entire list (actually not since it goes above the characters limit, so you would have gotten an error), instead of just one block.
I’ve fixed it for you:
$(user) has mined one $(eval a=`$(urlfetch json https://pastebin.com/raw/z2Z3J9Tt)`.split(`|`);a[Math.floor(Math.random()*a.length)]). $(count) total blocks have been mined.
Also, you’ll have to fix your pastebin file, replace every
, (comma) at the end of each block by
| (vertical bar), you can also remove the
" (quotation marks) as well as the last
| (vertical bar).
Here, I made a paste that will delete itself in a week, copy/paste its content in your paste: https://pastebin.com/1in9iE5f
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.