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

Send entity equipment packet #494

Open
Miro-Andrin opened this issue Sep 27, 2021 · 0 comments · May be fixed by #495
Open

Send entity equipment packet #494

Miro-Andrin opened this issue Sep 27, 2021 · 0 comments · May be fixed by #495

Comments

@Miro-Andrin
Copy link
Contributor

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 looking for a beginner issue, then this might be something to have a look at.
Note however we are uncertain if this should actually be considered a beginner issue, and would probably classify it as beginner++.

Description

Make 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.

To do this one has to send the EntityEquipment packet every time an inventory is changed in a visible way.

To send send a packet to all nearby players, you call the broadcast_nearby_with on the Server struct.

This code should probably be made into a system. And would therefore be put into this folder. Remember to register the system like it is done here.

I am not sure what the best approach is for detecting a visible change in a inventory slot.
And 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.

If 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.

@tim-kt tim-kt linked a pull request Sep 28, 2021 that will close this issue
6 tasks
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 a pull request may close this issue.

1 participant