⭐
StarAPI Documentation
  • ⭐API Information
    • ❔About Our API's
    • ⬇️Installing Our API
  • 🌟StarAPI (Spigot/Paper)
    • 📂Abilities
      • ⏳Transmition
      • 🤯Implosion
      • 🏹MultiShot
    • 📂Builders
      • 👕Armor Builder
      • 📊Bossbar Builder
      • ☄️Command Builder
      • ⚔️Item Builder
      • 🧟‍♂️Mob Builder
      • 💯Scoreboard Builder
      • 🔗Webhook Builder
      • 🔨Message Builder
      • 🏗️Actionbar Builder
    • 📂Files
      • 📃Create Files
      • 📁Create Folders
      • 📖Read Files
      • 🖊️Write Files
    • 📂Inventory Utilities
      • 💎Animated Items
      • 📖Book Content
      • 📔Book GUI
      • 🎞️Filler
      • 🪁Inventory Items
      • 📝Inventory Name
      • 💀Inventory Skulls
    • 📂Message Utilities
      • 🤖Auto Responses
      • 🎨Message Colors
    • 📂Recipes
      • ⚒️Crafting Recipes
      • 🧑‍🍳Furnace Recipes
    • 📂Timers
      • 🕙Active Timers
      • ❌Cancel Timers
      • 🕙Delayed Timers
      • 🕐Create Timers
    • 📂Misc
      • 💀Give Skulls
      • 📈Progress Bars
      • ⬛Block Placer
Powered by GitBook
On this page
  • Overview
  • Methods
  • Enums
  • Example Usage
  1. StarAPI (Spigot/Paper)
  2. Misc

Block Placer

Place blocks in any direction

Overview

The BlockPlacer class provides a utility for programmatically placing blocks in a specified direction from a given origin location.

Methods

create

public static BlockPlacer create(JavaPlugin plugin, Material material)

Creates a new BlockPlacer instance with the specified plugin and material.

Parameters

  • plugin: The JavaPlugin instance associated with the plugin.

  • material: The material of the block to be placed.

Returns

  • Returns a new instance of the BlockPlacer class.

setDirection

public BlockPlacer setDirection(Direction direction)

Sets the direction in which blocks will be placed.

Parameters

  • direction: The direction in which blocks will be placed. Should be one of the values defined in the Direction enum.

Returns

  • Returns the updated BlockPlacer instance.

setLength

public BlockPlacer setLength(int length)

Sets the number of blocks to be placed in the specified direction.

Parameters

  • length: The number of blocks to be placed.

Returns

  • Returns the updated BlockPlacer instance.

setHeight

public BlockPlacer setHeight(int height)

Sets the height of the block column to be placed.

Parameters

  • height: The height of the block column.

Returns

  • Returns the updated BlockPlacer instance.

setDelayBetweenBlocks

public BlockPlacer setDelayBetweenBlocks(long delay)

Sets the delay between placing each block in milliseconds.

Parameters

  • delay: The delay between placing each block in milliseconds.

Returns

  • Returns the updated BlockPlacer instance.

build

public void build(Location origin)

Builds the block column starting from the specified origin location.

Parameters

  • origin: The origin location from which to start placing blocks.

Returns

  • This method does not return anything.

Enums

Direction

Represents the direction in which blocks will be placed.

Example Usage

JavaPlugin plugin = // your plugin instance
Material material = Material.STONE;
Location origin = // your origin location

BlockPlacer.create(plugin, material)
    .setDirection(BlockPlacer.Direction.UP)
    .setLength(10)
    .setHeight(5)
    .setDelayBetweenBlocks(100)
    .build(origin);

In this example, we create a BlockPlacer instance, set its properties, and build a column of blocks starting from the specified origin location.

PreviousProgress Bars

Last updated 1 year ago

🌟
📂
⬛