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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@occultus/tutorial-api

v0.20.0

Published

Star Tenon tutorial api

Downloads

217

Readme

Star Tenon Tutorial API

这是一个教程 API,用于在游戏中实现教程系统,可以帮助你轻松地创建和管理教程。

功能特性

  • 监听游戏事件并触发相应的教程解锁;
  • 支持多种教程类型:物品、方块、实体、维度和标签;
  • 提供统一的教程管理接口。

TutorialServer

TutorialServer 是教程系统的核心组件,负责管理和处理游戏中的教程解锁逻辑:

// 创建教程服务端实例
const tutorialServer = new TutorialServer();

// 创建不同类型的教程
const swordTutorial = new Tutorial({
  id: "minecraft:diamond_sword",
  config: {
    type: "item",
    title: "钻石剑",
    description: "一把强大的武器,可以造成大量伤害。"
  }
});

const craftingTableTutorial = new Tutorial({
  id: "minecraft:crafting_table",
  config: {
    type: "block",
    title: "工作台",
    description: "用于制作更复杂的物品和工具。"
  }
});

// 添加教程到教程服务端
tutorialServer.addTutorial([swordTutorial, craftingTableTutorial]);

Tutorial

Tutorial 类表示单个教程,包含教程的基本信息和配置:

const tutorialStick = new Tutorial(
  "minecraft:stick",
  "木棍", // 该教程的标题
  "木棍是一种合成中的常见物品", // 该教程的描述
  {
    type: "item",
    iconPath: "textures/items/stick",
  }
);

const tutorialFood = new Tutorial(
  "<tag>minecraft:is_food",
  "食物",
  "食物是使用后可以给玩家补充饥饿值和饱和度、有时还会产生额外效果的物品",
  {
    type: "item",
    iconPath: "textures/items/apple",
  }
);

const tutorialStone = new Tutorial(
  "minecraft:stone",
  "石头",
  "石头是一种常见的建筑材料,可以用来制作各种工具和家具",
  {
    type: "block",
  }
);

const tutorialEntity = new Tutorial(
  "minecraft:cow",
  "牛",
  "牛是一种常见的动物,可以用来制作食物和皮革",
  {
    type: "entity",
  }
);

const tutorialNether = new Tutorial(
  "minecraft:nether",
  "下界",
  "下界是一个特殊维度,有着独特的生物和地形",
  {
    type: "dimension",
  }
)

const tutorialAlways = new Tutorial(
  "example:always",
  "教程",
  "这是一个总是显示的教程",
  {
    type: "alwaysAvailable", // 总是可用
  }
)

TutorialCenter

TutorialCenter 类作为教程系统的中心管理器,负责协调各个教程组件,并为玩家提供教程面板:

const center = new TutorialCenter(
  "example:center",
  "教程中心",
  "这是教程中心的默认简介,如果你看到了它说明该模组的开发者很懒awa",
  tutorials
);

center.addTrigger("example:tutorial_center", {
  name: "example:tutorial",
  description: "教程中心",
  permissionLevel: CommandPermissionLevel.Any,
  cheatsRequired: false,
});

TutorialGroup

TutorialGroup 类用于组织相关的教程,形成教程组。

支持版本

本 API 支持任意可以运行 Script API v2.0.0+ 的游戏版本,包括:

  • 1.21.90;
  • 1.21.100;
  • 1.21.110;
  • 以及更多……

注意:本包理论上可以在部分更旧的版本上运作,但未经过严格的测试。

协议

本项目使用 MIT License 授权:

The MIT License (MIT)

Copyright © 2025 CTN Studios

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.