Download the PHP package aternos/hawk without Composer

On this page you can find all versions of the php package aternos/hawk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hawk

Hawk

About

Hawk is a PHP library to get and/or replace blocks and get and/or delete entities in Minecraft region files. This allows the user to replace blocks or delete entities that will crash the server when loaded.

Currently, following versions are supported:

1.12+ for entities
1.16+ for blocks

Installation

Usage

Class File

How to get a file from disk:

How to use setContent() to set up a file stream and getContent() to get the content out of the stream:

Class Hawk

Setups:

Setup for blocks and block entities in any supported version:

Setup for entities prior 1.17:

Setup for entities starting from 1.17:

How to read a block:

How to replace a block at x = 1, y = 2, z = 3 with wool(default is minecraft:stone):

Get all entities in a specific chunk:

How to get all entities next to float coordinates (there could be more than just one):

How to delete an entity:

Get all block entities in a specific chunk:

How to get all block entities next to float coordinates (there could be more than just one):

How to delete a block entity:

For more information see these examples: deleteEntity.php.

Methods

Name Return type Description
loadBlockRegions(File[] $files) void Load extra "block"("world/region") regions from $files into Hawk
loadEntitiesRegions(File[] $files) void Load extra "entities"("world/entities") regions from $files into Hawk
getBlockRegionFromBlock(McCoordinates3D $coordinates) Region Get block region from block at $coordinates
getEntitiesRegionFromBlock(McCoordinates3D $coordinates) Region Get entities region from block at $coordinates (see McCoordinatesFloat::get3DCoordinates for entity coords)
getBlock(McCoordinates3D $coordinates) DataBlock Get block at $coordinates
replaceBlock(McCoordinates3D $coordinates, string $blockName = "minecraft:stone") void Replace block at $coordinates with block $blockName
getEntities(string $name, McCoordinatesFloat $coordinates) Entity[] Gets one or multiple entities at $coordinates
getAllEntitiesFromChunk(McCoordinates3D $blockCoordinates) Entity[] Gets all entities in chunk based on $coordinates
deleteEntity(Entity $entity) void Deletes an entity object
getEntities(string $name, McCoordinatesFloat $coordinates) Entity[] Gets one or multiple entities at $coordinates
getAllEntitiesFromChunk(McCoordinates3D $blockCoordinates) Entity[] Gets all entities in chunk based on $coordinates
deleteEntity(Entity $entity) void Deletes an entity object
save() void Save changes to file

Class Region

A region object represents a Minecraft region file. The main tasks of a region object is to read/decompress and write/compress chunks from/to its region file. Additionally, it provides static functions to calculate region coordinates and its file name.

Methods

Name Return type Description
static getRegionFileNameFromBlock(McCoordinates3D $coordinates) string Get region file name out of block coordinates
static getRegionCoordinatesFromFile(AbstractFile $file) McCoordinates2D Get region coordinates from file name
static getRegionCoordinatesFromBlockCoordinates(McCoordinates3D $coordinates) McCoordinates2D Get region coordinates from block coordinates
static getRegionCoordinatesFromChunkCoordinates(McCoordinates2D $coordinates) McCoordinates2D Get region coordinates from chunk coordinates

Class Chunk

A chunk object represents a Minecraft chunk in Mojangs chunk format. The main task of a chunk object is to replace the sections tag of the NBT structure, compress the new chunk data and provide it to its region. Additionally, it provides a static function to calculate chunk coordinates.

Methods

Name Return type Description
static getChunkCoordinates(McCoordinates3D $coordinates) McCoordinates2D Get chunk coordinates from block coordinates

Class Section

A section object represents a single section tag.

Methods

Name Return type Description
static getSectionCoordinates(McCoordinates3D $coordinates) McCoordinates3D Get section coordinates from block coordinates
static getBlockCoordinates(McCoordinates3D $coordinates) McCoordinates3D Get block coordinates relative to its section

All versions of hawk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-readline Version *
aternos/nbt Version >=1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aternos/hawk contains the following files

Loading the files please wait ....