Skip to content

kitUIN/ActionLib

Repository files navigation

ActionLib

提供HoverEvent.Action的注册

注册后可实现

  • 成书中使用
  • /tellraw的Json模式生成

🤗使用

maven {
    name "kituinMavenReleases"
    url "https://maven.kituin.fun/releases"
}
modImplementation("io.github.kituin:ActionLib:{action_lib_version}")
mc ActionLib loader
1.16.5-1.20.2 0.6.3-fabric Fabric
1.20.3/1.20.4 1.0.2-fabric Fabric
1.20.5+ 1.1.1-fabric Fabric
1.16.5 0.6.4-forge Forge
1.17-1.20.2 0.9.4-fabric Forge
1.20.3/1.20.4 1.0.4-forge Forge
1.20.6+ 1.2.2-forge Forge
1.20.2 1.6.1-neoforge NeoForge
1.20.3/1.20.4 1.9.2-neoforge NeoForge
1.20.5+ 1.10.1-neoforge NeoForge

Fabric

当然你也可以添加include进行jarInJar

新建类继承IActionRegisterApi

public class ActionLibIntegration implements IActionRegisterApi {
    @Override
    public List<HoverEvent.Action> registerHoverEventAction() {
        return List.of(SHOW_IMAGE);
    }
}

SHOW_IMAGE为你定义的HoverEvent.Action,模组ChatImage中的HoverEvent.Action示例

fabric.mod.json中新增你的类

"entrypoints": {
    "client": [
      "github.kituin.chatimage.client.ChatImageClient"
    ],
    "main": [
      "github.kituin.chatimage.ChatImage"
    ],
    "modmenu": [
      "github.kituin.chatimage.integration.ModmenuIntegration"
    ],
+    "actionlib": ["github.kituin.chatimage.integration.ActionLibIntegration"]
  },

Forge

新建类继承IActionRegisterApi,并使用注解@AlPlugin

@AlPlugin
public class ActionLibIntegration implements IActionRegisterApi {
    @Override
    public List<HoverEvent.Action> registerHoverEventAction() {
        return List.of(SHOW_IMAGE);
    }
}

SHOW_IMAGE为你定义的HoverEvent.Action,模组ChatImage中的HoverEvent.Action示例

NeoForge

新建类继承IActionRegisterApi,并使用注解@AlPlugin

@AlPlugin
public class ActionLibIntegration implements IActionRegisterApi {
    @Override
    public List<HoverEvent.Action> registerHoverEventAction() {
        return List.of(SHOW_IMAGE);
    }
}

SHOW_IMAGE为你定义的HoverEvent.Action,模组ChatImage中的HoverEvent.Action示例

About

Minecraft Mod that register HoverEvent.Action

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages