🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

pack-mc-2

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pack-mc-2

PackMc2-Beta OpenSource v1.0.0

latest
Source
npmnpm
Version
1.0.91-beta
Version published
Maintainers
1
Created
Source

PackMc2 - beta

PackMc2 娘
PackMc2-Beta OpenSource v1.0.9
如果你是用1.0.7以后的版本。您会发现生成的文件夹中存在一个pmc2.mcpkg文件,这是用来存储包的部分元信息的文件,如果您在您的包中保留这个文件,则您可以通过 https://pmc-fsm.lapis-net.top/ 修改虚拟文件系统的预加载内容

介绍

PackMc2 是一个以方便快捷为标准的全新的JavaScript MinecraftAddon生成框架!
PackMc2正式版将会在不久之后开源!
有多快捷?请看实例(创建一个名为Na Ingot的物品)

// ... 引用模块和调用Ctx
ctx.Item( "Na Ingot" )
// ...

创建一把武器

// ... 引用模块和调用Ctx
ctx.Item( "IroNa Sword" )
  .extend( mod.Vanilla.IronSword( false ) )
sword.recipe
  .replace( "minecraft:iron_ingot", item )
// ...

编写插件

PackMc2 使用简单的方式编写插件
以下是一个简单的插件框架

var {ActivePlugin} = require( "pack-mc-2/src/Plugin" )
class CustomPlugin extends ActivePlugin {
  constructor( context ){
    super( "PluginId", context )
  }
  // 在包被构建时运行
  onGenerate(){
    
  }
  // 当插件在Minecraft中加载时运行
  onMinecraft( mc ){
    
  }
}

// 加载插件
// ...
ctx.loadActivePlugin( CustomPlugin )
// 访问插件示例(当然您也可以直接在context上增加内容)
console.log( ctx.plugins.PluginId.define )
// ...

当然,您也可以使用RePackMc的API编写插件(但不提倡)
PackMc2的Item就是继承自旧API加以改造

编写代码

(候补)

内置插件

(候补)

Keywords

minecraft

FAQs

Package last updated on 04 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts