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

minecraft-items

v0.4.3

Published

Get Minecraft items by id, type, or name.

Downloads

179

Readme

minecraft-items

Get Minecraft items by id, type, or name.

Build Status

Install

$ npm install --save minecraft-items

Usage

const minecraftItems = require('minecraft-items')

// Get an item
const diamond = minecraftItems.get(264)
const mooshroomSpawnEgg = minecraftItems.get('383:96')
const grass = minecraftItems.get('grass')

// Find items
const stoneVariants = minecraftItems.find(1)
const swords = minecraftItems.find('sword')

API

get( id | type | name )

Returns data about the matching item. For example, here's a Jungle Boat

{
  id: '446:0',
  name: 'Jungle Boat',
  meta: 0,
  type: 446,
  icon: 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAALVBMVEUAAAAoHgqLaCVHLx9mRCyHWTp2TjOacVRSNyS4h2RpThyIZSSOZEJsUR12WB9O084eAAAAAXRSTlMAQObYZgAAAI9JREFUKFOl0TEZwzAMhFFROAqm8FMQBVMIBVMQBVEoBVMQhVAIhi7J0Mbp0tv0vtN0ZmYm2Wfu0ATAI6iBe++dBxC4u2+9D1ZwntLWxxpwd3e1H3B+NMVgDYl7ROgl9ABJRARqmlpDJQFZ2o+pBRiZSVVpHlflC4xKshLNY1+DkRSYac59DXYtoGuxG/yZN7Ieb5H4FFC4AAAAAElFTkSuQmCC'
}

id

Type: string

Uniquely identifies an item by including both type and meta. Formatted as type:meta.

type

Type: number

Primary numeric identifier for an item. If provided to get(), the item's data will be retrieved by assuming that meta is zero.

name

Type: string

For case insensitive (but otherwise exact) name match. i.e. get('diamond') is equivalent to get('DIAMOND') but not get('diamo').

meta

Type: number

Describes a subtype of Minecraft item. Though many items do not have meta values (meta: 0), lots of items do use the meta value to describe themselves as variants on a theme. For example, Dirt is item 3 while Coarse Dirt is item 3:1.

icon

Type: string

A PNG image for the item as a base64-encoded string.

find( key )

Returns an array of items matching the provided key.

key

Type: string or number

A key by which to search the lists of items. May be a partial name, type, or id.

getAll( options )

Returns data about every item as a hash

options

by

Type: string Default: 'id'

Name of field by which to key the items. May be either 'id' or 'name'.

Special Thanks

This package is built from data provided by http://minecraft-ids.grahamedgecombe.com/, so thanks Graham. :)

License

MIT