npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@macro21kgb/create-datapack

v3.1.1

Published

A simple way to generate Datapacks

Downloads

11

Readme

Create a Datapack Fast and Easily

This very simple CLI can generate a default data pack folder structure, while also generating global advancements that allow the pack to integrate with other datapacks.

NEW STRUCTURE-GENERATOR MODULE Added to the available modules

You can check the datapack conventions here

Usage

Install nodejs

then type in your terminal to install the CLI globally:

npm i -g @macro21kgb/create-datapack

After that you can create a new datapack in the current directory with

create-datapack

or

npx create-datapack

You can also see more info with

create-datapack --help

AVAILABLE MODULES

Now with this command you can access different modules for any occasion

  • The Structure-Generator, It will generate a structure given from a template (see below), you simply create in the root directory of your datapack, a "structures" folder and the structure file (the file are with .mcs extension)

  • The Auto-uninstaller,It will scan your datapack an create an uninstall.mcfunction just for you, (run it in the root directory, where is the pack.mcmeta file)

  • The Summon-Give Convert, Convert your commands into give to summon or summon to give (a little bit buggy but it is ok for most thing)

  • The Generator-Sites Module, This will give you the link of some of my custom generators (floor-crafting and crafting table recipe)

create-datapack -m

or 

create-datapack --modules

Template System for datapacks template (.mclate)

The templates are written in a custom language, it is very simple and easy to use, below there is an example of everything you can do:

<###>Test Template <-- name of the template, must be first line

<===functions:load  <-- location of the file : name of the function without extension (auto-added)
scoreboard objectives add tf_rc dummy
scoreboard objectives add tf_detection minecraft.used:minecraft.carrot_on_a_stick
===>

<===functions:main
execute as @a[scores={tf_detection=1..}] at @s run say CLICK
execute as @a[scores={tf_detection=1..}] at @s run function NAMESPACE:start_raycast
execute as @a[scores={tf_detection=1..}] at @s run scoreboard players set @s tf_detection 0
===>

<===functions/test/subfolder:test  <-- you can create sub-folder easily like that
say super duper test
===>

<===tags/blocks:passable_blocks  <-- NOT only functions!
{
  "values":[
    "minecraft:air",
    "minecraft:void_air",
    "minecraft:cave_air",
    "minecraft:water",
    "minecraft:lava",
    "minecraft:grass"
}
===>

Delimiters for the custom template

Name of the template

<###>This is the Name of the Template

File start and end markers (you can obviously create multiple files in a template):

<===file_location/folder:name_of_the_file   <-- start of a file

===> <-- end of the file

When executing function and you need the namespace of the datapack, set it like this (use NAMESPACE):

<===functions:main
execute as @a[scores={tf_detection=1..}] at @s run say CLICK
execute as @a[scores={tf_detection=1..}] at @s run function NAMESPACE:start_raycast <-- the namespace is taken automatically
execute as @a[scores={tf_detection=1..}] at @s run scoreboard players set @s tf_detection 0
===>

Template System for Structures (.mcs)

The template syntax is very simple and easy to use, you simply create your structure layer by layer.

This schematic will create a 3x3 cube of stone with an hole in the middle:

S S S <-- this is the first layer
S S S <-- space between each symbol
S S S
---   <-- three "-", it means to go up one level
S S S <-- this is the second layer and so on...
S A S
S S S
---
S S S
S S S
S S S
===   <-- it means that the schematic is finished
S minecraft:stone <-- symbol block_associated_with
A minecraft:air

the structure-generator module will create in the functions folder a new file named "templatefilenamehere".mcfunction

Also, yeah i can do some check and convert some commands in fill, ecc.. but for now is good enough.

Info

You can create all possible files with the template system, The location in the datapack folder structure part is without error handling so be careful.

All the folder paths can be found on the wiki and as shown in the example you can create sub folders and extensions are added automatically

Where can i found the templates folder?

When you are going to use a template, the path to the templates folder will appear inside the CLI, go to the indicated path and add or modify whatever you want.

Bugs or something else?

If you encounter bugs or some missed features that you want, create a new issue on github, and i will check it out as soon as possible. create-datapack-github

If you want, you can also message me on PMC (Planet Minecaft) website

My PMC Profile