1.17.1 Any way to connect Spigot Plugins with Forge mods?

Discussion in 'Spigot Plugin Development' started by barrar3port, Jul 31, 2021.

  1. Hey so I believe that there should be a way to connect my plugins with a Forge mod, maybe using the Plugin Message Channel or something with or like that, but I'm not completely sure about that, does any one had developed something like this, or even have any idea on how to make this possible?
    My idea is to have and create some visual stuff that I can't with the spigot api ofc, but if I click or change something in the player side with the mod, it changes in the server, just like a front and back end haha.
    Oh this is the plugin I want to connect and make cool player side stuffs: https://www.spigotmc.org/resources/staff-core.82324/
    Any ideas?
     
  2. Choco

    Moderator

    Absolutely you can. In fact, I do this with Fabric and my VeinMiner plugin. I do some rendering as well to show that people have it enabled.

    https://github.com/2008Choco/VeinMiner
    https://github.com/2008Choco/VeinMi...kit/src/main/java/wtf/choco/veinminer/network
    https://github.com/2008Choco/VeinMi...bric/src/main/java/wtf/choco/veinminer/fabric

    All you need to do is listen for and send data across some plugin channel. How you send that data is entirely up to you. You can design your own protocol, pretty much. I mentioned Fabric but this very same concept can be applied to Forge (although they do have some abstraction around handling that custom payload packet as well).

    Another good example of this WorldEdit and the WECUI
    https://www.curseforge.com/minecraft/mc-mods/worldeditcui-forge-edition-2