ScriptableMC-Engine icon indicating copy to clipboard operation
ScriptableMC-Engine copied to clipboard

Add action bar API

Open KelpyCode opened this issue 5 years ago • 1 comments

Is there any way to use or implement the protocol of the action bar? I've seen there are some libs/snippets of using them with Java, altough you can't really implement it at this point with JS/TS

Other than that, I like this project a lot, by this I can finally make decent plugins by using JS and just skip that whole Java bs I hope you are going to support it in future

KelpyCode avatar May 30 '20 19:05 KelpyCode

Let me do a bit of research and figure out how best to add an action bar api. Do you have any specific minecraft version you are targeting?

And thanks, I'm glad you like this project. I figured it would help some developers who don't like/know java still be able to create fully featured plugins. I for sure plan on supporting this plugin well into the future, including 1.16 support, new features, api's, etc.


6/6/2020 https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html#sendMessage-net.md_5.bungee.api.ChatMessageType-net.md_5.bungee.api.chat.BaseComponent- Looks like spigot already has an api, i just need to allow the script engine access to spigot api's


6/8/2020 I've updated the dev branch to support spigot api's you can download a dev build with the link below, the zip includes the plugin jar and the typescript/javascript libraries. I'll update the release build with these changes later this week. https://github.com/astorks/ScriptableMC-Engine/actions/runs/127842177

import ChatMessageType from '../lib/net/md_5/bungee/api/ChatMessageType.js';
import ComponentBuilder from '../lib/net/md_5/bungee/api/chat/ComponentBuilder.js';
import SpigotChatColor from '../lib/net/md_5/bungee/api/ChatColor.js';

...

let componentBuilder = new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA);
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, componentBuilder.getParts());

...

astorks avatar Jun 03 '20 17:06 astorks