CraftScript
  • CraftScript
  • Syntax
    • Kinds
    • Keywords
    • Language Features
  • Tutorials
    • Getting Started
      • Assurance Keywords
      • Value Keywords
      • Condition Keywords
      • Other Keywords
    • Using the Language
      • The Do Block
    • Importing External Scripts
    • Adding CraftScript to a Server
    • Environments and Contexts
  • Libraries
    • Reflection
    • Debug
    • Math
    • Parser
    • Global
Powered by GitBook
On this page
  • Introduction
  • Requirements
  • Components of CraftScript
  • The Script Loader
  • The Script Manager
  1. Tutorials

Adding CraftScript to a Server

Installing CraftScript on your server and setting up an environment.

PreviousImporting External ScriptsNextEnvironments and Contexts

Last updated 1 year ago

Introduction

CraftScript must be packaged inside a plugin.

The plugin is a domain: it decides what syntax is available, how and when scripts are to be loaded and run, what libraries are available to scripts, etc.

Requirements

In order to run a CraftScript environment the following is required:

  • A Minecraft server.

  • The command framework.

Components of CraftScript

The Script Loader

The ScriptLoader is a simple interface that takes in a stream of data (e.g. a file contents or a string) and interprets this as an executable script object.

This object can then be run by itself or loaded into a script manager.

While domains are able to create their own loaders a basic SimpleScriptLoader is provided for most users.

A copy of this loader is available at ScriptLoader.BASIC.

The Script Manager

The script manager provides an environment of libraries, contexts, kinds and data for running a script.

A manager instance is a sort of universe of every resource available to a script while it is running.

The script manager is also responsible for dealing with any errors that occur while the script is running.

PaperMC
Centurion