I'm trying to take a mod that when the player is displayed a title, the event will be canceled if the title text meets certain conditions. However, I can't figure out how to detect that title.
I found this way to cancel all titles, but I don't know how to get the text component.
@SubscribeEvent
public void onRenderGuiOverlay(RenderGuiOverlayEvent event) {
if (event.getOverlay().id().toString().equals("minecraft:title_text")) {
event.setCanceled(true);
}
}
I've tried modifying this method for an older version but I couldn't get that to work.
Anyone know how to do this?