Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/userunp/sparkscript
DiamondFire for Javascript.
https://github.com/userunp/sparkscript
diamondfire minecraft
Last synced: 3 months ago
JSON representation
DiamondFire for Javascript.
- Host: GitHub
- URL: https://github.com/userunp/sparkscript
- Owner: UserUNP
- License: mit
- Archived: true
- Created: 2022-04-26T19:10:04.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-24T23:52:53.000Z (over 1 year ago)
- Last Synced: 2024-09-26T01:26:48.118Z (4 months ago)
- Topics: diamondfire, minecraft
- Language: TypeScript
- Homepage: https://userunp.github.io/sparkscript
- Size: 6.45 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED
I'm no longer maintaining this.# DiamondFire library
__Simple to use DiamondFire library for Javascript.__
__Check out [DiamondFire](https://mcdiamondfire.com), its pretty cool.__
__Manual template manipulation guide by Owen [here](https://mcdiamondfire.com/threads/code-template-manipulation.51/)__
[![gh-actions](https://github.com/UserUNP/sparkscript/actions/workflows/build.yml/badge.svg)](https://github.com/UserUNP/sparkscript/actions/workflows/sparkscript.yml)
[![gh-actions](https://github.com/UserUNP/sparkscript/actions/workflows/codeql.yml/badge.svg)](https://github.com/UserUNP/sparkscript/actions/workflows/codeql.yml)
[![npm-sparkscript](https://nodei.co/npm/sparkscript.png)](https://npmjs.org/package/sparkscript)
***Warning***: *No stable version yet.. everything might flop and/or change*Example: *for current git build*
```javascript
// import the quick editor
// import df from "sparkscript";
const df = require("sparkscript").default;const template = df("Test template", (e, s) => {
// e short for "editor"
// s short for "settings"
e.defAction("giveItems", (/* args */) => {
e.player.action("SetHotbar", e.mc("cod", "§b§l<-§c§o killer fish §b§l->"), e.mc("bow", "§b§l<-§c§o le bow §b§l->"))
//* you can use & for other things. use § for color codes.
});//* you can use .setTarget() to specify the player to target. you can also chain it amongst other functions
//* ex:
// const funnyAction = e.player.action("DoAFlip").setTarget("Default")
// funnyAction.setInverted(true).setAction("NOTAFlip)e.player.event("Join");
e.action.giveItems();e.player.event("Respawn");
e.action.giveItems();});
const code = template.export();
console.log(code.compressed);
```
Key features:
\> Read from template data with `.from( )` function.
\> ~~Read & compile from Spark file, buffer or string.~~ **_till spkc v2 gets an official release._**
\> Easy to use template editor.
## Actiondump
You might need to specify the actiondump using the `setActionDump` function that's in default export.
Or use the `codeDump` file that exports all actiondump related functions into a default object, simply import the file:
`const codeDump = require("sparkscript/core/codeDump");` or `import codeDump from "sparkscript/core/codeDump";`# Build from source
You can use either `npm` or `yarn` for this.
```sh
mkdir sparkscript
cd sparkscript
git clone https://github.com/UserUNP/sparkscript .
npm install
npm run build
```