Skip to content

Latest commit

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CustomItem (API / Configuration)

A plugin to add items hyper easily !

Note: Creates issues if you find bugs :)

Plugins

Your Imagination no longer imitates it. Create, invent your Mod would like to have on your server

  • Armor 🛡️
  • Sword ⚔️
  • Tools ⚒️
  • Food 🥔

We offer You A Config For beginners But also, for more to free an API !!!

This plugin is made for pocketmine 4 but has a pocketmine 3 version.

Config

To create items in The config file :

item:
basic:
id: 1059#ID Of Itemname: "basic_config"#Name of item do not use a shifttexture: "stick"#texture in pack

All the examples are in the YMl file : https://github.com/Big-Potatoes/CustomItem/blob/main/resources/config.yml

API

To access the plugin functionality:

useRefaltor\Natof\CustomItem\CustomItem;

To get started on our API, here are the basics :

Write on your congif.yml

name: YourPluginversion: 1.0.0api: 4.0.0main: Your Mainsoftdepend:
- CustomItem
// creates an item$item = CustomItem::createBasicItem(newItemIdentifier(1000, 0), 'name');
// to put a texture to the item$item->setTexture('apple');
// to save the item on the server
CustomItem::registerItem($item);

Items events

The plugin contains support with events for all items, events are used with a callable

$item = CustomItem::createBasicItem(newItemIdentifier(<id>, <meta>), 'name');
// all available events with the parameters$item->setInteractOnBlockListener(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector);
$item->setReleaseUsingListener(Player $player);
$item->setClickAirListener(Player $player, Vector3 $directionVector);
$item->setDestroyBlockListener(Block $block);
$item->setAttackEntityListener(Entity $victim);

Support Armor

The plugin allows to add real armor with real durability

// to create a helmet$item = CustomItem::createHelmetItem(newItemIdentifier(<id>, <meta>), newArmorTypeInfo(<defense points>, <durability>, <armor slot but it’s not important>), 'Helmet Test');
$item->setTexture('iron_helmet');
CustomItem::registerItem($item);
// all the functions of armor$item = CustomItem::createHelmetItem(newItemIdentifier(<id>, <meta>), newArmorTypeInfo(<defense points>, <durability>, <armor slot but it’s not important>), 'Helmet Test');
$item = CustomItem::createChestplateItem(newItemIdentifier(<id>, <meta>), newArmorTypeInfo(<defense points>, <durability>, <armor slot but it’s not important>), 'Chestplate Test');
$item = CustomItem::createLeggingsItem(newItemIdentifier(<id>, <meta>), newArmorTypeInfo(<defense points>, <durability>, <armor slot but it’s not important>), 'Leggings Test');
$item = CustomItem::createBootsItem(newItemIdentifier(<id>, <meta>), newArmorTypeInfo(<defense points>, <durability>, <armor slot but it’s not important>), 'Boots Test');

Support Food Item

The plugin contains support to add food to the server.

// to create a food item$item = CustomItem::createFoodItem(newItemIdentifier(<i>, <meta>), 'name', <int food restore>, <float saturation restore>);
$item->setTexture('steak');
CustomItem::registerItem($item);
// event for food items$item->setConsumeListener(Player $player, Item $item);

Demo

Futur

TODO

  • Food Bugs Fix
  • Armor Equip Fix
  • Pickaxe Mining fix 1/2

About

Add Item Custom For pocketmine 4 🥔

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages