If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at
the top of the file.
import crafttweaker . neoforge.api.event.entity.player . PlayerNameFormatEvent;
PlayerNameFormatEvent extends PlayerEvent
.
This event can be listened to like so:
events . register < crafttweaker . neoforge.api.event.entity.player . PlayerNameFormatEvent > ( event = > {
println ( "PlayerNameFormatEvent ran!" ) ;
// NameFormat.displayName as Component
Return Type:
Component
// NameFormat.displayName = (displayname as Component);
event . displayName = myComponent;
// NameFormat.entity as Player
Return Type:
Player
// NameFormat.entity as LivingEntity
Return Type:
LivingEntity
// NameFormat.entity as Entity
Return Type:
Entity
// NameFormat.username as Component
Return Type:
Component