Skip to content

1.1 Start from Hello World

Himxh edited this page Sep 12, 2026 · 2 revisions

1.1 从Hello,world!开始 Start from "Hello,world!"

欢迎来到 HimDSL 的世界!本节将带你编写第一个程序。
Welcome to the world of HimDSL! This section will guide you through writing your first program.

环境准备 Prerequisites

确保你已经安装了 [HimDSL] 插件并重启了服务器。 Make sure HimDSL has enabled.

第一个脚本 First Script

在HimDSL\文件夹下创建hello.dsl并写入以下内容。

int main(){
    runcmd("CONSOLE","say Hello,world!");
}

在服务器控制台输入 Input in Console:
himdsl run hello.dsl
或者由玩家输入 Input from player:
/himdsl run hello.dsl

控制台将会打印 Console will print: [Server] [Not Secure] Hello,world!

脚本解释 Script interpretation

main()函数是代码的入口点。在完成了函数表的扫描之后会尝试从main()函数开始执行。文件名和main()无关。
runcmd()是一个内置的函数。该函数有两个参数,第一个是执行者,第二个是命令。
The main() function is the entry point of the code. After scanning the function table, it will attempt to execute starting from the main() function. The file name has nothing to do with main(). runcmd() is a built - in function. This function has two parameters. The first one is the executor, and the second one is the command.

HimDSL 文档 / Documentation

入门 / Getting Started

语言基础 / Language Basics

控制流 / Control Flow

函数 / Functions

数据结构 / Data Structures

自定义类型 / Custom Types

Minecraft 集成 / Minecraft Integration

事件与调度 / Events & Scheduling

GUI 系统 / GUI System

内置函数参考 / Built-ins Reference

进阶 / Advanced

扩展 API / Extension API

你真的需要 API 吗?/ Do you really need the API?

Clone this wiki locally