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

zen-flow

v2.10.0

Published

MineTweaker ZenScript made easy.

Downloads

76

Readme

Install

$ npm i zen-flow -D

Note: This package requires Node >10.12.0 and Minecraft 1.7.10.

Features

  • Easy to use API, written in TypeScript.
  • Polymorphic and variadic; do more with less code.
  • Supports both MineTweaker3 and ModTweaker.
  • Formatted output; makes debugging easier.

Getting started

Crafting Table Add crafting recipe

import { vanilla } from 'zen-flow';

vanilla.add('<minecraft:saddle>', {
  1: '<minecraft:leather>', 2: '<minecraft:leather>', 3: '<minecraft:leather>',
  4: '<ore:ingotIron', 5: '<minecraft:string>', 6: '<ore:ingotIron>'
});

/**
 * recipes.addShaped(<minecraft:saddle>, [
 * 	[<minecraft:leather>, <minecraft:leather>, <minecraft:leather>],
 * 	[<ore:ingotIron>, <minecraft:string>, <ore:ingotIron>],
 * 	[null, null, null]
 * ]);
 **/

vanilla.add('<minecraft:saddle>', { edge: '<minecraft:leather>' });

/**
 * recipes.addShaped(<minecraft:saddle>, [
 * 	[null, <minecraft:leather>, null],
 * 	[<minecraft:leather>, null, <minecraft:leather>],
 * 	[null, <minecraft:leather>, null]
 * ]);
 **/

Extra Utilities generators Remove & hide generators

import { nei, vanilla } from 'zen-flow';

Array.from({ length: 11 })
  .map((_, i) => [
    `<ExtraUtilities:generator${i === 0 ? '' : `:${i}`}>`,
    `<ExtraUtilities:generator.8${i === 0 ? '' : `:${i}`}>`,
    `<ExtraUtilities:generator.64${i === 0 ? '' : `:${i}`}>`
  ])
  .flat()
  .map(generator => [
    vanilla.remove(generator),
    nei.hide(generator)
  ].join('\n'));

/**
 * recipes.remove(<ExtraUtilities:generator>);
 * NEI.hide(<ExtraUtilities:generator>);
 * [...]
 * recipes.remove(<ExtraUtilities:generator.64:10>);
 * NEI.hide(<ExtraUtilities:generator.64:10>);
 **/

API

Patterns

Shaped crafting recipes support the following shorthand patterns, in order:

Square

[
  [square, square, null],
  [square, square, null],
  [null, null, null]
]

Ring

[
  [ring, ring, ring],
  [ring, center, ring],
  [ring, ring, ring]
]

Edge / Corner

[
  [corner, edge, corner],
  [edge, center, edge],
  [corner, edge, corner]
]

Default

[
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9]
]

Recipes

Items

  • addDict - Add ingredients to ore dictionary
  • removeDict - Remove ingredients from ore dictionary
  • withName - Change item name
  • withTooltip - Add item tooltip*
  • withTooltipShift - Add shift item tooltip*
  • withTag - Add item NBT tag data
  • withEnchantment - Add item enchantment(s)

* It is currently not possible to remove item tooltips.

Formatting

withName, withTooltip and withTooltipShift accept formatting strings:

// Bread
withName('<minecraft:bread>', 'Bread');

// Bread (with red text)
withName('<minecraft:bread>', { text: 'Bread', colour: 'red' });

// Bread (bold red text)
withName('<minecraft:bread>', { text: 'Bread', colour: 'red', format: 'bold' });

// Bread (normal text) with butter (yellow italic text)
withName('<minecraft:bread>', [
  'Bread',
  { text: 'with butter', colour: 'yellow', format: 'italic' }
]);

Vanilla

  • add - Add a crafting table recipe.
    • Shaped recipe: object
    • Shapeless recipe: Array
  • addMirror - Adds a shaped crafting table recipe with mirrored variant.
  • remove - Removes both shaped and shapeless recipes
  • removeShaped - Removes only shaped recipes
  • removeShapeless - Removes only shaped recipes
  • replace - Replaced crafting recipe
    • Shaped recipe: object
    • Shapeless recipe: Array
  • replaceAll - Replace all recipes
  • replaceMany - Remove all recipes and add multiple recipes
  • addFurnace - Adds furnace recipe
  • removeFurnace - Removes furnace recipe
  • addFurnaceFuel - Add furnace fuel (excluding vanilla fuels)
  • removeFurnaceFuel - Removes furnace fuel (excluding vanilla fuels)

Forestry

  • addCarpenter - Add Carpenter recipe
  • removeCarpenter - Remove Carpenter recipe
  • addCentrifuge - Add Centrifuge recipe
  • removeCentrifuge - Remove Centrifuge recipe
  • addFermenter - Add Fermenter recipe
  • removeFermenter - Remove Fermenter recipe
  • addFermenterFuel - Add Fermenter fuel
  • removeFermenterFuel - Remove Fermenter fuel
  • addMoistener - Add Moistener recipe
  • removeMoistener - Remove Moistener recipe
  • addSqueezer - Add Squeezer recipe
  • removeSqueezer - Remove Squeezer recipe
  • addStill - Add Still recipe
  • removeStill - Remove Still recipe
  • addFabricator - Add Thermionic Fabricator recipe
  • removeFabricator - Remove Thermionic Fabricator recipe
  • addFabricatorFuel - Add Thermionic Fabricator glass source
  • removeFabricatorFuel - Remove Thermionic Fabricator glass source

Applied Energistics 2

  • addGrinder - Add Quartz Grindstone recipe
    • bonus must be a value between 0 and 1
  • removeGrinder - Remove Quartz Grindstone recipe
  • addInscriber - Add Inscriber recipe
  • removeInscriber - Remove Inscriber recipe

Avaritia

  • addCompressor - Add Neutronium Compressor recipe
  • removeCompressor - Remove Neutronium Compressor recipe
  • addExtreme - Add Extreme Crafting recipe
  • removeExtreme - Remove Extreme Crafting recipe

ExNihilo

  • addComposter - Add item that can be composted to dirt
    • fill must be a value between 0 and 1
  • removeComposter - Remove item that can be composted to dirt
  • addCrucibleNihilo - Add crucible recipe
  • removeCrucibleNihilo - Remove crucible recipe
  • addCrucibleSource - Add crucible heat source
    • heat must be a value between 0 and 1
  • removeCrucibleSource - Remove crucible heat source
  • addHammer - Add hammer recipe
  • removeHammer - Remove hammer recipe
  • addSieve - Add sieve recipe
    • Some percentages are impossible, such as
      • 0.7 => 1 / 0.7 => ~1.42 => 1 (100%)
      • 0.13 => 1 / 0.13 => ~7.69 => 8 (12.5%)
  • removeSieve - Remove sieve recipe
Examples
import { exnihilo } from 'zen-flow';

exnilo.addHammer('<minecraft:cobblestone>', {
  '<minecraft:stick>': 0.5, // 50%
  '<minecraft:bread>': [1, 1, 0.5] // 100%, 100%, 50%
  '<minecraft:stone>': [{ chance: 1, modifier: 2 }, { chance: 0.5, modifier: 1 }] // 100% with 2x modifier, 50% with 1x modifier
  '<minecraft:coal>': [{ chance: 1, modifier: 2 }, 1] // 100% with 2x modifier, 100% 
});

exnihilo.addSieve('<minecraft:cobblestone>', {
  '<minecraft:stick': 2.5 // 250%
  '<minecraft:bread>': 0.33 // 33%
});

ExtraUtilities

  • addQED - Add QED recipe
    • QED only accepts shaped recipes
  • removeQED - Remove QED recipe
  • replaceQED - Replace QED recipe

MineFactoryReloaded

  • addLaser - Add ore to the Mining Laser ore table
  • removeLaser - Remove ore from the Mining Laser ore table
  • addFoci - Add ores to the Laser Focus ore table
  • removeFoci - Remove ores from the Laser Focus ore table

NEI

  • hide - Hide item from NEI
  • addNEI - Add item to NEI

ThermalExpansion

  • addCrucibleThermal - Add Magma Crucible recipe
  • removeCrucibleThermal - Remove Magma Crucible recipe
  • addFurnaceThermal - Add Redstone Furnace recipe
  • removeFurnaceThermal - Remove Redstone Furnace recipe
  • addInsolator - Add Phytogenic Insolator recipe
  • removeInsolator - Remove Phytogenic Insolator recipe
  • addPulverizer - Add Pulverizer recipe
  • removePulverizer - Remove Pulverizer recipe
  • addSawmill - Add Sawmill recipe
  • removeSawmill - Remove Sawmill recipe
  • addSmelter - Add Induction Smelter recipe
  • removeSmelter - Remove Induction Smelter recipe
  • addTransposerFill - Add Fluid Transposer fill recipe
  • removeTransposerFill - Remove Fluid Transposer fill recipe
  • addTransposerExtract - Add Fluid Transposer extract recipe
  • removeTransposerExtract - Remove Fluid Transposer extract recipe

* All bonus properties take a number between 1 and 100

Tinkers' Construct

  • addCastBasin - Add Casting Basin recipe
  • removeCastBasin - Remove Casting Basin recipe
  • addCastTable - Add Casting Table recipe
  • removeCastTable - Remove Casting Table recipe
  • addDryingRack - Add Drying Rack recipe
  • removeDryingRack - Remove Drying Rack recipe
  • removeModifier - Removes modifier
  • addSmeltery - Add Smeltery recipe
  • removeSmeltery - Remove Smeltery recipe
  • addSmelteryAlloy - Add Smeltery alloy recipe
  • removeSmelteryAlloy - Remove Smeltery alloy recipe
  • addSmelteryFuel - Add Smeltery fuel
  • removeSmelteryFuel - Remove Smeltery fuel
  • addRepair - Add repair material
  • removeRepair - Remove repair material
  • setMaterialStats - Set material stats
  • setMaterialName - Set material name
  • setMaterialLevelHarvest - Set material harvest level
  • setMaterialDurability - Set material durability
  • setMaterialSpeed - Set material speed
  • setMaterialDamage - Set material damage
  • setMaterialModifierHandle - Set material handle modifier
  • setMaterialLevelReinforced - Set material reinforced level
  • setMaterialLevelStonebound - Set material stonebound level
  • setMaterialStyle - Set material style
  • setMaterialAbility - Set material ability
  • setBowStats - Set bow stats
  • setBowDurability - Set bow durability
  • setBowDrawSpeed - Set bow draw speed
  • setBowFlightSpeed - Set bow flight speed
  • setArrowStats - Set arrow stats
  • setArrowMass - Set arrow mass
  • setArrowBreak, - Set arrow break percentage
  • setArrowAccuracy - set arrow accuracy