Installations
npm install prismarine-block
Developer
PrismarineJS
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
18.0.0
NPM Version
8.6.0
Statistics
29 Stars
141 Commits
32 Forks
7 Watching
11 Branches
27 Contributors
Updated on 26 Oct 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
1,673,316
Last day
41.1%
1,290
Compared to previous day
Last week
8.5%
7,646
Compared to previous week
Last month
14.4%
28,867
Compared to previous month
Last year
-36.5%
244,440
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
prismarine-block
Represent a minecraft block with its associated data
Usage
1const registry = require('prismarine-registry')('1.8') 2const Block = require('prismarine-block')(registry) 3 4const stoneBlock = new Block(registry.blocksByName.stone, registry.biomesByName.plains, /* meta */ 0) 5 6console.log(stoneBlock) 7 8// can you harvest stone with an iron pickaxe? 9console.log(stoneBlock.canHarvest(257)) 10 11// how many milliseconds does it takes in usual conditions? (on ground, not in water and not in creative mode) 12console.log(stoneBlock.digTime(257)) 13
API
See doc/API.md
History
1.19.0
- Update npm-publish.yml (thanks @rom1504)
1.18.0
- Fix false value handling in fromProperties for post flatenning versions (#98) (thanks @zardoy)
- fix version used in block entity (#99) (thanks @rom1504)
- Allow two variations of syntax in fromString (#96) (thanks @Flonja)
1.17.1
- Export Block class declaration (#91) (thanks @IceTank)
- Bump standard from 16.0.4 to 17.1.0 (#83) (thanks @dependabot[bot])
- use nmd supportFeature (#60) (thanks @u9g)
- Add command gh workflow allowing to use release command in comments (#90) (thanks @rom1504)
1.17.0
- Support for multi-sided signs (thanks @PondWader)
1.16.3
- really
1.16.2
- correct
1.16.1
- fix mcdata dep
1.15.0
- Effect names were normalized
- Metadata to 0 by default
1.14.1
- Legacy version fixes
1.14.0
- Add .stateId, .fromProperties, .getProps for all versions
1.13.1
- Change blockEntity version handling
1.13.0
- Add sign block entity implementation
1.12.0
- Updated to support
prismarine-registry
. To use, instead of passing a string to prismarine-biome's default function export, pass an instance ofprismarine-registry
. - block entity support
1.11.0
- support bedrock
1.10.3
- use normalized enchant rather than custom format (@u9g #41)
1.10.2
- remove debug code
1.10.1
- Fix ternary operator for bedrock name check
1.10.0
- 1.17.0 support (thanks @Archengius and @the9g)
1.9.0
- added
block.getProperties()
type definitions. - added instant breaking support
- added
Block.fromProperties()
constructor.
1.8.0
- Efficiency fix on versions below 1.13
1.7.3
- Fix effectLevel not working in digTime. (@Naomi-alt)
1.7.2
- add testing for shapes, make it more robust to missing data
1.7.1
- fix canHarvest when no harvestTools required (thanks @Garfield100)
1.7.0
- Add getProperties (thanks @Karang)
1.6.0
- Add enchantments and effects to dig time computation (thanks @Karang)
1.5.1
- Make Block.fromStateId work for all versions
1.5.0
- Fix block metadata for 1.13+
1.4.0
- add block shapes (thanks @Karang)
1.3.0
- add typescript definitions (thanks @IdanHo)
1.2.0
- Prevent data from being shared to avoid conflicts across multiple versions (thanks @hornta)
1.1.1
- use the minStateId if passing the blockType
1.1.0
- add block state id feature (for >= 1.13)
1.0.1
- bump mcdata
1.0.0
- bump dependencies
0.1.0
- Import from mineflayer
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 16/26 approved changesets -- score normalized to 6
Reason
5 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/commands.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/commands.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/commands.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/commands.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/npm-publish.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/PrismarineJS/prismarine-block/npm-publish.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:25
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/commands.yml:1
- Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 25 are checked with a SAST tool
Score
4.6
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More