EasyEntityLib
一个简单且强大的库,用于使用最少的样板代码创建 Minecraft Forge 1.20.1 实体。
EasyEntityLib 专为希望绕过自定义实体相关重复设置任务的模组开发者而设计。从用一行代码快速创建生物,到设置复杂的、可驯服的以及玩家可骑乘的机甲,这个库让实体开发变得更简单、更快捷、也更有趣。
✨ 功能
1. 快速实体注册
EasyEntityLib 显著减少了注册自定义生物所需的常规样板代码。
-
Lambda 中的简单生物: 使用 registerSimpleMob 轻松创建基础生物。您可以在注册时直接使用简洁清晰的 Lambda 表达式定义所有 AI、属性和每刻逻辑。
-
自定义类支持: 当您需要自己的自定义实体类时,请使用 registerAdvancedMob。该库在后台仍然处理繁琐的样板代码,如属性和渲染器的注册。
-
流畅的属性: 利用 MobAttributes 构建器,快速、可读地设置关键统计信息,如最大生命值、移动速度、攻击伤害、护甲等。
2. 简单的 AI DSL(领域特定语言)
无需复杂的目标设置,即可轻松定义生物行为。
- 快速添加目标: 使用内置的
SimpleAI 工具,通过单次方法调用添加常见的路径寻找者和目标者目标——例如随机漫步、环顾四周、近战攻击以及针对玩家或村民的目标。
3. 可驯服与可骑乘生物框架(机甲/傀儡基类)
该库提供了一个强大的 TameableRideableMob 基类,非常适合自定义载具、伙伴或傀儡。
-
驯服逻辑: 生物在首次交互时被驯服,之后只有主人可以骑乘它们,确保安全的伙伴关系。
-
完整的骑手控制: 骑乘期间,主人可以通过内置的 AI 目标和网络系统控制生物的移动(包括自定义跳跃/飞行逻辑)。
-
主人触发的远程攻击: 通过让您的可骑乘实体实现 IRangedAttackMob 接口,可以轻松实现远程战斗。主人可以在骑乘时按下专用的 R 键绑定 立即触发自定义攻击。
EasyEntityLib
A simple and powerful library for creating Minecraft Forge 1.20.1 entities with minimal boilerplate.
EasyEntityLib is designed for mod developers who want to bypass the repetitive setup tasks associated with custom entities. From quick mob creation with a line of code to setting up complex, tamable, and player-rideable mechs, this library makes entity development easier, faster, and more fun.
✨ Features
1. Fast Entity Registration
EasyEntityLib significantly cuts down on the standard boilerplate required for registering custom mobs.
-
Simple Mobs in a Lambda: Create basic mobs effortlessly using registerSimpleMob. You can define all AI, attributes, and per-tick logic using simple, clean lambda expressions right at registration.
-
Custom Class Support: Use registerAdvancedMob when you need your own custom entity classes. The library still handles tedious boilerplate like attribute and renderer registration behind the scenes.
-
Fluent Attributes: Utilize the MobAttributes builder for a quick, readable setup of key stats like Max Health, Movement Speed, Attack Damage, Armor, and more.
2. Simple AI DSL (Domain Specific Language)
Effortlessly define mob behavior without complex goal setup.
- Quick Goal Addition: Add common pathfinder and target goals—such as random stroll, look around, melee attack, and targeting players or villagers—with a single method call using the built-in
SimpleAI utility.
3. Tameable & Rideable Mob Framework (The Mech/Golem Base)
The library provides a powerful TameableRideableMob base class, perfect for custom vehicles, companions, or golems.
-
Taming Logic: Mobs are tamed on first interaction, and only the owner can ride them afterward, ensuring secure companionship.
-
Full Rider Control: While riding, the owner gains control over the mob's movement (including custom jump/flight logic) via a built-in AI Goal and networking system.
-
Owner-Triggered Ranged Attacks: Easily implement ranged combat by having your rideable entity implement the IRangedAttackMob interface. The owner can instantly trigger the custom attack while riding by pressing the dedicated R keybind.
评论 0
登录后参与评分
还没有评论,来抢沙发吧