All Projects → csh → Spigot Js

csh / Spigot Js

Play with Nashorn and Spigot at the same time.

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Spigot Js

Minecraftdeveloperguide
📝Minecraft developer Chinese guide,我的世界开发者中文指南
Stars: ✭ 574 (+9466.67%)
Mutual labels:  minecraft
Lithium Fabric
A Fabric mod designed to improve the general performance of Minecraft without breaking things
Stars: ✭ 628 (+10366.67%)
Mutual labels:  minecraft
Nukkit
Nukkit is a Nuclear-Powered Server Software For Minecraft: Pocket Edition
Stars: ✭ 759 (+12550%)
Mutual labels:  minecraft
Minecase
Minecraft server based on Orleans
Stars: ✭ 581 (+9583.33%)
Mutual labels:  minecraft
Pojavlauncher
A Minecraft: Java Edition Launcher for Android based on Boardwalk. Note that v2 will not able to run Minecraft 1.12+.
Stars: ✭ 600 (+9900%)
Mutual labels:  minecraft
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (+11516.67%)
Mutual labels:  minecraft
Mixin
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
Stars: ✭ 557 (+9183.33%)
Mutual labels:  minecraft
Zeps Gui
L'interface d'un outil de calcul d'itinéraires, principalement utilisé pour se repérer dans le Netherrail de Zcraft. Nécessite https://github.com/zDevelopers/ZePS-Core .
Stars: ✭ 5 (-16.67%)
Mutual labels:  minecraft
Nova Renderer
Nova Renderer, a custom cross platform render engine written in C++
Stars: ✭ 619 (+10216.67%)
Mutual labels:  minecraft
Mcinabox
MCinaBox - A Minecraft: Java Edition Launcher for Android. An Encapsulation of [CosineMath's BoatApp](https://github.com/AOF-Dev/BoatApp).
Stars: ✭ 743 (+12283.33%)
Mutual labels:  minecraft
Php Minecraft Query
🐘 PHP library to query Minecraft servers
Stars: ✭ 581 (+9583.33%)
Mutual labels:  minecraft
Pufferpanel
PufferPanel is an open source game server management panel, designed for both small networks and game server providers.
Stars: ✭ 609 (+10050%)
Mutual labels:  minecraft
Minet
A (not so) basic Minecraft Pocket Edition server written in C#
Stars: ✭ 706 (+11666.67%)
Mutual labels:  minecraft
Pycraft
Minecraft-client networking library in Python
Stars: ✭ 574 (+9466.67%)
Mutual labels:  minecraft
Nukkit
Cloudburst Nukkit - Nuclear-Powered Minecraft: Bedrock Edition Server Software
Stars: ✭ 776 (+12833.33%)
Mutual labels:  minecraft
Open Builder
Open "Minecraft-like" game with multiplayer support and Lua scripting support for the both client and server
Stars: ✭ 569 (+9383.33%)
Mutual labels:  minecraft
Minecraftdev
Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
Stars: ✭ 645 (+10650%)
Mutual labels:  minecraft
Applied Energistics 2
A Minecraft Mod about Matter, Energy and using them to conquer the world..
Stars: ✭ 827 (+13683.33%)
Mutual labels:  minecraft
Mcaselector
A tool to select chunks from Minecraft worlds for deletion or export.
Stars: ✭ 798 (+13200%)
Mutual labels:  minecraft
Equivalent Exchange 3
Stars: ✭ 727 (+12016.67%)
Mutual labels:  minecraft

spigot-js

I wanted to play around with Nashorn after a friend told me how nifty it was. This small project is the result.

Yes, the code quality can be better, however it achieves it's goal and that's all I was aiming for.

Scripting

No protection is built into this plugin, you are responsible for any scripts you execute and are thus responsible for any consequences.

Do not run untrusted scripts.

Variables

You are able to access the following variables through standard JS syntax. The variables listed are provided by spigot-js, if you are looking for ones that Nashorn provides then please refer to the relevant documentation.

Variable Name Description
__DIRECTORY__ The absolute path of the scripts directory located in plugins/SpigotJS.
manager The ScriptInterface that the script uses to interact with the server.
server The Server instance.
logger The host plugin Logger.
events A Map of aliases for the FQNs of Bukkit Event implementations.
plugin The host Plugin.

Event aliases

In an attempt to make usage of the ScriptInterface class feel more like natural JavaScript I opted for on(String, function(event)) style code for subscribing to events. This approach would result in using something along the lines of the following code for subscribing to PlayerJoinEvent.

manager.on("org.bukkit.event.player.PlayerJoinEvent", function(event) {
    ...
});

Nobody wants to constantly type out event FQNs though, so we rounded up all the standard events and threw them into the events map!

manager.on(events.PlayerJoinEvent, function(event) {
    ...
});

Reloading Scripts

spigot-js also utilises the WatchService class to listen for filesystem events, this means that your scripts will automatically be:

  • Loaded when a script file is created.
  • Reloaded when the file contents are modified.
  • Unloaded when the file is deleted.

You can also reload scripts manually by execute the reload-scripts command. You cannot disable automatic reloading at the time of writing.


More coming soon.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].