PrismarineJS / prismarine-physics

Provide the physics engine for minecraft entities
MIT License
35 stars 41 forks source link

enchantments.find is undefined #25

Closed hexatester closed 4 years ago

hexatester commented 4 years ago

Version: "mineflayer": "^2.28.1" "prismarine-physics": "^1.0.4", <- package-lock.json

Error:

D:\Projects\test-bot\node_modules\prismarine-physics\index.js:602
const depthEnchant = enchantments.find(x => x.id === mcData.enchantmentsByName.depth_strider.id || x.id === ('minecraft:' + mcData.enchantmentsByName.depth_strider.name))
                                        ^

TypeError: Cannot read property 'find' of undefined
    at new PlayerState (D:\Projects\test-bot\node_modules\prismarine-physics\index.js:602:41)
    at Timeout.doPhysics [as _onTimeout] (D:\Projects\test-bot\node_modules\mineflayer\lib\plugins\physics.js:61:32)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
rom1504 commented 4 years ago

Yeah update your dependencies (npm update --depth=9999 )

On Wed, Sep 2, 2020, 13:48 Habib Rohman notifications@github.com wrote:

Version: "mineflayer": "^2.28.1" "prismarine-physics": "^1.0.4", <- package-lock.json

Error:

D:\Projects\test-bot\node_modules\prismarine-physics\index.js:602 const depthEnchant = enchantments.find(x => x.id === mcData.enchantmentsByName.depth_strider.id || x.id === ('minecraft:' + mcData.enchantmentsByName.depth_strider.name)) ^

TypeError: Cannot read property 'find' of undefined at new PlayerState (D:\Projects\test-bot\node_modules\prismarine-physics\index.js:602:41) at Timeout.doPhysics [as _onTimeout] (D:\Projects\test-bot\node_modules\mineflayer\lib\plugins\physics.js:61:32) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-physics/issues/25, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437VIUIPWVY3IASWGKPTSDYWKFANCNFSM4QS5EK5A .

hexatester commented 4 years ago

Thanks.