Jump to content

mistrx14

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by mistrx14

  1. UPDATE: I found out how to do it: ModList.get().isLoaded("modid")
  2. Hey there, how can I detect another mod that's also installed into Minecraft? I would like to detect the mod by it's modid when my mod is first loaded. My goal with this would be to only register my mod-specific items only when the mod I'm trying to detect isn't installed. public MyMod() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); if (!ModIsInstalled("modid")) { RegistryHandler.init(); } }
  3. Hello, so I have been trying to change the texture of a vanilla diamond sword when right clicking for a while now, but I can't figure out how to do it. I managed to detect when the player right clicks using an event, but that's it. The question is basically, how to change the vanilla texture when an event (a right click) happens.
  4. Hello, I'm currently having the problem that I can't figure out how I can add a ClickEvent or a HoverEvent to my TextComponent for my Forge 1.17 mod. I had it working in 1.16.5, but now it has changed. I basically want to do it as shown in the image with ClickEvents for each of the elements. Edit: Ok, I figured it out: If you want to add a ClickEvent, you can use a Style. I now have this in place: TextComponent component = new TextComponent("Your Text here"); Style componentStyle = Style.EMPTY; componentStyle = componentStyle.applyFormat(ChatFormatting.GREEN); componentStyle = componentStyle.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, some_url)); component.setStyle(componentStyle); It works, so I'm gonna leave it there
×
×
  • Create New...

Important Information

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