Title: Send entity equipment packet · Issue #494 · feather-rs/feather · GitHub
Open Graph Title: Send entity equipment packet · Issue #494 · feather-rs/feather
X Title: Send entity equipment packet · Issue #494 · feather-rs/feather
Description: Make it possible to see what items players/mobs have in their main/off-hand After implementing #492 @Tracreed though about implementing similar feature, but we decided to prioritise working on something else. However if someone is lookin...
Open Graph Description: Make it possible to see what items players/mobs have in their main/off-hand After implementing #492 @Tracreed though about implementing similar feature, but we decided to prioritise working on some...
X Description: Make it possible to see what items players/mobs have in their main/off-hand After implementing #492 @Tracreed though about implementing similar feature, but we decided to prioritise working on some...
Opengraph URL: https://github.com/feather-rs/feather/issues/494
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Send entity equipment packet","articleBody":"# Make it possible to see what items players/mobs have in their main/off-hand\r\n\r\nAfter implementing #492 @Tracreed though about implementing similar feature, but we decided to prioritise working on something else. However if someone is looking for a beginner issue, then this *might* be something to have a look at. \r\nNote however we are uncertain if this should actually be considered a beginner issue, and would probably classify it as beginner++. \r\n\r\n## Description\r\nMake it so that when mobs or players change their equipment, other clients see the selected item. So if a player/mob equips a sword or some armour it would be visible to others. \r\n\r\nTo do this one has to send the [EntityEquipment](https://github.com/feather-rs/feather/blob/567262c7724d423d3e3ad8dc660b89ef8c72c290/feather/protocol/src/packets/server/play.rs#L948) packet every time an inventory is changed in a visible way. \r\n\r\nTo send send a packet to all nearby players, you call the [broadcast_nearby_with](https://github.com/feather-rs/feather/blob/567262c7724d423d3e3ad8dc660b89ef8c72c290/feather/server/src/lib.rs#L125) on the Server struct. \r\n\r\nThis code should probably be made into a [system](## \"Systems: functions that run each tick. While components are data, systems are logic. They operate on components.\"). And would therefore be put into [this folder](https://github.com/feather-rs/feather/tree/main/feather/server/src/systems/entity). Remember to register the system like it is done [here](https://github.com/feather-rs/feather/blob/567262c7724d423d3e3ad8dc660b89ef8c72c290/feather/server/src/systems/entity.rs#L15).\r\n\r\nI am not sure what the best approach is for detecting a visible change in a inventory slot.\r\nAnd to do this well the problem might actually turn into an issue that is less beginner friendly. So a first approximation to the problem, would be to trigger the packet every n'th tick, and add a todo comment. \r\n\r\nIf you have gotten everything else working and feel like doing something smarter then what I have suggested then I would ask someone on the discord, or on this issue to see if they agree with your approach. ","author":{"url":"https://github.com/Miro-Andrin","@type":"Person","name":"Miro-Andrin"},"datePublished":"2021-09-27T14:45:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/494/feather/issues/494"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b0b6b989-bf8e-e2df-8d53-8781655a64b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF4E:3931C6:AF8FEF:E1B9DA:69905F45 |
| html-safe-nonce | 779552d3a8888b972eaef0f15b63a73d36ccf70c29be5dd31c04f34415917105 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjRFOjM5MzFDNjpBRjhGRUY6RTFCOURBOjY5OTA1RjQ1IiwidmlzaXRvcl9pZCI6IjY4MjUyNDQ3NTA3NTAxNzkxNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ea674e490b97823beae2e992d8100c7b59d0114f5a33744af637e056ea8f9e9b |
| hovercard-subject-tag | issue:1008242679 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feather-rs/feather/494/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb3cbd099186d9288ca2d63e428f3ce8b2fa39e053768cd856991fa959e1530d/feather-rs/feather/issues/494 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb3cbd099186d9288ca2d63e428f3ce8b2fa39e053768cd856991fa959e1530d/feather-rs/feather/issues/494 |
| og:image:alt | Make it possible to see what items players/mobs have in their main/off-hand After implementing #492 @Tracreed though about implementing similar feature, but we decided to prioritise working on some... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Miro-Andrin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/feather-rs/feather git https://github.com/feather-rs/feather.git |
| octolytics-dimension-user_id | 54925191 |
| octolytics-dimension-user_login | feather-rs |
| octolytics-dimension-repository_id | 191701609 |
| octolytics-dimension-repository_nwo | feather-rs/feather |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 191701609 |
| octolytics-dimension-repository_network_root_nwo | feather-rs/feather |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width