mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Re-added PlayerEvent.NameFormat (#6992)
This commit is contained in:
1 parent
27798c5804
commit
941b9a1d1f
5 files changed
+44
-11
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package net.minecraftforge.debug.entity.player;
|
||||
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod("player_name_event_test")
|
||||
@Mod.EventBusSubscriber()
|
||||
public class PlayerNameEventTest
|
||||
{
|
||||
private static final boolean ENABLE = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerNameEvent(PlayerEvent.NameFormat event)
|
||||
{
|
||||
if (!ENABLE) return;
|
||||
event.setDisplayname(new StringTextComponent("Test Name"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user