objd 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 72

objD #

Objective Builder Just for Datapacks

objD is a framework for developing Datapacks for Minecraft. It uses the Dart programming language.

Why a framework? #

A framework is a set of utilities to reduce the amount of repetitive work. I've tried many ways in the past to achieve a quick and easy way to generate Datapacks for Minecraft: A own programming language mcscript, several graphical online generators at stevertus.com or premade utilities.

Instead of developing a language, why not using the tools and parser an other language gives you? By building a custom frame around it you get the reliability and the extensive debugging tools in Editors.

The generation of Datapacks is easy,fast and aims to be less repetitive and modular by utilizing the concept of Widgets as one of the main features.

Installation #

[Temporary]

You need the Dart SDK for this framework. Download and install it from https://www.dartlang.org/tools/sdk

I would also recommend Visual Studio Code along with the dart plugin to edit dart files very conveniently.

Make a new folder that will house your project wherever you want(I would recommend datapacks folder).

And inside of that create a file named pubspec.yaml and another folder called lib.

Open the pubspec.yaml file and add

dependencies:  
   objd: ^0.1.3

And run

$  pub get

with the console in the new folder(VS code does this automatically)

Getting started #

Let's get started and create our first dart file with lib/main.dart file.

Then we import the framework with:

import 'package:objd/core.dart';

Then we need to create a new datapack project:

void main(){
	createProject(
		Project(
			name:"This is going to be the generated folder name",
			target:"./", // path for where to generate the project
			generate: CustomWidget() // The starting point of generation
		)
	);
}

Next of we need to build this custom Widget:

class CustomWidget extends Widget {
	@override
	Widget generate(Context context){
		
	}
}

To get more details on why we build it like that, check out the Widget documentation.

Like we can see the generate method, which is called on build, has to return another Widget, in our case an instance of the Pack class.

Widget generate(Context context){
	return Pack(
		name:"mypack",
		main: File( // optional
			path: 'main'
		)
	)
}

What we are doing right now is to generate a new subpack with a name(This will be the namespace of your functions later) and a main file(runs every tick) with the name "main.mcfunction".

You can run the project already and the result should be a pack with an empty main.mcfunction file.

So lets add some functionality to our project in our main file.

main: File(
	path: 'main',
	child: Say(msg:'Hello World')
)

But how to add a list of Actions then? Well there's also an Widget for that: For.of

child: For.of(List<Widget>[
	Say(msg:'Hello World'),
	Command('setblock 0 0 0 air')
])

So now we have a List of Widget, so we can use as many as we want

Documentation and Examples #

The example folder contains a boilerplate to start off.

There are many more widgets for objD including basic Widgeds, Command Wrappers, Text and Util Widgets. So check out the documentation at https://stevertus.com/objD/documentation or my youtube channel https://www.youtube.com/stevertus

0.1.3 #

  • added Bossbar
  • added nbt TextComponents
  • added encapsulate to If
  • added strNbt to Data and Entity to support unvalid json chars
  • reworked the global console commands and binaries
  • fixed data modify
  • fixed missing datatype and scale with entity.storeResult

0.1.2 #

  • added RandomScore
  • added a Team wrapper
  • added a team option for entities as well as joinTeam and leaveTeam methods
  • added Repeat to repeat code with delay
  • added Log Widget to quickly print Messages, Scores or Entities in the chat
  • added ArmorStand Widget to create an armorstand
  • added Hologram to display text
  • added AreaEffectCloud
  • added Tag.toggle
  • added a create option to File
  • added a nbt option for Setblock
  • added Score.fromSelected to avoid annoying Entity.Selected
  • changed summon arguments
  • changed effect to also support nbt effects
  • changed Location to optional arguments
  • fixed when there are two identical files that they would extend

0.1.1 #

  • added AroundLocation widget
  • added Trigger wrapper
  • added Effect wrapper
  • added Particle wrapper
  • added clone wrapper
  • added nbt option for entities
  • added score.con for constants
  • added display name and lore for items
  • changed global commands and boilerplate project
  • fixed execute align
  • fixed execute bug if targetPath was null
  • fixed timer not generating schedule

0.1 #

with the first proper release there are the first util classes:

  • added Timeout and Timer widgets for delays and clocks
  • added Tag widget
  • added Schedule widget
  • added scores and tags parameters in any entity constructor
  • added addTag, addTags and removeTag Methods on entity
  • added targetFilePath and targetFileName parameters for the execute and if constructors to force a folder or filename
  • added suffix option for groups
  • added tag condition
  • added compile time
  • added experimental global commands
  • changed if behaviour to use a Tag instead with or conditions, else statement or multiple then children
  • fixed: nested groups generated in the wrong order
  • fixed entity Range generating unvalid results for -10..0
  • fixed groups that generated a different file than execution name(still some issues)

0.0.10 #

  • added experimental if else statements(may be changed later on)
  • added an if option for execute as well
  • added the area class
  • fixed group
  • fixed requirement for slot and count for items
  • changed entity static functions to named constructors(for Entity.Selected...)
  • updated fill to use area instead
  • updated teleport to use rotation
  • updated to dart 2.1.1
  • added inline documentation for many widgets
  • split the build process into multiple files

0.0.9 #

  • added subcommands for execute
  • added methods for execute
  • added storeResult to Location and Entity
  • added Rotation
  • fixed reference issue for groups(they prefixed everything :o)

0.0.8 #

  • added Entity.PlayerName()
  • fixed readme
  • modified score.setToResult
  • made Block, EntityType and ItemType constants to use them in defaults

0.0.7 #

  • added score generation
  • added Scoreboard
  • added Score with calculation and condition methods
  • fixed that main and load functions were not executed

0.0.6 #

  • added teleport
  • added fill
  • added data widget and DataModify to edit nbt data
  • updated entity with area parameter

0.0.5 #

0.0.4 #

  • added Summon command wrapper
  • added TextComponents
  • added Title and Tellraw
  • added Color class
  • added TextClickEvent class
  • added TextHoverEvent class

0.0.3 #

  • added Block
  • added Location
  • added Setblock
  • added Say

0.0.2 #

  • Fixed ReadMe

0.0.1 #

  • Initial Project with Basics and Builder

example/example.dart

// import the core of the framework:
import 'package:objd/core.dart';
// import the custom pack:
import './packs/examplePack.dart';

void main() {
  createProject(
    Project(
      name: "folder name",
      target: "./",             // path for where to generate the project
      generate: ExamplePack(),  // The starting point of generation
    ),
  );
}

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate objd

2. Use it

The package has the following executables:


$ objd

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  objd: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:objd/basic/area.dart';
import 'package:objd/basic/block.dart';
import 'package:objd/basic/command.dart';
import 'package:objd/basic/condition.dart';
import 'package:objd/basic/entity.dart';
import 'package:objd/basic/extend.dart';
import 'package:objd/basic/file.dart';
import 'package:objd/basic/for_list.dart';
import 'package:objd/basic/group.dart';
import 'package:objd/basic/item.dart';
import 'package:objd/basic/location.dart';
import 'package:objd/basic/pack.dart';
import 'package:objd/basic/rotation.dart';
import 'package:objd/basic/score.dart';
import 'package:objd/basic/scoreboard.dart';
import 'package:objd/basic/tag.dart';
import 'package:objd/basic/text.dart';
import 'package:objd/basic/text_components.dart';
import 'package:objd/basic/widget.dart';
import 'package:objd/basic/widgets.dart';
import 'package:objd/build/build.dart';
import 'package:objd/build/buildFile.dart';
import 'package:objd/build/context.dart';
import 'package:objd/build/create_project.dart';
import 'package:objd/build/io.dart';
import 'package:objd/core.dart';
import 'package:objd/utils/areaeffectcloud.dart';
import 'package:objd/utils/armorstand.dart';
import 'package:objd/utils/aroundlocation.dart';
import 'package:objd/utils/hologram.dart';
import 'package:objd/utils/log.dart';
import 'package:objd/utils/randomScore.dart';
import 'package:objd/utils/repeat.dart';
import 'package:objd/utils/timer.dart';
import 'package:objd/utils/widgets.dart';
import 'package:objd/wrappers/bossbar.dart';
import 'package:objd/wrappers/clone.dart';
import 'package:objd/wrappers/comment.dart';
import 'package:objd/wrappers/data.dart';
import 'package:objd/wrappers/effect.dart';
import 'package:objd/wrappers/execute.dart';
import 'package:objd/wrappers/fill.dart';
import 'package:objd/wrappers/give.dart';
import 'package:objd/wrappers/if.dart';
import 'package:objd/wrappers/kill.dart';
import 'package:objd/wrappers/particle.dart';
import 'package:objd/wrappers/replaceitem.dart';
import 'package:objd/wrappers/say.dart';
import 'package:objd/wrappers/schedule.dart';
import 'package:objd/wrappers/setblock.dart';
import 'package:objd/wrappers/summon.dart';
import 'package:objd/wrappers/team.dart';
import 'package:objd/wrappers/teleport.dart';
import 'package:objd/wrappers/tellraw.dart';
import 'package:objd/wrappers/title.dart';
import 'package:objd/wrappers/trigger.dart';
import 'package:objd/wrappers/widgets.dart';
  
Version Uploaded Documentation Archive
0.1.3 Apr 10, 2019 Go to the documentation of objd 0.1.3 Download objd 0.1.3 archive
0.1.2 Mar 17, 2019 Go to the documentation of objd 0.1.2 Download objd 0.1.2 archive
0.1.1 Mar 8, 2019 Go to the documentation of objd 0.1.1 Download objd 0.1.1 archive
0.1.0 Feb 26, 2019 Go to the documentation of objd 0.1.0 Download objd 0.1.0 archive
0.0.10 Feb 22, 2019 Go to the documentation of objd 0.0.10 Download objd 0.0.10 archive
0.0.9 Feb 18, 2019 Go to the documentation of objd 0.0.9 Download objd 0.0.9 archive
0.0.8 Feb 17, 2019 Go to the documentation of objd 0.0.8 Download objd 0.0.8 archive
0.0.7 Feb 16, 2019 Go to the documentation of objd 0.0.7 Download objd 0.0.7 archive
0.0.6 Feb 12, 2019 Go to the documentation of objd 0.0.6 Download objd 0.0.6 archive
0.0.5 Feb 9, 2019 Go to the documentation of objd 0.0.5 Download objd 0.0.5 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
62
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Apr 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io.

Health suggestions

Fix lib/wrappers/if.dart. (-1.99 points)

Analysis of lib/wrappers/if.dart reported 4 hints:

line 38 col 23: Avoid types as parameter names.

line 39 col 12: Avoid types as parameter names.

line 59 col 23: Avoid types as parameter names.

line 60 col 12: Avoid types as parameter names.

Fix lib/basic/command.dart. (-1 points)

Analysis of lib/basic/command.dart reported 2 hints:

line 32 col 23: Use isNotEmpty instead of length

line 56 col 9: Use isNotEmpty instead of length

Fix lib/basic/item.dart. (-1 points)

Analysis of lib/basic/item.dart reported 2 hints:

line 19 col 23: Use isNotEmpty instead of length

line 34 col 23: Use isNotEmpty instead of length

Fix additional 57 files with analysis or formatting issues. (-5 points)

Additional issues in the following files:

  • lib/build/buildFile.dart (2 hints)
  • bin/objd.dart (1 hint)
  • lib/basic/entity.dart (1 hint)
  • lib/basic/group.dart (1 hint)
  • lib/basic/text_components.dart (1 hint)
  • lib/wrappers/clone.dart (1 hint)
  • lib/wrappers/fill.dart (1 hint)
  • lib/wrappers/replaceitem.dart (1 hint)
  • lib/wrappers/team.dart (1 hint)
  • bin/new.dart (Run dartfmt to format bin/new.dart.)
  • bin/run.dart (Run dartfmt to format bin/run.dart.)
  • bin/serve.dart (Run dartfmt to format bin/serve.dart.)
  • lib/basic/area.dart (Run dartfmt to format lib/basic/area.dart.)
  • lib/basic/block.dart (Run dartfmt to format lib/basic/block.dart.)
  • lib/basic/condition.dart (Run dartfmt to format lib/basic/condition.dart.)
  • lib/basic/extend.dart (Run dartfmt to format lib/basic/extend.dart.)
  • lib/basic/file.dart (Run dartfmt to format lib/basic/file.dart.)
  • lib/basic/for_list.dart (Run dartfmt to format lib/basic/for_list.dart.)
  • lib/basic/location.dart (Run dartfmt to format lib/basic/location.dart.)
  • lib/basic/pack.dart (Run dartfmt to format lib/basic/pack.dart.)
  • lib/basic/rotation.dart (Run dartfmt to format lib/basic/rotation.dart.)
  • lib/basic/score.dart (Run dartfmt to format lib/basic/score.dart.)
  • lib/basic/scoreboard.dart (Run dartfmt to format lib/basic/scoreboard.dart.)
  • lib/basic/tag.dart (Run dartfmt to format lib/basic/tag.dart.)
  • lib/basic/text.dart (Run dartfmt to format lib/basic/text.dart.)
  • lib/basic/widget.dart (Run dartfmt to format lib/basic/widget.dart.)
  • lib/basic/widgets.dart (Run dartfmt to format lib/basic/widgets.dart.)
  • lib/build/build.dart (Run dartfmt to format lib/build/build.dart.)
  • lib/build/context.dart (Run dartfmt to format lib/build/context.dart.)
  • lib/build/create_project.dart (Run dartfmt to format lib/build/create_project.dart.)
  • lib/build/io.dart (Run dartfmt to format lib/build/io.dart.)
  • lib/core.dart (Run dartfmt to format lib/core.dart.)
  • lib/utils/areaeffectcloud.dart (Run dartfmt to format lib/utils/areaeffectcloud.dart.)
  • lib/utils/armorstand.dart (Run dartfmt to format lib/utils/armorstand.dart.)
  • lib/utils/aroundlocation.dart (Run dartfmt to format lib/utils/aroundlocation.dart.)
  • lib/utils/hologram.dart (Run dartfmt to format lib/utils/hologram.dart.)
  • lib/utils/log.dart (Run dartfmt to format lib/utils/log.dart.)
  • lib/utils/randomScore.dart (Run dartfmt to format lib/utils/randomScore.dart.)
  • lib/utils/repeat.dart (Run dartfmt to format lib/utils/repeat.dart.)
  • lib/utils/timer.dart (Run dartfmt to format lib/utils/timer.dart.)
  • lib/wrappers/bossbar.dart (Run dartfmt to format lib/wrappers/bossbar.dart.)
  • lib/wrappers/comment.dart (Run dartfmt to format lib/wrappers/comment.dart.)
  • lib/wrappers/data.dart (Run dartfmt to format lib/wrappers/data.dart.)
  • lib/wrappers/effect.dart (Run dartfmt to format lib/wrappers/effect.dart.)
  • lib/wrappers/execute.dart (Run dartfmt to format lib/wrappers/execute.dart.)
  • lib/wrappers/give.dart (Run dartfmt to format lib/wrappers/give.dart.)
  • lib/wrappers/kill.dart (Run dartfmt to format lib/wrappers/kill.dart.)
  • lib/wrappers/particle.dart (Run dartfmt to format lib/wrappers/particle.dart.)
  • lib/wrappers/say.dart (Run dartfmt to format lib/wrappers/say.dart.)
  • lib/wrappers/schedule.dart (Run dartfmt to format lib/wrappers/schedule.dart.)
  • lib/wrappers/setblock.dart (Run dartfmt to format lib/wrappers/setblock.dart.)
  • lib/wrappers/summon.dart (Run dartfmt to format lib/wrappers/summon.dart.)
  • lib/wrappers/teleport.dart (Run dartfmt to format lib/wrappers/teleport.dart.)
  • lib/wrappers/tellraw.dart (Run dartfmt to format lib/wrappers/tellraw.dart.)
  • lib/wrappers/title.dart (Run dartfmt to format lib/wrappers/title.dart.)
  • lib/wrappers/trigger.dart (Run dartfmt to format lib/wrappers/trigger.dart.)
  • lib/wrappers/widgets.dart (Run dartfmt to format lib/wrappers/widgets.dart.)

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://stevertus.com/objD was unreachable.

Documentation URL doesn't exist. (-10 points)

At the time of the analysis the documentation field https://stevertus.com/objD/documentation was unreachable.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
colorize ^2.0.0 2.0.0
meta ^1.1.7 1.1.7
path ^1.6.2 1.6.2
watcher ^0.9.7+10 0.9.7+10
Transitive dependencies
async 2.2.0
collection 1.14.11