Skip to content

V1.0.5 - Block API #4

@Program132

Description

@Program132

Create class to represent block in Hytale, example of code using the Block API class:

@Command(name = "magicwall")
public void onMagicWall(CommandContext ctx) {
    Player p = CommandUtils.requirePlayer(ctx);
    Location loc = p.getLocation();
    
    for(int x = 0; x < 3; x++) {
        for(int y = 0; y < 3; y++) {
            Location blockLoc = loc.clone().add(x, y, 0);
            blockLoc.getWorld().setBlock(blockLoc, "BLOCK_ID");
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions