Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant break leaves #5

Open
TheTechPony opened this issue Feb 12, 2017 · 10 comments
Open

cant break leaves #5

TheTechPony opened this issue Feb 12, 2017 · 10 comments

Comments

@TheTechPony
Copy link

------ 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)

@rom1504
Copy link
Member

rom1504 commented Feb 12, 2017 via email

@TheTechPony
Copy link
Author

TheTechPony commented Feb 20, 2017

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)

@TheTechPony
Copy link
Author

TheTechPony commented Feb 21, 2017

Okay so I've found how to fix it but when I apply the fix I get this error

The fix
https://github.com/PrismarineJS/node-minecraft-data/blob/master/doc/api.md

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; }

The error

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\fish.js:4:52)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)

C:\Program Files\nodejs>

@TheTechPony
Copy link
Author

nvm I fixed it. forgot to require the module.

@rom1504
Copy link
Member

rom1504 commented Feb 21, 2017

Can you make a PR and reopen the issue until it's merged ?

@TheTechPony TheTechPony reopened this Feb 21, 2017
@TheTechPony
Copy link
Author

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;

@rom1504
Copy link
Member

rom1504 commented Feb 21, 2017

you can just press edit on that page https://github.com/andrewrk/mineflayer-scaffold/blob/master/index.js to make a pull request

@TheTechPony
Copy link
Author

Done. I messed up the first 3 so just ignore those

@FrostBird347
Copy link

I have this exact same issue and I have been unable to fix it.

@FrostBird347
Copy link

FrostBird347 commented Jan 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants