• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

grakkit/grakkit: A modern JavaScript development environment for Minecraft.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

grakkit/grakkit

开源软件地址(OpenSource Url):

https://github.com/grakkit/grakkit

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Project Logo

Grakkit - It's the fusion of GraalVM, JavaScript, and Minecraft.

Code Demo

If you want to get in touch with the community, join our discord server and we can assist you with whatever problem you may have.

Getting Started

IMPORTANT

Grakkit was designed to run on standard JDK, which means it comes pre-packaged with the GraalJS engine! This pre-packaged engine WILL conflict with the GraalVM JVM, so please use standard JDK to run servers running Grakkit!

Installation

Head on over to the releases page and grab the latest version for your platform. After that, just drop the JAR in whatever plugins, mods, or extensions folder you would install any other plugin, mod, or extension.

Your First Project (Bukkit/Spigot/Paper)

Upon starting or reloading the server with the plugin installed, the plugins/grakkit folder will be created on your server. This is where most if not all development will take place, and serves as your home when working within the scope of grakkit.

Given that Grakkit is community-driven, there are tons of NPM modules you can install to add rich support and typings for the game. For now, the most widely-used package is @grakkit/stdlib-paper, a standard library for JavaScript development with PaperMC servers. To install it, make sure you have NodeJS installed, then navigate to plugins/grakkit in a terminal or command prompt and use npm install @grakkit/stdlib-paper.

For those working on a remote server, you can simply install the package to a local directory, then copy that directory's contents to the remote server's plugins/grakkit folder. This works because grakkit itself doesn't need NodeJS installed, it's merely the template used for package management.

Once that's done, you can import it from within your main file (default index.js) as shown below...

const stdlib = require('@grakkit/stdlib-paper');

Upon the next server reload, the above code will be executed. Requiring this package also adds the in-game /js command, which can be used to test and execute code from within the game -- for example, running /js self will show a representation of the player or console sending the command, and you can use /js core.reload() to reload the JS environment without having to reload the entire server.

Your First Project (Minestom)

Grakkit for Minestom is available as a standalone "extension." Download it from our latest release page. Make sure to download the correct platform, labeled grakkit-x.y.z.minestom.jar. The installation process and usage is very similar to that of bukkit/spigot/paper's, however the two key differences are a). it's an extension and should be placed in the extensions directory rather than plugins, and b). it uses different modules to complete the Environment™, notably-being @grakkit/stdlib-minestom.

Grakkit for Minestom is still in its early days, however it's the best we've got as far as scripting in a performant environment like Minestom.

Other Platforms

Grakkit is currently only available for servers implementing the Bukkit or Minestom's API. Check out Other Implementations to find alternatives for your platform!

Further Reading

For more info about Grakkit, modules, the JS command, and more, head on over to the wiki and read up. Attention: This wiki is slightly outdated and only applies to servers. Many of the code samples in here may still work, but some may not. Use at your own risk!

For another useful guide to getting started, check out Start Your Environment.

Check out these cool resources using Grakkit!

For even more goodies, check out the #resources or #showcase channel in our Discord Server.

Boilerplates
Libraries
Related Plugins
Projects
Showcases
Useful Gists

Created by RepComm and spacefluff432. Maintained by brayjamin, MercerK, Mythical-Forest-Collective, spacefluff432, TonyGravagno, dustinlacewell, wagyourtail, and waterquarks.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap