Skip to content

Asset System Overview

The Asset System manages all game content including blocks, items, entities, sounds, particles, and more. Assets are defined in JSON files and can be bundled with plugins.

com.hypixel.hytale.server.core.asset.type

Asset packs follow a specific directory structure:

my-plugin.jar/
├── plugin.json
└── assets/
├── blocktype/ # Block definitions
├── item/ # Item definitions
├── model/ # 3D models
├── soundevent/ # Sound events
├── soundset/ # Sound collections
├── particle/ # Particle systems
├── weather/ # Weather configurations
├── entity/ # Entity definitions
├── entityeffect/ # Status effects
├── environment/ # Environment settings
├── ambiencefx/ # Ambient effects
├── gameplay/ # Gameplay configurations
└── ... other types

Define block behavior and properties:

{
"Id": "MyPlugin_CustomBlock",
"DisplayName": "Custom Block",
"Model": "MyPlugin/custom_block",
"Material": "Stone",
"Hardness": 2.0,
"LightLevel": 0,
"IsOpaque": true,
"IsSolid": true,
"BlockSound": "Hytale/Stone"
}

Key properties:

PropertyTypeDescription
IdstringUnique block identifier
DisplayNamestringLocalized display name
ModelstringModel asset reference
MaterialstringMaterial for tools/damage
HardnessfloatMining difficulty
LightLevelintEmitted light (0-15)
IsOpaqueboolBlocks light completely
IsSolidboolHas collision

Define items and their behavior:

{
"Id": "MyPlugin_CustomSword",
"DisplayName": "Custom Sword",
"Model": "MyPlugin/sword_model",
"MaxStack": 1,
"MaxDurability": 500,
"AttackDamage": 7.0,
"AttackSpeed": 1.6,
"Tags": ["weapon", "sword"]
}

Key properties:

PropertyTypeDescription
IdstringUnique item identifier
DisplayNamestringLocalized display name
MaxStackintMaximum stack size
MaxDurabilityfloatMaximum durability (0 = unbreakable)
AttackDamagefloatMelee damage
Tagsstring[]Item categorization tags

Define sounds that can be played:

{
"Id": "MyPlugin_CustomSound",
"Sounds": [
{
"Path": "sounds/custom_sound.ogg",
"Volume": 1.0,
"Pitch": 1.0
}
],
"Category": "Master"
}

Define particle systems:

{
"Id": "MyPlugin_CustomParticle",
"Emitters": [
{
"Type": "Point",
"Rate": 10,
"Lifetime": 1.0,
"Color": "#FF0000",
"Size": 0.1
}
]
}

Define status effects for entities:

{
"Id": "MyPlugin_CustomEffect",
"DisplayName": "Custom Effect",
"Duration": 300,
"Icon": "icons/custom_effect.png",
"Effects": {
"Speed": 1.5,
"Health": -1.0
}
}

Define weather configurations:

{
"Id": "MyPlugin_CustomWeather",
"DisplayName": "Custom Weather",
"Fog": {
"Color": "#808080",
"Density": 0.5
},
"Clouds": {
"Enabled": true,
"Density": 0.8
},
"Precipitation": "Rain"
}

Configure gameplay mechanics:

{
"Id": "MyPlugin_GameplayConfig",
"Combat": {
"DamageMultiplier": 1.0,
"DisplayHealthBars": true
},
"Death": {
"DropItems": true,
"DropExperience": true
}
}
// Block types
BlockType blockType = BlockType.getAssetMap().get("MyPlugin_CustomBlock");
// Items
Item item = Item.getAssetMap().get("MyPlugin_CustomSword");
// Weather
Weather weather = Weather.getAssetMap().get("MyPlugin_CustomWeather");
// Entity effects
EntityEffect effect = EntityEffect.getAssetMap().get("MyPlugin_CustomEffect");

Each asset type has an AssetMap for lookups:

AssetMap<BlockType> blockTypes = BlockType.getAssetMap();
// Get by key
BlockType block = blockTypes.get("Block_Key");
// Get all keys
Set<String> keys = blockTypes.keySet();
// Check existence
boolean exists = blockTypes.containsKey("Some_Block");
// Get index (for network serialization)
int index = blockTypes.getIndex("Block_Key");

Set IncludesAssetPack in plugin.json:

{
"Name": "MyPlugin",
"IncludesAssetPack": true
}
@Override
protected void setup() {
// Register custom asset type handler
getAssetRegistry().register(/* asset registration */);
}

Modify existing assets at runtime:

// Get block type
BlockType stone = BlockType.getAssetMap().get("Block_Stone");
// Assets are typically immutable
// Use asset overrides in your asset pack instead

When multiple packs define the same asset, priority determines which is used:

  1. Core Assets: Base game assets (lowest priority)
  2. Plugin Assets: In order of plugin loading
  3. Override Packs: Explicit overrides (highest priority)

Assets are validated on load:

// Assets use validators
BuilderCodec<Item> codec = Item.CODEC;
// Validation includes:
// - Required fields
// - Value ranges
// - Reference validity
// - Type constraints

Assets use the Codec system for serialization:

// Most assets have a CODEC
BuilderCodec<BlockType> blockCodec = BlockType.CODEC;
BuilderCodec<Item> itemCodec = Item.CODEC;
// Serialize to BSON
BsonDocument doc = codec.encode(asset, extraInfo);
// Deserialize
Asset loaded = codec.decode(doc, extraInfo);

The server supports hot-reloading of assets during development:

  • Assets in development packs can be reloaded
  • Connected clients receive updated asset data
  • Not all asset changes take effect immediately

All 35 asset types organized by category:

DirectoryClassDescription
blocktype/BlockTypeBlock definitions
blockset/BlockSetBlock groupings
item/ItemItem definitions
fluid/FluidFluid types
projectile/ProjectileProjectile definitions
DirectoryClassDescription
model/Model3D models
particle/ParticleParticle systems
trail/TrailTrail effects
modelvfx/ModelVFXModel visual effects
fluidfx/FluidFXFluid visual effects
blockbreakingdecal/BlockBreakingDecalBreak animation overlays
blockhitbox/BlockBoundingBoxesBlock collision shapes
blockparticle/BlockParticleSetBlock particle effects
DirectoryClassDescription
soundevent/SoundEventIndividual sounds
soundset/SoundSetSound collections
blocksound/BlockSoundSetBlock-specific sounds
itemsound/ItemSoundSetItem-specific sounds
audiocategory/AudioCategoryAudio categories
equalizereffect/EqualizerEffectAudio equalizer effects
reverbeffect/ReverbEffectAudio reverb effects
DirectoryClassDescription
weather/WeatherWeather systems
environment/EnvironmentEnvironment settings
ambiencefx/AmbienceFXAmbient effects
portalworld/PortalWorldPortal world definitions
DirectoryClassDescription
gameplay/GameplayConfigGameplay configuration
gamemode/GameModeGame mode definitions
entityeffect/EntityEffectStatus effects
attitude/AttitudeNPC attitudes
camera/CameraCamera configurations
itemanimation/ItemAnimationItem animations
blocktick/TickProcedureBlock tick procedures
DirectoryClassDescription
buildertool/BuilderToolBuilder tools
tagpattern/TagPatternTag matching patterns
responsecurve/ResponseCurveMathematical curves
wordlist/WordListWord lists for generation
  1. Use unique prefixes: Prefix asset IDs with your plugin name
  2. Validate references: Ensure referenced assets exist
  3. Provide defaults: Include sensible default values
  4. Document assets: Comment complex configurations
  5. Test combinations: Verify assets work together
  6. Consider performance: Avoid overly complex particle systems