0.2.34 • Published 9 months ago

@spyglassmc/mcfunction v0.2.34

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@spyglassmc/mcfunction

banner

npm

This package contains parsers and processors for mcfunction.

Usage

import * as mcf from '@spyglassmc/mcfunction'

// Register the command tree for a specific version.
mcf.CommandTreeRegistry.instance.register('1.15', vanillaCommandTreeFor1_15, customCommandTreePatchFor1_15)

// Define a function that returns the corresponding parser for the provided argument tree node.
const argument: mcf.parser.ArgumentParserGetter = (treeNode: mcf.ArgumentTreeNode) => {
	switch (treeNode.parser) {
		case 'brigadier:double':
			return parser1
		case 'brigadier:int':
			return parser2
		// ...
		default:
			// Unsupported parser.
			// Just return `undefined`.
			return undefined
	}
}

// Get the command parser.
const commandParser = mcf.parser.command('1.15', argument)

// Or the mcfunction parser.
const mcfunctionParser = mcf.parser.entry('1.15', argument)

Contributions

Languages

  • mcfunction language that is associated with the .mcfunction file extension.

AST Nodes

Processors

0.2.27

1 year ago

0.2.26

1 year ago

0.2.25

1 year ago

0.2.24

1 year ago

0.2.23

1 year ago

0.2.22

1 year ago

0.2.21

1 year ago

0.2.20

1 year ago

0.2.19

1 year ago

0.2.18

1 year ago

0.2.17

1 year ago

0.2.30

11 months ago

0.2.34

9 months ago

0.2.33

9 months ago

0.2.32

10 months ago

0.2.31

10 months ago

0.2.29

12 months ago

0.2.28

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.3

3 years ago

0.2.4

2 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago