ForgeEssentials

ForgeEssentials

339k Downloads

[WIP] [Scripting] New JS based scripting roadmap

olee opened this issue ยท 7 comments

commented

We are currently working at a completely new scripting interface which will be JS based and replace the old scripting system asap. It will provide probably all features you could imagine, as it works with Java JS Engine nashorn (on Java 8) or Rhino (< Java 8) plus a simple access layer between JS and MC / FE.

Souce is here

WIKI article here

Typescript d.ts for writing error-free scripts with TAB-completion in any TS compatible editor
(Typescript is basically JS on steroids and allows for proper code-completion and error checking - I would advise anyone to use it to write scripts)

Features:

  • Calling commands from JS
  • Getting command arguments in JS
  • Command to call scripts from MC
  • Typescript definition file for TS support
  • Command handling + registration
  • Support for setTimeout/setInterval
  • Constructors
  • Handle MC events with scripts
    • @olee Improve event handling
  • @olee Upgrading of old scripts - needs to handle PatternCommands (the json ones)
    • Improve script upgrading with missing mapped methods / arguments
  • @olee localStorage support
  • @olee Direct TS compilation support (if possible)
  • @Techjar Access layers
    • EntityPlayer
    • Entity hierarchy
    • Inventory
    • TileEntity
    • AxisAlignedBB
    • FE Wallet
    • ItemStack
    • Enchantments
    • @olee NBT Tags
    • Ore Dictionary
    • ICommandSender
    • Permissions
    • Zones
    • World manipulation (WorldServer, setBlock, etc.)
    • Server administration (kick, ban, difficulty, etc.)
commented

Requesting "CustomServerItems" mod support/integration with the new scripting system, please.

commented

What?

commented

hmn... That mod has not been updated in 11 months.

Did not even know it existed.

commented

Oh yeah I made this one and it is really useful for server customization. Though it could really need an update to 1.8.9 and 1.10.2.

This also sounds like a perfect test case for script integration with other mods.

commented

We are pretty close to finishing the first stable version of this new feature now.
Lots of wrappers have been added and a lot of stuff can already be done with the new scripting.
After a bit more work on the script upgrading to handle all old script methods / -arguments, this will be closed and we will start on making improvements / adding new features.

commented

I suggest to open a second issue tracker for scripting only issues.