在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):walterhiggins/ScriptCraft开源软件地址(OpenSource Url):https://github.com/walterhiggins/ScriptCraft开源编程语言(OpenSource Language):JavaScript 97.4%开源软件介绍(OpenSource Introduction):ScriptCraft - Modding Minecraft with JavascriptScriptCraft lets you write Minecraft Mods using Javascript - a programming language that's relatively easy to learn and use. ScriptCraft is a Minecraft Server plugin which means it must be used with a Minecraft server. Once you've downloaded and installed the Minecraft Server, then installed the ScriptCraft Plugin you can write your own Minecraft mods using Javascript. I created ScriptCraft to make it easier for younger programmers to create their own Minecraft Mods. Mods are written using the JavaScript programming language. Once the ScriptCraft mod is installed, you can add your own new Mods by adding JavaScript (.js) files in a directory.
This is a simple mod in a file called greet.js in the scriptcraft/plugins directory: function greet( player ) {
echo( player, 'Hello ' + player.name );
}
exports.greet = greet; At the in-game prompt, type: /js greet(self) Anything you can do using the Spigot or CanaryMod APIs in Java, you can do using ScriptCraft in JavaScript. DescriptionScriptCraft is a plugin for Minecraft Servers which lets operators, administrators and plug-in authors customize the game using JavaScript. ScriptCraft makes it easier to create your own mods. Mods can be written in Javscript and can use the full SpigotMC API or CanaryMod API. ScriptCraft works with all of the following Minecraft Server software: I recommend using SpigotMC because both CanaryMod and CraftBukkit are
no longer being actively developed. The ScriptCraft mod also lets you
enter javascript commands at the in-game prompt. To bring up the
in-game prompt press the ScriptCraft also includes many objects and functions to make building
and modding easier using JavaScript. The JavaScript PrerequisitesScriptCraft is a Minecraft Server Mod which only works with Minecraft
for Personal computers (Windows, Mac and Linux). It does not work with
X-BOX, Playstation or WiiU versions of the game. You will need to have
Java version 7 or later installed. Check the version by typing InstallationBefore installing ScriptCraft you must first install SpigotMC which is a special version of Minecraft Server that makes it easy to customize the game. Installing and Running SpigotMCFollow these steps to download and install SpigotMC.
Installing ScriptCraftFollow these steps to download and install ScriptCraft.
Congratulations - you've just installed your Custom Minecraft Server and are ready to begin writing your first mod! Post InstallOnce installed, a new scriptcraft/plugins directory is automatically
created. All files in the scriptcraft/plugins directory will be
automatically loaded when the server starts. Only players who are
ops can use this plugin. You can grant a player Launch the server, then launch the Minecraft client and create a new
server connection. The IP address will be
… This will create a black monolith structure 4 blocks wide by 9 blocks high by 1 block long. Take a look at the src/main/javascript/drone/drone.js file to see what ScriptCraft's drone can do. If you're interested in customizing minecraft beyond just creating new buildings, take a look at the homes mod for an example of how to create a more fully-featured JavaScript plugin for Minecraft. Your first mod - Howling blocksListed below is a simple mod that will make blocks 'Howl' when they're broken. // copy and paste this code to a new file named 'scriptcraft/plugins/howling-blocks.js'
var sounds = require('sounds');
function howl(event){
sounds.entityWolfHowl( event.block );
}
events.blockBreak( howl ); If you're using CanaryMod instead of SpigotMC you can download the equivalent code. A JavaScript mod for minecraft is just a JavaScript source file (.js) located in the scriptcraft/plugins directory. All .js files in this directory will be automatically loaded when the server starts. To get started writing your own mod, take a look at some of the examples. Additional informationBecause the SpigotMC API is open, all of the SpigotMC API is accessible via javascript once the ScriptCraft plugin is loaded. There are a couple of useful Java objects exposed via javascript in the ScriptCraft plugin:
ContributingIf you would like to contribute source code and/or documentation changes please read contributing.md StatusBukkit Configuration(You can ignore this if using CanaryMod)ScriptCraft works with Bukkit Plugin and uses the Bukkit Configuration API. On first loading, ScriptCraft will create a config.yml file in the plugins/scriptcraft/ directory. This file looks like this:
This file allows scriptcraft admins to turn on or off re-unzipping of the Further Reading
You can find more information about ScriptCraft on my blog. Additional ResourcesCoderDojo Athenry have some excellent tutorials for younger programmers who have used Scratch and are interested in Modding Minecraft using JavaScript. In particular, they have an excellent Scratch - to - JavaScript tutorial which explains Scratch programs and how to do the same thing in JavaScript. I highly recommend the series of tutorials provided by CoderDojo Athenry. Developer Chris Cacciatore has created some interesting tools using ScriptCraft: DockerTo launch a container with SpigotMC and ScriptCraft you can just do
You can find all files used to build this container in github project: docker-scriptcraft |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论