Skip to content

Conversation

rom1504
Copy link
Member

@rom1504 rom1504 commented Sep 7, 2025

Summary

Demonstrate integration with prismarine-world's new entity storage as first step toward consolidating all world state in prismarine-world.

Changes

  • Add saveEntityToWorld() and loadEntityFromWorld() methods to bot
  • Store entities in prismarine-world when created via fetchEntity()
  • Remove entities from world storage when destroyed via entity_destroy packets
  • Update dependency to use local prismarine-world with entity storage capability

Testing

  • All existing entity tests pass: npm run mocha_test -- -g "1\.21\.8.*entity"
  • 3 entity-related tests passing for v1.21.8

Context

This is the minimal first step for issue #334 - moving all world state (blocks, entities, inventories) into prismarine-world for better packaging and modularity.

Dependencies: Requires PrismarineJS/prismarine-world#157 to be merged first.

Next steps:

  1. Move block inventories (chests, furnaces) to world storage
  2. Eventually move player inventories to world storage
  3. Complete transition to prismarine-world as single source of truth

Backwards Compatibility

  • No breaking changes to existing mineflayer API
  • All existing bot.entities usage continues to work
  • Entity storage in world is additive functionality

🤖 Generated with Claude Code

- Add saveEntityToWorld() and loadEntityFromWorld() methods to bot
- Store entities in prismarine-world when created via fetchEntity()
- Remove entities from world storage when destroyed
- Update dependency to use local prismarine-world with entity storage
- All entity tests pass

This is a minimal demonstration of using prismarine-world's new entity
storage functionality as first step toward consolidating all world state.

Related: #334, PrismarineJS/prismarine-world#157

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

socket-security bot commented Sep 7, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

Copy link

socket-security bot commented Sep 7, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

rom1504 and others added 2 commits September 7, 2025 21:29
- Remove accidentally committed .nyc_output directory
- Add .nyc_output/ to .gitignore to prevent future commits
- Update dependency to use GitHub branch reference
- Add .nyc_output/ to .gitignore to prevent committing test coverage cache

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@rom1504
Copy link
Member Author

rom1504 commented Sep 7, 2025

WIP, not good yet

@@ -919,7 +941,14 @@ function inject (bot) {
}

function fetchEntity (id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think entity handling could be completely refactored, fetchEntity may not be needed if the relevant entity API storage is in p-world

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agreed

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

Successfully merging this pull request may close these issues.

2 participants