Open TheTechPony opened 7 years ago
Likely need adapting for mineflayer 2.0 (ie using Minecraft data directly instead of mineflayer.*) Feel free to do a PR for it (or I'll do it but later)
On Sun, Feb 12, 2017, 05:04 TheTechPony notifications@github.com wrote:
------ TheTechPony: lumberjack search for id: 17 founded log with id 17 Block { type: 17, metadata: 0, light: 0, skyLight: 0, biome: Biome { id: 0, color: 112, name: 'Ocean', height: undefined, rainfall: 0.5, temperature: 0.5 }, position: Vec3 { x: -25400, y: 64, z: 19134 }, name: 'log', hardness: 2, displayName: 'Wood', boundingBox: 'block', diggable: true, material: 'wood', harvestTools: undefined, drops: [ { drop: 17 } ], signText: undefined, painting: undefined } C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:365 var toolMultipliers = materials[material]; ^
TypeError: Cannot read property 'leaves' of undefined at equipToolToBreak (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:365:36) at breakBlock (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\inde x.js:321:11) at moveInDirection (C:\Program Files\nodejs\node_modules\mineflayer-scaffold \index.js:278:7) at Object.increaseX (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:110:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at improveX (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index. js:259:42) at Object.improvePosition (C:\Program Files\nodejs\node_modules\mineflayer-s caffold\index.js:106:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:76:9 at stop (C:\Program Files\nodejs\node_modules\mineflayer-navigate\index.js:1 38:7)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andrewrk/mineflayer-scaffold/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ACPN_v8pe4EVWXrmcbZbqanFikgXutnNks5rboTBgaJpZM4L-Yp8 .
This is still an issue for me, I can't break anything using this plugin.
C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:365 var toolMultipliers = materials[material]; ^
TypeError: Cannot read property 'wood' of undefined at equipToolToBreak (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:365:36) at breakBlock (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\inde x.js:321:11) at moveInDirection (C:\Program Files\nodejs\node_modules\mineflayer-scaffold \index.js:276:7) at Object.decreaseZ (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:202:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at improveX (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index. js:264:42) at Object.improvePosition (C:\Program Files\nodejs\node_modules\mineflayer-s caffold\index.js:106:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:76:9 at stop (C:\Program Files\nodejs\node_modules\mineflayer-navigate\index.js:1 38:7)
Okay so I've found how to fix it but when I apply the fix I get this error
function init() { sideVecs = [ vec3(-1, 0, 0), vec3( 1, 0, 0), vec3( 0, -1, 0), vec3( 0, 1, 0), vec3( 0, 0, -1), vec3( 0, 0, 1), ]; materials = minecraft-data.materials; return inject; }
C:\Program Files\nodejs>node fish.js C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:40 materials = minecraft-data.materials; ^
ReferenceError: minecraft is not defined
at init (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:4
0:15)
at Object.
C:\Program Files\nodejs>
nvm I fixed it. forgot to require the module.
Can you make a PR and reopen the issue until it's merged ?
I don't know how to make a pull request so I'll just post my solution here.
index.js line 9 - var mcData=require("minecraft-data")("1.8.8"); line 41 - materials = mcData.materials;
you can just press edit on that page https://github.com/andrewrk/mineflayer-scaffold/blob/master/index.js to make a pull request
Done. I messed up the first 3 so just ignore those
I have this exact same issue and I have been unable to fix it.
I did not really need it to select the right tool, so I just replaced if (! material) return true;
with if (! material) return true;
if (material) return true;
This is still a problem though.
------ TheTechPony: lumberjack search for id: 17 founded log with id 17 Block { type: 17, metadata: 0, light: 0, skyLight: 0, biome: Biome { id: 0, color: 112, name: 'Ocean', height: undefined, rainfall: 0.5, temperature: 0.5 }, position: Vec3 { x: -25400, y: 64, z: 19134 }, name: 'log', hardness: 2, displayName: 'Wood', boundingBox: 'block', diggable: true, material: 'wood', harvestTools: undefined, drops: [ { drop: 17 } ], signText: undefined, painting: undefined } C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:365 var toolMultipliers = materials[material]; ^
TypeError: Cannot read property 'leaves' of undefined at equipToolToBreak (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:365:36) at breakBlock (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\inde x.js:321:11) at moveInDirection (C:\Program Files\nodejs\node_modules\mineflayer-scaffold \index.js:278:7) at Object.increaseX (C:\Program Files\nodejs\node_modules\mineflayer-scaffol d\index.js:110:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at improveX (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index. js:259:42) at Object.improvePosition (C:\Program Files\nodejs\node_modules\mineflayer-s caffold\index.js:106:7) at changeState (C:\Program Files\nodejs\node_modules\mineflayer-scaffold\ind ex.js:249:25) at C:\Program Files\nodejs\node_modules\mineflayer-scaffold\index.js:76:9 at stop (C:\Program Files\nodejs\node_modules\mineflayer-navigate\index.js:1 38:7)