PrismarineJS / flying-squid

Create Minecraft servers with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/flying-squid/
MIT License
542 stars 101 forks source link

Help with example plugin to build structures #294

Closed richpaul1 closed 7 years ago

richpaul1 commented 7 years ago

Hi,

Looking for some guidance on how to go about creating plugins that mimic the ScriptCraft Drone API for building forts etc.

https://github.com/walterhiggins/ScriptCraft/blob/master/src/main/js/plugins/drone/contrib/fort.js

I appreciate the work being on on flying-squid. Having a pure JS minecraft server is very beneficial in teaching kids how to program in Javascript. Other solutions like ScriptCraft have one downfall in that you are not able to step through the execution of your code with a debugger.

I would like to assist in building out similar plugins with the focus of making it easy to teach kids Javascript.

Any help would be appreciated. Ideally if someone can provide a sample plugin of building a fort, I can then try my hand at building out the other features.

Thanks, Richard

demipixel commented 7 years ago

As it currently stands, ScriptCraft may be your best bet as flying-squid isn't fully developed yet and is missing a lot of features that exist in vanilla Minecraft.

That being said, there isn't any kind of "drone" that makes it easy to move up and down through the world. If you wanted to place a block, you'd do: serv.setBlock(world, position, id, data);

Getting a position above it might be newPos = position.plus(0, 1, 0), and then you'd need to setBlock again.

ghost commented 7 years ago

Hey! The docs might help you out: https://github.com/PrismarineJS/flying-squid/blob/master/doc/API.md

We do not plan to write a ScriptCraft-like API as we've got a different architecture. I do think that building a plugin example like this would be interesting. I'll take a look at it and see if I can port it/write something similar

richpaul1 commented 7 years ago

Thanks for the quick responses and I appreciate all the help.

I am hoping to create a one week summer program for kids in my community to teach them how to code. I am hoping I can make this happen with the JavaScript language and to have the program summer of 2017 in a suburb of Chicago.

Here are some of my goals :

  1. Code completion and Debugger using an IDE like Visual Studio Code
  2. Make changes to the code quickly and it does not require a restart.
  3. Ideally be able to write code using a testing framework

The workflow would be along these lines :

  1. Work on a JS snippet
  2. Test and Debug code
  3. Fire up Minecraft Client for functional test

Stretch Goal : Integrate with external devices e.g. Drones, Rasberry PIs, Alexa etc.

ghost commented 7 years ago

Sounds awesome! I would look into mineflayer as well, for making bots on the client-side

bdsomer commented 7 years ago

Close this...?