Jump to content

adding a field in EntityPlayer but without modify it


legendaire45

Recommended Posts

Hello community forge, I need your advice.

I need to add the class EntityPlayer a field, but I do not want to modify this class.

I visited the wiki and I came across the tutorial on Access Transformer, but it doesn't explain how to add a new field to a class of minecraft

 

How do I add my field to this class?

Link to comment
Share on other sites

you could try the EntityJoinWorldEvent approach (if you're talking about datawatchers). the NBT tag alone would suffice if only a server needs access to those data in a player.

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

What is EntityJoinWorldEvent. I never use this class. How does it work?

the NBT tag does not suffice because the client needs access to the data also.

 

for my mistake I think I understand where the problem was.

When a player logged in, I add datawatcher to the player but I don't add to the other player.I think, I should add this to all players on the server but I do not know how?

 

Edit:I finally succeeded in using packets that are activated when a player connects and sends the list of players already present on the server, who just logged in

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.