dragonblocks.chatMessage(message : String) : void
Write something into the chatconsole. (alias for dragonblocks.chat.write)
dragonblocks.checkWorldExistance(worldname : String) : Boolean
- Check if a world exists or not
+ Check if a world exists or not (secure check)
dragonblocks.checkWorldOwnership(worldname : String) : Boolean
- Check if a world is owned by the user
+ Check if a world is owned by the current user (secure check)
dragonblocks.checkWorldSpelling(worldname : String) : Boolean
Check if a worldname is OK (e.g. does not contain special chacters)
dragonblocks.clearTimer(name : String, meta : Object) : void
Clear a timer set using dragonblocks.setTimer
+ meta is the variable the timer is stored in
+ name is the timer's name (also stored in meta[name] while the timer is running)
dragonblocks.createItemstack(itemstring : String) : dragonblocks.Itemstack
Create an Itemstack object and immediately parse the provided itemstring.
dragonblocks.createWorld(properties : Object) : void
Execute the final steps added using dragonblocks.addFinalStep. Not to be used!
dragonblocks.finishTimer(name : String, meta : Object) : void
Immediately finish a timer set using dragonblocks.setTimer
+ meta is the variable the timer is stored in
+ name is the timer's name (also stored in meta[name] while the timer is running)
dragonblocks.generateMap() : void
Run the Mapgen selected in the mainmenu. Not to be used.
dragonblocks.getEmptyWorld() : Object
Returns the path of an Mod or Gamemod. Use this instead of e.g. "mods/" + modname + "/" + ...
dragonblocks.getNode(x, y) : dragonblocks.MapNode
Returns the MapNode at x, y.
+ You can use the object to read its properties.
dragonblocks.getPixelManipulator(manip : Array) : dragonblocks.PixelManipulator
Returns an Pixel Manipulator. Same as new dragonblocks.PixelManipulator(manip)
+ You have to provide a Pixel Manipulator which is then made usable by this function.
+ For further information on how to use Pixel Manipulators, consult Pixel_Manipulator.md
dragonblocks.getSavestring() : String
Return the save string for the world
dragonblocks.getSound(filename : String) : String
Same as dragonblocks.getSound, exept for Textures and, if the file is found, it will surrond it with url() so you can do elem.style.background = dragonblocks.getTexture(...)
dragonblocks.getToken() : String
Returns a unique string starting with #
+ Useful when working with entities as they all need an ID
dragonblocks.getTool(name : String) : dragonblocks.Tool
Returns the tool with the id "name".
dragonblocks.getVersion() : String
dragonblocks.log(message : String) : void
Add a message to the backlog.
dragonblocks.gui.toggleLayer() : void
- Toggle the Layer.
+ Toggle (show or hide) the Layer.
dragonblocks.gui.openLayer() : void
+ Not implemented yet
dragonblocks.gui.showLayer() : void
- Open the Layer
+ Show the Layer
dragonblocks.gui.closeLayer() : void
+ Not implemented yet
dragonblocks.gui.hideLayer() : void
Hide the Layer
dragonblocks.gui.createBox(properties : Object) : Element
List of saved worlds of logged-in user
## Classes
-## Modding tutorial
-### dragonblocks.register method
-#### dragonblocks.registerEntity
- dragonblocks.registerEntity({
- name: "mod_tutorial:entity", // Entitystring
- desc: "Tutorial entity", // Entity description
- texture: "entity.png", // Entity texture
- width: 1, // Entity width
- height: 2, // Entity height
- verticalSpeed: 6.5, // Entity jump speed (affects height)
- horizontalSpeed: 4, // Entity walk speed
- gravity: true, // Enable or disable gravity
- onspawn: self => {
- alert("Entity spawned!");
- }
- onpunch: self => {
- alert("Entity punched!");
- self.despawn(); // Let entity despawn
- }
- onclick: self => {
- alert("Entity clicked!");
- self.jumpOnce(); // Make entity jump once
- }
- });
-#### dragonblocks.registerItem
- dragonblocks.registerItem({
- name: "mod_tutorial:item", // Itemstring
- desc: "Tutorial entity spawner", // Item description
- texture: "item.png", // Item texture
- onuse: (x, y) => {
- let entity = dragonblocks.spawnEntity("mod_tutorial:entity", x, y); // Spawn entity and save it to a variable (for later access)
- }
- });