{"action":"opened","issue":{"url":"https://api.github.com/repos/andrewrk/mineflayer-scaffold/issues/3","labels_url":"https://api.github.com/repos/andrewrk/mineflayer-scaffold/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/andrewrk/mineflayer-scaffold/issues/3/comments","events_url":"https://api.github.com/repos/andrewrk/mineflayer-scaffold/issues/3/events","html_url":"https://github.com/andrewrk/mineflayer-scaffold/issues/3","id":119340122,"number":3,"title":"Uncaught TypeError: undefined is not a function","user":{"login":"Minecheesecraft","id":15235673,"avatar_url":"https://avatars.githubusercontent.com/u/15235673?v=3","gravatar_id":"","url":"https://api.github.com/users/Minecheesecraft","html_url":"https://github.com/Minecheesecraft","followers_url":"https://api.github.com/users/Minecheesecraft/followers","following_url":"https://api.github.com/users/Minecheesecraft/following{/other_user}","gists_url":"https://api.github.com/users/Minecheesecraft/gists{/gist_id}","starred_url":"https://api.github.com/users/Minecheesecraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minecheesecraft/subscriptions","organizations_url":"https://api.github.com/users/Minecheesecraft/orgs","repos_url":"https://api.github.com/users/Minecheesecraft/repos","events_url":"https://api.github.com/users/Minecheesecraft/events{/privacy}","received_events_url":"https://api.github.com/users/Minecheesecraft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-29T06:01:14Z","updated_at":"2015-11-29T06:01:14Z","closed_at":null,"body":"I am trying to make a mining plugin for my bot. However, when I send it the mine command, it freezes and gets the error \"Uncaught TypeError: undefined is not a function\" on line 222 in index.js\r\n\r\nHere is my code:\r\n```javascript\r\nvar mineflayer = require('mineflayer');\r\nvar scaffoldPlugin = require('mineflayer-scaffold')(mineflayer);\r\nvar blockFinderPlugin = require('mineflayer-blockfinder')(mineflayer);\r\nvar vec3 = mineflayer.vec3;\r\nmodule.exports.inject = inject;\r\n\r\nfunction inject(bot) {\r\n\r\nvar doMine = false;\r\nvar findIds = [16, 15, 14, 21, 56, 73, 74, 129];\r\n\r\n////Functions\r\nfunction findPath() {\r\n    bot.findBlock({\r\n        point: bot.entity.position,\r\n        matching: findIds,\r\n        maxDistance: 64,\r\n        count: 1,\r\n    }, function(err, blockPoints) {\r\n        if (err) {\r\n            fakeConsole(\"Error looking for blocks.\", \"error\")\r\n        }\r\n        if (blockPoints.length) {\r\n            bot.scaffold.to(blockPoints[0], function(err) {\r\n                if (err) {\r\n                    doMine = false\r\n                    fakeConsole(\"Didn't get to the ore.\", \"error\");\r\n                } else {\r\n                    if (doMine === true) {\r\n                        findPath();\r\n                    } else {\r\n                        fakeConsole(\"Ended mining task.\", \"info\");\r\n                    }\r\n                }\r\n            });\r\n        } else {\r\n            doMine = false\r\n            fakeConsole(\"No ores in range.\", \"info\");\r\n        }\r\n    });\r\n}\r\n\r\n////Commands\r\nbot.on('whisper', function(username, message) {\r\n    if (message == \"mine start\") {\r\n        if (doMine === false) {\r\n            doMine = true;\r\n            fakeConsole(\"Started mining.\", \"info\");\r\n            findPath();\r\n        } else {\r\n            fakeConsole(\"I am already mining!\", \"error\");\r\n        }\r\n    }\r\n    if (message == \"mine stop\") {\r\n        if (doMine === true) {\r\n            doMine = false;\r\n            fakeConsole(\"Ending mining task...\", \"info\");\r\n        } else {\r\n            fakeConsole(\"I am not mining.\", \"error\");\r\n        }\r\n    }\r\n});\r\n\r\n//Fake console\r\nfunction fakeConsole(text,type) {\r\n    document = doc = window.document \r\n    var text = arguments[0];\r\n    var type = arguments[1];\r\n    var para = document.createElement(\"P\");\r\n    var t = document.createTextNode(text);\r\n    para.className = type;\r\n    para.appendChild(t);\r\n    document.getElementById('Space').appendChild(para);\r\n    window.scrollTo(0,document.body.scrollHeight);\r\n    }\r\nfakeConsole(\"Started mine plugin.\", \"info\")\r\n\r\n}\r\n```"}}