skills/hytopia-world/SKILL.md
Helps build and manage worlds in HYTOPIA SDK. Use when users need to create terrain, place blocks, manage chunks, or work with the world editor integration. Covers blocks, chunk loading, world generation, and build.hytopia.com workflow.
npx skillsauth add abstrucked/hytopia-skills hytopia-worldInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps you build and manage worlds in HYTOPIA SDK games.
Documentation: https://dev.hytopia.com/sdk-guides/world
Use this skill when the user:
import { World, BlockType } from 'hytopia';
// Place a single block
world.setBlock({ x: 0, y: 0, z: 0 }, BlockType.GRASS);
// Remove a block
world.setBlock({ x: 0, y: 0, z: 0 }, BlockType.AIR);
// Get block at position
const block = world.getBlock({ x: 0, y: 0, z: 0 });
import { BlockType, Block } from 'hytopia';
const customBlock = new BlockType({
id: 'my-mod:custom-block',
name: 'Custom Block',
textureUri: 'textures/custom.png',
isSolid: true,
opacity: 1.0
});
// Register the block
world.blockRegistry.register(customBlock);
import { World, BlockType } from 'hytopia';
class TerrainGenerator {
generateChunk(chunkX: number, chunkZ: number, world: World) {
for (let x = 0; x < 16; x++) {
for (let z = 0; z < 16; z++) {
const worldX = chunkX * 16 + x;
const worldZ = chunkZ * 16 + z;
// Simple heightmap
const height = Math.floor(Math.sin(worldX * 0.1) * 5 + 10);
for (let y = 0; y < height; y++) {
const block = y === height - 1 ? BlockType.GRASS : BlockType.DIRT;
world.setBlock({ x: worldX, y, z: worldZ }, block);
}
}
}
}
}
import { World } from 'hytopia';
import worldData from './assets/world.json';
// Load world created in build.hytopia.com
world.loadFromJSON(worldData);
// Enable chunk loading around players
world.chunkLoadingEnabled = true;
world.chunkLoadRadius = 8; // chunks
// Custom chunk loader
world.onChunkLoad = (chunkX, chunkZ) => {
// Generate or load chunk data
terrainGenerator.generateChunk(chunkX, chunkZ, world);
};
world.onChunkUnload = (chunkX, chunkZ) => {
// Save chunk data if needed
};
// Load specific chunk
world.loadChunk(0, 0);
// Unload chunk
world.unloadChunk(0, 0);
// Check if chunk is loaded
const isLoaded = world.isChunkLoaded(0, 0);
assets/world.jsonimport worldData from './assets/world.json';
world.loadFromJSON(worldData, {
// Options
clearExisting: true, // Remove existing blocks
offset: { x: 0, y: 0, z: 0 } // Apply offset
});
function placeStructure(world: World, position: Vector3, structure: Block[][]) {
for (let y = 0; y < structure.length; y++) {
for (let x = 0; x < structure[y].length; x++) {
for (let z = 0; z < structure[y][x].length; z++) {
const block = structure[y][x][z];
if (block !== BlockType.AIR) {
world.setBlock({
x: position.x + x,
y: position.y + y,
z: position.z + z
}, block);
}
}
}
}
}
// Place block where player is looking
const raycast = world.raycast(player.position, player.lookDirection, 5);
if (raycast.hit) {
const placePos = raycast.position.add(raycast.normal);
world.setBlock(placePos, BlockType.STONE);
}
tools
Helps create and use plugins in HYTOPIA SDK games. Use when users need to add NPM packages, create reusable modules, or extend game functionality. Covers plugin requirements, installation, and best practices.
development
Helps implement physics and collision in HYTOPIA SDK games. Use when users need rigid bodies, collision detection, raycasting, forces, or physics-based gameplay. Covers PhysicsComponent, colliders, raycasting, and physics simulation.
development
Helps save and load persistent data in HYTOPIA SDK games. Use when users need to save player progress, leaderboards, game state, or any data that persists across sessions. Covers PersistenceManager, global data, and player data.
development
Helps implement multiplayer features in HYTOPIA SDK games. Use when users need player management, server-authoritative gameplay, networking, or state synchronization. Covers Player class, server authority, network optimization, and player data.