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

mcb-lang

v0.1.1-alpha.5

Published

<p align="center"><img width="160px" src="https://media.discordapp.net/attachments/558622428754870272/1002233396099039333/mcb.png"/></p>

Downloads

3

Readme

Description

MCB stand for Mincraft Boon. MCB is a lightweight scripting language that compiles in to mcfunction. It support functional programming, giving power to make your coding process faster.

Why build MCB?

Cuz mcfunction suck so i build MCB but trust me.... there is no cure.

Get Started

Requirements:

node js >=v16.0.0

Installation

# install with npm
npm install -g mcb-lang
# install with yarn
yarn global add mcb-lang

Creating project

mcb init

Powerful CLI

# want help?
mcb help
   
# initialize project.
mcb init

# build project.
mcb build or mcb .

# tools for project configs and more.
mcb mk or mcb make

Basic syntax

Variables

MCB is a statically typed language. This means that variables do have types in declaration.

Basic declaration

Restrict area no floating variables allowed.

// Format
let <objective>:score <criteria> <displayname>

// Usage
let foo:score dummy
let bar:score air Boon

Compiled code

scoreboard objectives add foo dummy

Set value in variable

// Format
<scoreboard_objective>[<target>] = value

// Usage
foo[x] = 10
bar[@s] = 5

Compiled code

scoreboard players set x foo 10
scoreboard players set @s bar 5

Print out the output

print("hi ${x[0]}")

Conditional expressions

fun hello(){
   x[a] = 0
   if(x[a]=0){
      print("hello")
   }else{
      print("hi")
   }
}

for loop

for(x[i] in 1..5;1){
   say hi
}

while loop

x[a] = 5
while(x[a]>0){
   print("while 1 ${x[a]}")
   x[a]-=1
}

Functions

Input parameters is not support in this version. return output too. 😎

A Function with no Input

fun hello(){
  say hello
}

// this is how you can call function.
hello()

Function Modifiers

load means that the function is run after the datapack has loaded, triggered by minecraft:tags\functions\load.json

// you will got a message in your minecraft chat after the datapack was loaded.
load fun hi_at_start(){
   print("HI")
}

tick means that the function is run every tick by minecraft:tags\functions\tick.json trigger.

// you will got a hi message in your minecraft chat every tick
tick fun hi_every_tick(){
   say hi
}

load and tick combo

// you will got a hi message in your minecraft chat every tick and on loaded.
tick load fun hey(){
   say hi
}

// you will got a hello message in your minecraft chat every tick and on loaded.
load tick fun hello(){
   say hello
}

@mix

mix another language to generate code

@mix(js)
{
   console.log("HI")
   return ["say hi","say hello"]
}

Mix result

say hi
say hello

Folder structure

All of Project-Files in here. MCB used folder structure following by this 3 words.

<namespace> → mcbpack.json + Your Project-Files

<namespace>
   ├─ +static\ //coming soon
   │        └─ +<Your Static File>
   ├─ +<Your Folder>\
   │        └─ +<Your File>.mcb
   ├─ +<Your File>.mcb
   └─ mcbpack.json

What’s mcbpack.json?

The presence of a mcbpack.json file in directory indicates that directory is root of MCB Project.

mcbpack.json file is a configuration file specifies The root files and compiler options to let The MCB compiler compile projects.

Example of mcbpack.json

{
   "name": "Hello",
   "mcVersion": 1.17,
   "compiler":{
      "<any-name1>":{
         "root":["/src/**"],
         "output":"/dist",
         "obfusticate": true // comming soon
      },
      "<any-name2>":{
         "root":["/test/**"],
         "output": "/dist-test"
      },
      "<any-name3>":{
         "root":["/src/**","/test/**"],
         "output": "/dist"
      }
   },
   // comming soon
   "dependencies":{
      "warppp": "1.0"
   }
}