By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.

OK, Don't show this again

A PocketMine-MP plugin that implements support for custom blocks, items and entities.
version 1.0.4
Approved
Direct Download How to install?
Switch version
12 Downloads / 204 Total
10 Reviews
Plugin Description §

Customies

A PocketMine-MP plugin that implements support for custom blocks, items and entities.

It is important to note that custom blocks will not work properly with other plugins that also modify the runtime block mappings, such as INether and VanillaX.

Important Contributors

Name Contribution
TwistedAsylumMC Helped research and develop the first versions of Customies as well as maintain the code
DenielW Helped research and develop the first versions of Customies
Unickorn Maintained the code during the PM4 betas and kept it up to date
JackNoordhuis Suggested the idea of using async workers and helped write the code which made them function
ScarceityPvP Helped develop the item components implementation and block-related bug fixes

Usage

Custom Blocks

Registering a custom block can either be done with or without a model using the CustomiesBlockFactory class. Without a model all you need to do is register the block with the same parameters you would use to construct a Block normally.

use customiesdevs\customies\block\CustomiesBlockFactory;
use pocketmine\block\BlockBreakInfo;

// ...

public function onEnable(): void {
	CustomiesBlockFactory::getInstance()->registerBlock(Block::class, "customies:example_block", "Example Block", new BlockBreakInfo(1));
}

// ...

If your block contains a different model, you can provide a Model as the 4th argument. A model requires an array of materials, a texture, an origin and a size.

  • Materials: Array of materials that define how the texture is applied to specific faces
  • Texture: Name of the texture to apply to the model
  • Origin: The origin point of the selection box. Vector3(0, 0, 0) is the top right corner of the block
  • Size: The size of the block in pixels. This must be between Vector3(0, 0, 0) and Vector3(16, 16, 16) as the client does not support blocks being larger than this
use customiesdevs\customies\block\CustomiesBlockFactory;
use customiesdevs\customies\block\Material;
use customiesdevs\customies\block\Model;
use pocketmine\block\BlockBreakInfo;
use pocketmine\math\Vector3;

// ...

public function onEnable(): void {
	$material = new Material(Material::TARGET_ALL, "example", Material::RENDER_METHOD_ALPHA_TEST);
	$model = new Model([$material], "geometry.example", new Vector3(-8, 0, -8), new Vector3(16, 16, 16));
	CustomiesBlockFactory::getInstance()->registerBlock(Block::class, "customies:example_block", "Example Block", new BlockBreakInfo(1));
}

// ...
$block = CustomiesBlockFactory::getInstance()->get("customies:example_block");

More information about materials and the different properties can be found on docs.microsoft.com.

Custom Entities

Registering a custom entity is as simple as registering a normal entity. All you need to do is use the CustomiesEntityFactory class to register the entity, and then spawn the entity in the same way as you would normally.

use customiesdevs\customies\entity\CustomiesEntityFactory;

// ...

public function onEnable(): void {
	CustomiesEntityFactory::getInstance()->registerEntity(ExampleEntity::class, "customies:example_entity");
}

// ...
$entity = new ExampleEntity(new Location(...));
$entity->spawnToAll();

If you want to provide your own creation func, registerEntity accepts an optional 3rd parameter to provide your own creation func with the same signature as normal (Closure(World $world, CompoundTag $nbt) : Entity)

Custom Items

Registering a custom item is as simple as registering a normal item, but the ID is calculated for you. All you need to do is use the CustomiesItemFactory class to register the item, and fetch it as you would with a vanilla item.

use customiesdevs\customies\item\CustomiesItemFactory;

// ...

public function onEnable(): void {
	CustomiesItemFactory::getInstance()->registerItem(Item::class, "customies:example_item", "Example Item");
}

// ...
$item = CustomiesItemFactory::getInstance()->get("customies:example_item", 64);

Custom items can also have components which are used to change the behaviour of items client side, such as making it edible or have durability etc. To get started with components, you need to implement the ItemComponents interface, use the ItemComponentsTrait and call the initComponent method in the constructor of your class.

use customiesdevs\customies\item\ItemComponents;
use customiesdevs\customies\item\ItemComponentsTrait;
use pocketmine\item\Item;

class ExampleItem extends Item implements ItemComponents {
	use ItemComponentsTrait;

	public function __construct() {
		$this->initComponent("example_item", 64);
	}
}

Now that you have an item with components, you can add either components or properties using the addComponent and addProperty methods.

// ...

$this->addComponent("minecraft:armor", ["protection" => 4]);
$this->addProperty("allow_off_hand", true);

// ...

More information about all the different item components and properties can be found on docs.microsoft.com.

What's new §
  • Add Scarce to contributors
  • Appropriately order contributions
  • Create .poggit.yml
  • Fix: Slowed down when we walk on customblocks
  • Merge pull request #10 from CustomiesDevs/namespace_change
    • Namespace Changes
  • Merge pull request #11 from Steellgold/patch-1
    • Fix: Slowed down when we walk on customblocks
  • Merge pull request #18 from CustomiesDevs/update
    • update version and contributors list
  • Merge pull request #4
  • My fault Nick
  • Namespace Changes
  • Update README.md
  • Update README.md
    • Added twisted (Seb) to the ReadME
  • Update README.md
    • Spelling Error
  • Update README.md
    • Updated Sebs name to TwistedAsylumMC
  • update version and contributors list
  • Fix a crash with crafting recipes
  • Optimise item getting

drazPM
using v1.0.5
27 Jun 22
DavidGlitch04
Outdated
using v1.0.3
18 Jun 22
MCPEAbdu77
Outdated
using v1.0.3
18 Jun 22
DaDevGuy
Outdated
using v1.0.3
18 Jun 22
PushkarOP
Outdated
using v1.0.3
08 Jun 22
Atara6431
Outdated
using v1.0.3
27 May 22
very useful plugin,I will support you forever
Thank you 18780262934 🙏
Mcbeany
Outdated
using v1.0.3
20 May 22
best plugin of all time
jasonwynn10
Staff Outdated
using v1.0.3
18 May 22
This is incredibly useful for all my custom items I plan to make. PM plugins are all going to start looking like Java mods lol
That's the plan! When we started this project a few years ago, we always wanted to recreate Java mods but we just never had the time to do it
xxAROX
Outdated
using v1.0.3
18 May 22
cosmicnebula200
Outdated
using v1.0.3
17 May 22

Reply to review by :

/ 5
Supported API versions
4.0.0
->
4.5.2
Producers §
  • Collaborators:
    • @Steellgold
    • @TwistedAsylumMC
  • Contributors:
    • @DenielWorld
    • @ScarceityPvP
    • @T14Raptor
    • @Unickorn
License §
Categories:
Developer Tools
Mechanics
API plugins
Permissions
Manage entities
Manage blocks/items
Manage world generators
Asynchronous tasks

You can leave one review per plugin release, and delete or update your review at any time

/ 5
Loading...