Enchantment Creator
概要
Enchantment Creator は、TypeWriter の Web パネルだけで定義できる本物のエンチャントをサーバーに追加します。エンチャントは Minecraft 自身のエンチャントレジストリの typewriter 名前空間に登録されるため、リソースパックや追加プラグインがなくても、バニラのエンチャントと同じようにアイテム、金床、エンチャントテーブルに表示されます。
エンチャントは、デフィニションエントリー(名前、色、対応アイテム、最大レベル、コスト、有効スロット)で記述し、その後、動作を与えます。方法は 2 つあります。標準デフィニションは、エンチャントされたアイテムを装備または手に持っている間、TypeWriter のトリガーを実行します。カスタムデフィニションはメカニクスを列挙し、それぞれがゲームイベント(攻撃、ブロック破壊、弓の発射、落下ダメージなど)に反応してアクションを実行します。エクステンションには 70 種類以上の既成のアクションエントリー(ライフスティール、鉱脈採掘、追尾矢、凍結の防具など)が付属しており、メカニクスに組み込んで使えます。
機能
- 本物のエンチャント — サーバーのエンチャントレジストリに登録され、色付きの名前、最大レベル、金床コスト、ウェイト、エンチャントテーブルのコストを設定できます。
- 2 種類のデフィニション — トリガーベース(
enchantment_definition)またはメカニクスベース(custom_enchantment_definition)。 - 16 種類のゲームイベント — 攻撃、防御、ブロック破壊、弓の発射、飛び道具の命中、落下ダメージ、アイテムのダメージ、防具の装備、移動、スニーク、スプリントなど。
- 70 種類以上の既成エフェクト — 防具、弓、戦闘、ツール、特殊アクション。それぞれ専用のフィールドがあります。
- エンチャント本 — アクションまたはコマンドから、カスタムの名前とロア付きの本を付与できます。
- ワールドとの統合 — 本は、生成されるルートチェスト(
treasureChance)や司書の取引(tradeChance)に登場します。 - エンチャントテーブルと金床 — カスタムエンチャントをエンチャントテーブルで提示し、対応アイテムに限定し、金床で排他的にすることができます。
- バニラのブラックリスト — 選択したバニラのエンチャントをエンチャントテーブルから除外します。
- メカニクスごとの確率とレベル — メカニクスを一定の確率でのみ、または特定のエンチャントレベルでのみ実行します。
- クライアント側のパーティクル — プレイヤーにだけ表示されるパーティクルアクション。
インストール
- Paper サーバー 1.21 以降と Java 21 を使用します。エクステンションはサーバーのレジストリを通じてエンチャントを構築するため、古いバージョンでは動作しません。
- TypeWriter の Basic エクステンションがインストールされていることを確認します(TypeWriter のドキュメントを参照)。
- Enchantment Creator の JAR を
plugins/Typewriter/extensions/に配置し、サーバーを再起動します。
他のプラグインは必要ありません。
はじめに
攻撃のたびに装備者を回復する、剣用の「Vampiric Strike」エンチャントを作成します。
- TypeWriter の Web パネルでマニフェストページを開き、Custom Enchantment Definition を追加します。
nameをVampiric Strike、displayNameをVampiric Strike、nameColorをdark_red、maxLevelを3に設定し、supportedItemsに剣の素材を追加します。- シーケンスページに Lifesteal アクションエントリーを追加し、
healPercentageを0.2に設定します。 - デフィニションに戻り、
mechanicsにメカニクスを追加します。eventをPLAYER_ATTACKに設定し、actionsで Lifesteal エントリーを選択します。 - Give Enchantment Book アクションを追加し、
customEnchantmentで作成したデフィニションを選択して、levelを設定します。Publish します。 - アクションをトリガーして本を入手するか、Enchantment Command Manifest を追加した上で
/enchantcreator give <player> Vampiric_Strike 2を実行します。金床で本を剣に組み合わせ、モブを攻撃してみましょう。
エフェクトは、エンチャントレベルに応じて自動的に強くなることはありません。レベル 3 を強くするには、runOnLevel を 1、2、3 に設定した複数のメカニクスを追加し、それぞれ異なる値のアクションを実行させます。runOnLevel が 0 の場合は、すべてのレベルが対象です。
仕組み
エクステンションは、オンラインの全プレイヤーを 5 tick(0.25 秒)ごとにチェックし、どのエンチャントを使用しているかを調べます。対象となるのはメインハンド、オフハンド、防具のみで、素材が supportedItems に含まれているアイテムに限られます。見つかった中で最も高いレベルが使用されます。そのため、アイテムを装備してからエフェクトが始まるまでに、わずかな遅延が生じることがあります。
2 種類のデフィニションは、動作が異なります。
- 標準デフィニション(
enchantment_definition)は、現在のレベルのactiveTriggersを実行します。cooldownEnabledがオンの場合、エンチャントが有効な間はcooldownごとに再実行され、オフの場合は、有効になったときに 1 回だけ実行されます。inactiveTriggersは、無効になったときに実行されます。criteriaを満たしている必要があります。 - カスタムデフィニション(
custom_enchantment_definition)は、対応するゲームイベントが発生したときに、メカニクスを実行します。
アクションエントリーは、自分を発動させたゲームイベントを読み取ります。アクションは、それが想定しているイベントのメカニクスで使われたときにのみ機能します(たとえば、Vein Miner は BLOCK_BREAK でのみ動作します)。
エンチャントイベント
メカニクスの event は、次のいずれかです。
| イベント | 発火するタイミング |
|---|---|
PLAYER_ATTACK | プレイヤーがエンティティを直接攻撃したとき。 |
PLAYER_DEFEND | プレイヤーがエンティティからダメージを受けたとき。 |
SHIELD_BLOCK | プレイヤーが盾でガード中に攻撃を受けたとき。 |
BLOCK_BREAK | プレイヤーがブロックを破壊したとき。 |
BOW_SHOOT | プレイヤーが弓またはクロスボウを撃ったとき。 |
PROJECTILE_HIT | プレイヤーが撃った飛び道具が何かに命中したとき。 |
ITEM_CONSUME | プレイヤーが飲食したとき。 |
PLAYER_DEATH | プレイヤーが死亡したとき。 |
PLAYER_INTERACT | プレイヤーが右クリックまたは左クリックしたとき。 |
ARMOR_EQUIP | プレイヤーが防具を装備または外したとき。 |
ITEM_DAMAGE | アイテムの耐久値が減ったとき。 |
FALL_DAMAGE | プレイヤーが落下ダメージを受けたとき。 |
ENVIRONMENTAL_DAMAGE | プレイヤーがエンティティ以外によるダメージを受けたとき(落下ダメージでも発火します)。 |
PLAYER_MOVE | プレイヤーが別のブロックに移動したとき(4 tick ごとに判定)。 |
SNEAK | プレイヤーがスニークを始めたとき。 |
SPRINT | プレイヤーがスプリントを始めたとき。 |
PLAYER_ATTACK は、プレイヤーが直接のダメージ源であるとき、つまり近接攻撃のときに発火します。矢によるダメージは矢が与えるものなので、現在のバージョンでは PLAYER_ATTACK は発火しません。そのため、ダメージイベントを読み取る矢のアクション(下記で明記)は、直接命中にのみ作用します。
既成アクション
すべてのアクションエントリーは、メカニクスの中(actions)や、任意のシーケンスから使用します。それぞれ標準の criteria、modifiers、triggers フィールドと、専用のフィールドを持ちます。詳細はエントリーのページを参照してください。「イベント」列は、そのアクションにメカニクスのどの event が必要かを示しています。
| グループ | アクション | イベント |
|---|---|---|
| 戦闘 | Armor Pierce, Beheading, Bleed, Blindness Strike, Cleave, Disarm, Executioner, Freeze Strike, Lifesteal, Lightning Strike, Poison Strike, Silence, Vampiric Aura, Wither Strike | PLAYER_ATTACK |
| 防具(被弾時) | Deflect, Enlightened Armor, Evasion, Frozen Armor, Molten Armor, Regeneration Aura, Resistance Aura, Thorns Advanced, Toxic Aura, Voodoo Armor, Gearing | PLAYER_DEFEND |
| 防具(ダメージ) | Angel Wings | FALL_DAMAGE |
| 防具(ダメージ) | Implosion Armor, Curse of Vulnerability | 任意のダメージイベント(PLAYER_DEFEND, FALL_DAMAGE, ENVIRONMENTAL_DAMAGE) |
| 防具(装備) | Anti Knockback, Health Boost | ARMOR_EQUIP |
| 防具(耐久) | Hardened Armor | ITEM_DAMAGE |
| 弓(発射) | Homing Arrow, Volley Arrow | BOW_SHOOT |
| 弓(着弾) | Explosive Arrow, Teleport Arrow | PROJECTILE_HIT |
| 弓(ダメージ) | Ender Arrow, Healing Arrow, Lightning Arrow, Piercing Shot, Pull Arrow, Push Arrow, Sniper Arrow, Venom Arrow, Web Arrow, Wither Arrow | PLAYER_ATTACK(直接命中のみ。注記を参照) |
| ツール | Area Miner, Auto Smelt, Experience Boost, Haste, Indestructible, Magnet, Oxygenate, Spawners Silk Touch, Telepathy, Timber, Treasure Hunter, Vein Miner | BLOCK_BREAK |
| ツール | Bedrock Breaker, Green Thumb, Night Vision | PLAYER_INTERACT |
| ツール | Agricultural Harvest | BLOCK_BREAK。壊したブロックの周囲(最大 radius 8)の熟した作物を収穫します |
| 特殊 | Aquatic Speed, Feeder, Lava Walker | PLAYER_MOVE |
| 特殊 | Elytra Boost, Launch | PLAYER_INTERACT |
| 特殊 | Curse of Sluggishness | PLAYER_ATTACK |
| 特殊 | Elytra Shield | ENVIRONMENTAL_DAMAGE |
| 特殊 | Soulbound | PLAYER_DEATH |
| ユーティリティ | Client Particle Effect, Give Enchantment Book | 任意 |
コマンド
コマンドは、作成する Enchantment Command Manifest エントリーです。名前、パーミッション、メッセージはエントリーのフィールドで、ここにはデフォルト値を示しています。
| コマンド | 説明 |
|---|---|
/enchantcreator give <player> <enchant> [level] | オンラインのプレイヤーにエンチャント本を付与します。<enchant> はエントリーの name または displayName で、スペースはアンダースコアに置き換えます。レベルのデフォルトは 1 です。 |
パーミッション
| パーミッション | 許可される内容 |
|---|---|
enchantcreator.admin | /enchantcreator give(エントリーの adminPermission フィールド)。 |
エントリー
75 件のエントリー(拡張機能のソースから生成)。
アクション71
- Agricultural Harvest ActionOptimized action for harvesting crops in an AOE, replanting immediately, and merging drops.
- Angel Wings ActionReduces or completely negates fall damage
- Anti Knockback ActionProvides knockback resistance when equipped
- Aquatic Speed ActionDrastically increases movement speed underwater (Dolphin's Grace)
- Area Miner ActionMines blocks in a 3x3 area based on the block broken
- Armor Pierce ActionIgnores armor calculations during melee combat
- Auto Smelt ActionAutomatically smelts mined blocks and yields slightly more experience
- Bedrock Breaker ActionExtremely rare chance to successfully mine Bedrock when left-clicking it
- Beheading ActionHas a chance to drop the victim's head on kill
- Bleed ActionApplies a bleeding effect over time to the target
- Blindness Strike ActionBlinds the target struck
- Cleave ActionDeals area-of-effect (AoE) damage to enemies around the target
- Client Particle EffectRender a Typewriter-aware client particle effect
- Curse of Sluggishness ActionCurse: Applies Slowness and Weakness to the user when attacking
- Curse of Vulnerability ActionCurse: Multiplies all damage taken by the player
- Deflect ActionChance to deflect incoming projectiles back at the attacker
- Disarm ActionForces the attacked player to drop the item in their main hand
- Elytra Boost ActionGives a periodic boost while gliding with Elytra when right-clicking
- Elytra Shield ActionReduces kinetic damage taken from flying into walls
- Ender Arrow ActionDeals massive bonus true damage to End mobs (Enderman, Shulker, Dragon, Endermite)
- Enlightened Armor ActionHas a chance to heal you when attacked
- Evasion ActionGives a chance to completely dodge and cancel incoming damage
- Executioner ActionHas a chance to instantly kill targets below a certain health threshold
- Experience Boost ActionMined blocks drop extra experience
- Explosive Arrow ActionCauses a projectile to explode on impact without breaking blocks
- Feeder ActionPassively restores food while walking
- Freeze Strike ActionSlows and freezes the target
- Frozen Armor ActionSlows and freezes the attacker when they strike you
- Gearing ActionGrants brief speed when hit
- Give Enchantment BookGive a book with a custom enchantment
- Green Thumb ActionPassively bone-meals nearby crops when right-clicking
- Hardened Armor ActionHas a chance to ignore durability loss
- Haste ActionPassively grants Haste while breaking blocks
- Healing Arrow ActionHeals the target instead of damaging them
- Health Boost ActionGrants extra maximum health when equipped
- Homing Arrow ActionModifies a shot arrow to magnetically track the nearest enemy
- Implosion Armor ActionTriggers a massive shockwave when your health drops critically low
- Indestructible ActionHas a chance to repair the tool instead of taking damage when mining
- Launch ActionLaunches the player forward when right clicking with the item
- Lava Walker ActionFreezes lava under your feet into basalt temporarily
- Lifesteal ActionHeals the player based on the damage dealt
- Lightning Arrow ActionStrikes lightning where the arrow hits
- Lightning Strike ActionStrikes lightning on the hit target
- Magnet ActionSucks nearby items towards the player when mining
- Molten Armor ActionSets the attacker on fire when they strike you
- Night Vision ActionApplies Night Vision when interacting with the tool
- Oxygenate ActionRestores breath while breaking blocks underwater
- Piercing Shot ActionCauses the arrow to act as true damage, ignoring armor
- Poison Strike ActionPoisons the target struck
- Pull Arrow ActionPulls the struck target towards the shooter
- Push Arrow ActionInflicts massive knockback to the struck target
- Regeneration Aura ActionGrants passive regeneration when attacked
- Resistance Aura ActionGrants a defensive buff (resistance) when attacked in combat
- Silence ActionSilences the target, applying severe mining fatigue and weakness to prevent them from fighting back effectively
- Sniper Arrow ActionIncreases damage based on the distance the arrow traveled
- Soulbound ActionKeeps the enchanted item in your inventory upon death
- Spawners Silktouch ActionAllows the player to mine and collect Mob Spawners
- Telepathy ActionPlaces mined blocks and items directly into your inventory
- Teleport Arrow ActionTeleports the shooter to the arrow's impact location
- Thorns Advanced ActionReflects a percentage of incoming melee damage back to the attacker
- Timber ActionChops down an entire tree by breaking its bottom log
- Toxic Aura ActionEmits a toxic cloud, poisoning nearby enemies when you take heavy damage
- Treasure Hunter ActionMining simple blocks like Dirt or Stone has a chance to drop Emeralds
- Vampiric Aura ActionHeals all nearby allies when an enemy is killed
- Vein Miner ActionMines a vein of connected identical ores
- Venom Arrow ActionPoisons the target struck by the arrow
- Volley Arrow ActionShoots additional arrows in a cone shape
- Voodoo Armor ActionHas a chance to apply Weakness to the attacker
- Web Arrow ActionEncases the target in a temporary cobweb
- Wither Arrow ActionApplies wither effect to the target struck by the arrow
- Wither Strike ActionApplies wither effect to the target struck
コマンド1
- Enchantment Command ManifestAdmin command for giving custom enchantment books
マニフェスト3
- Custom Enchantment DefinitionDefines a custom enchantment with modular mechanics
- Enchantment DefinitionDefines a custom enchantment
- Vanilla Enchantment Blacklist DefinitionBlacklist vanilla enchantments from the enchanting table
トラブルシューティング
エフェクトが何も起こさない。 アクションは、メカニクスの event に一致している必要があります(上の表を参照)。ブロック破壊イベントを読み取るアクションは、PLAYER_ATTACK では何もしません。アイテムは supportedItems に含まれ、手に持つか防具として装備されている必要があり、メカニクスの criteria、chance、runOnLevel も満たしている必要があります。runOnLevel が 2 のメカニクスは、最高レベルがちょうど 2 のときにのみ実行されます。
ゲーム内でエンチャントが見つからない。 デフィニションは、エクステンションの起動時、プレイヤーの参加時、本の付与時に登録されます。コンソールに Failed to reflectively register や Failed to register enchantments during pre-login が出ていないか確認し、サーバーが Paper 1.21 以降であることを確かめてください。
本をアイテムに適用できない。 金床では、本は supportedItems に記載されたアイテムにしか適用できません。互いの exclusiveWith に記載されている 2 つのエンチャントは組み合わせられず、金床の結果が除去されます。この排他性が適用されるのは金床のみです。
プレイヤーがエンチャントテーブルで自分のエンチャントを見られない。 テーブルでは、weight はパーセンテージとして使われます。1 は、抽選 1 回あたり約 1% の確率という意味です。値を上げるか、treasureChance と tradeChance を設定して、ルートや司書を通じて本を配布してください。weight が 0 の場合、テーブルでの提示は無効になります。
/enchantcreator give でエンチャントが不明と表示される。 名前は、エントリーの name または displayName を小文字にし、スペースをアンダースコアに変換したものと照合されます。エントリーの正確な名前を使用し、先にページを Publish してください。
バニラのエンチャントがまだ表示される。 ブラックリストはエンチャントテーブルでの提示を除外するだけで、金床、ルート、取引には影響しません。名前が無効な場合、コンソールに Unable to resolve vanilla enchantments for blacklist が出力されます。