Skip to content

Common Patterns

Reusable snippets and inheritance tricks for Hytale packs.

Inherit everything, change one property:

{
"Parent": "Template_Weapon_Sword",
"Quality": "Legendary"
}

Change damage values without touching interaction chain:

{
"Parent": "Template_Weapon_Sword",
"InteractionVars": {
"Swing_Left_Damage": {
"Interactions": [{
"Parent": "Weapon_Sword_Primary_Swing_Left_Damage",
"DamageCalculator": {
"BaseDamage": { "Physical": 50 }
}
}]
}
}
}

Replace entire interaction without separate file:

{
"Interactions": {
"Primary": {
"Cooldown": { "Cooldown": 0.5 },
"Interactions": [{
"Type": "Simple",
"RunTime": 0.3,
"Effects": { "ItemAnimationId": "Swing" }
}]
}
}
}
{
"Type": "Variant",
"Reference": "Template_Predator",
"Modify": {
"Appearance": "Wolf",
"MaxHealth": 100
}
}
{
"DamageCalculator": {
"BaseDamage": { "Physical": 20 }
}
}
{
"DamageCalculator": {
"BaseDamage": { "Physical": 15, "Fire": 10 }
}
}
{
"DamageCalculator": {
"BaseDamage": { "Physical": 20 },
"CriticalHitChance": 0.15,
"CriticalHitMultiplier": 2.0
}
}
{
"DamageCalculator": {
"BaseDamage": { "Physical": 20 },
"RandomPercentageModifier": 0.2
}
}

This creates ±20% variance (16-24 damage).

{
"DamageCalculator": {
"Type": "Dps",
"BaseDamage": { "Fire": 5 }
}
}
{
"DamageEffects": {
"Knockback": { "Force": 3.0 }
}
}
{
"DamageEffects": {
"Knockback": {
"Type": "Force",
"Force": 10.0,
"Direction": { "X": 0, "Y": 0.5, "Z": -1 }
}
}
}
{
"DamageEffects": {
"Knockback": {
"Force": 8.0,
"Direction": { "X": 0, "Y": 1, "Z": 0 }
}
}
}
{
"Selector": {
"Id": "Horizontal",
"EndDistance": 3.0,
"Length": 120
}
}
{
"Selector": {
"Id": "Horizontal",
"EndDistance": 4.0,
"Length": 30
}
}
{
"Selector": {
"Id": "Vertical",
"Direction": "ToDown",
"EndDistance": 3.0,
"Length": 90
}
}
{
"Selector": {
"Id": "Sphere",
"EndDistance": 5.0
}
}
{
"Selector": {
"Id": "Raycast",
"EndDistance": 50.0,
"TestLineOfSight": true
}
}
{
"MuzzleVelocity": 300,
"Gravity": 5,
"Damage": 50,
"TimeToLive": 60
}
{
"MuzzleVelocity": 60,
"Gravity": 15,
"Damage": 25,
"SticksVertically": true,
"PitchAdjustShot": true
}
{
"MuzzleVelocity": 20,
"Gravity": 0,
"Damage": 30,
"Radius": 0.3,
"DeathParticles": { "SystemId": "Magic_Explosion" }
}
{
"MuzzleVelocity": 40,
"Gravity": 20,
"Bounciness": 0.7,
"ImpactSlowdown": 0.2,
"TimeToLive": 15
}
{
"Type": "Chaining",
"ChainingAllowance": 1.5,
"Next": [
{ "Var": "Hit1", "DefaultValue": { "Interactions": ["Attack1"] } },
{ "Var": "Hit2", "DefaultValue": { "Interactions": ["Attack2"] } },
{ "Var": "Hit3", "DefaultValue": { "Interactions": ["Attack3"] } }
]
}
{
"Type": "Charging",
"DisplayProgress": true,
"Next": {
"0": "QuickAttack",
"0.5": "MediumAttack",
"1.5": "FullyCharged"
}
}
{
"Type": "Condition",
"Crouching": true,
"Next": "CrouchAttack",
"Failed": "StandingAttack"
}
{
"Effects": {
"ItemAnimationId": "SwingLeft",
"WorldSoundEventId": "SFX_Sword_Swing"
}
}
{
"Effects": {
"ItemAnimationId": "SwingDown",
"CameraEffect": "ScreenShake_Heavy",
"WorldSoundEventId": "SFX_Impact_Heavy"
}
}
{
"Effects": {
"ItemAnimationId": "Swing",
"Particles": [{
"SystemId": "Fire_Swing",
"Bone": "RightHand"
}]
}
}
{
"Effects": {
"ItemAnimationId": "Swing",
"Trails": [{
"TrailId": "Sword_Trail",
"TargetNodeName": "Blade_Tip"
}]
}
}
{
"Effects": {
"StartDelay": 0.1,
"ItemAnimationId": "Attack"
}
}
{
"Type": "ModifyInventory",
"ItemToRemove": { "Id": "Ammo_Arrow", "Quantity": 1 },
"Next": {
"Type": "LaunchProjectile",
"ProjectileId": "Arrow_Basic"
},
"Failed": {
"Type": "Simple",
"Effects": {
"WorldSoundEventId": "SFX_Empty_Click"
}
}
}
{
"Type": "Serial",
"Interactions": [
{
"Type": "DamageEntity",
"DamageCalculator": { "BaseDamage": { "Physical": 10 } }
},
{
"Type": "ApplyEffect",
"EffectId": "Poison",
"Entity": "Target",
"Duration": 5.0,
"Stacks": 1
}
]
}
{
"Type": "ApplyEffect",
"EffectId": "AttackBoost",
"Entity": "Self",
"Duration": 10.0
}
{
"Weapon": {
"StatModifiers": {
"MaxHealth": [{ "Amount": 50, "CalculationType": "Additive" }],
"MovementSpeed": [{ "Amount": 0.2, "CalculationType": "Multiplicative" }],
"DamageMultiplier": [{ "Amount": 0.1, "CalculationType": "Multiplicative" }]
}
}
}

See Adding Drop Tables for the full drop table reference.

{
"Container": {
"Type": "Single",
"Item": { "ItemId": "Raw_Meat", "QuantityMax": 2 }
}
}
{
"Container": {
"Type": "Multiple",
"Containers": [
{ "Type": "Single", "Weight": 50, "Item": { "ItemId": "Rare_Drop" } }
]
}
}

Weight on a Single inside Multiple is a percentage chance (0-100). The root container’s weight is never checked, so the Multiple wrapper is required.

{
"Container": {
"Type": "Multiple",
"Containers": [
{ "Type": "Single", "Weight": 100, "Item": { "ItemId": "Common_Item" } },
{ "Type": "Single", "Weight": 30, "Item": { "ItemId": "Uncommon_Item" } },
{ "Type": "Single", "Weight": 5, "Item": { "ItemId": "Rare_Item" } }
]
}
}
{
"Container": {
"Type": "Choice",
"Containers": [
{ "Type": "Single", "Weight": 70, "Item": { "ItemId": "Common" } },
{ "Type": "Single", "Weight": 25, "Item": { "ItemId": "Uncommon" } },
{ "Type": "Single", "Weight": 5, "Item": { "ItemId": "Rare" } }
]
}
}

All paths are relative to your pack folder (mods/YourPackName/):

What You’re AddingPack Location
Custom itemServer/Item/Items/
Custom interactionServer/Item/Interactions/
Custom root interactionServer/Item/RootInteractions/
Custom projectileServer/Projectiles/
Custom NPCServer/NPC/Roles/
Custom drop tableServer/Drops/
Custom status effectServer/Entity/Effects/
Custom modelCommon/Items/
Custom iconCommon/Icons/
Custom soundCommon/Sounds/

To find vanilla assets to inherit from or use as reference: <Hytale Install>/release/package/game/latest/Assets.zip