Skip to content

Instantly share code, notes, and snippets.

View Owen1212055's full-sized avatar
🐟
Coding

Owen Owen1212055

🐟
Coding
  • United States
  • 18:45 (UTC -04:00)
View GitHub Profile
@Owen1212055
Owen1212055 / custom-player-entity-names.md
Last active October 18, 2023 23:38
Custom Player Entity Names

Custom Player Names

alt text

This is meant as a resource to mimic setting player names whilst ensuring that it is positioned in the same way as an actual nametag.

The current issue

Currently, player entities ignore the custom DATA_CUSTOM_NAME EntityDataAccessor, which sadly means that we cannot just easily change the name of the player entity. Hopefully in the future this functionality will be provided so we do not have to apply such hacky methods.

My implementation (simplified)

@Owen1212055
Owen1212055 / impl.md
Created July 16, 2022 03:53
Paper Plugin Implementation (as of 7/15/22)

Implementation

Loading

When starting the server:

  • PaperClassloaderBytecodeModifier (server) is initialized, this is set in the ClassloaderBytecodeModifier (api) singleton class.
  • Providers are created and loaded by a ProviderSource.
Providers provider = Providers.INSTANCE;
provider.addProviders(DirectoryProviderSource.INSTANCE, pluginfile.toPath());
@Owen1212055
Owen1212055 / gist:148c94979c720b44d1dacb7759ea9c44
Last active July 1, 2022 05:57
Future plans for paper plugins?

Our problem

With Minecraft becoming more data driven and registry based, we are unable to tap into this large part of the api due to us having improper ways to handle modifying these registries safely. Most adding into registries must be done at the very start of the server, where before they are frozen, preventing any type of modification after that point. Our current plugin system is built on the entire concept that there must be a server object being passed around, and because at that point there is no Minecraft server this system will not work at all.

We need to be able to introduce a way for plugins to provide a class that is called in this spot, where we can give access to certain registry based apis.

Possible Solutions

New field in plugin.yml

### Keybase proof
I hereby claim:
* I am owen1212055 on github.
* I am owen1212055 (https://keybase.io/owen1212055) on keybase.
* I have a public key ASBtYYuE556RfR5xX_o8QLXO9ns1lCTIWQR4baS7B8Gb0Ao
To claim this, I am signing this object: