@@ -948,46 +948,114 @@ It is not compatible with plugins written for version 1.3.0 or lower, and plugin
948948 ```
949949 No need to manually write item-checking conditions - simply provide the item class and callback.
950950
951- ** Key Features:**
952- - No manual condition checks required
953- - Direct access to ` Player ` and ` PlayerInventory ` in callbacks
954-
955951
956952## Vendor
957953
958954### ` imperazim\vendor\customies\item `
959955
960956### Core Mechanics
961- - ` StackedByDataComponent ` : Controls item stacking behavior for variants with different aux values
962- - ` ShouldDespawnComponent ` : Toggles item despawn mechanics for floating entities
963- - ` ShooterComponent ` : Enables projectile launching (requires ` UseModifiersComponent ` )
964- - ` RecordComponent ` : Adds music playback functionality to items
965- - ` ItemTaskComponent ` : Creates a new ItemTaskComponent to define a task that checks for specific items in a player's inventory.
957+ - ** ` StackedByDataComponent ` ** : Controls item stacking behavior for variants with different aux values.
958+ ** Example:**
959+ ``` php
960+ $item->addComponent(new StackedByDataComponent(true)); // Allows stacking of items with different aux values
961+ ```
962+
963+ - ** ` ShouldDespawnComponent ` ** : Toggles item despawn mechanics for floating entities.
964+ ** Example:**
965+ ``` php
966+ $item->addComponent(new ShouldDespawnComponent(false)); // Prevents the item from despawning
967+ ```
968+
969+ - ** ` ShooterComponent ` ** : Enables projectile launching (requires ` UseModifiersComponent ` ).
970+ ** Example:**
971+ ``` php
972+ $item->addComponent(new ShooterComponent("arrow", ...view component)); // Shoots arrows with a speed of 1.5
973+ ```
974+
975+ - ** ` RecordComponent ` ** : Adds music playback functionality to items.
976+ ** Example:**
977+ ``` php
978+ $item->addComponent(new RecordComponent(1, 60, "record.song")); // Plays a specific music record
979+ ```
980+
981+ - ** ` ItemTaskComponent ` ** : Creates a new ItemTaskComponent to define a task that checks for specific items in a player's inventory.
982+ ** Example:**
983+ ``` php
984+ $item->addComponent(new ItemTaskComponent(
985+ DiamondSword::class,
986+ function(Player $player, Item $item): void {
987+ $player->sendMessage("You are holding a Diamond Sword!");
988+ },
989+ ItemTaskComponent::FILTER_HAND
990+ ));
991+ ```
966992
967993### Visual & Interaction
968- - ` HoverTextColorComponent ` : Sets custom color for item name hover text
969- - ` GlintComponent ` : Toggles enchantment glow effect
970- - ` InteractButtonComponent ` : Configures touch control interaction button (supports custom text)
971- - ` LiquidClippedComponent ` : Defines liquid block interaction behavior
994+ - ** ` HoverTextColorComponent ` ** : Sets custom color for item name hover text.
995+ ** Example:**
996+ ``` php
997+ $item->addComponent(new HoverTextColorComponent("color")); // Sets hover text color to red. See: https://minecraft.wiki/w/Formatting_codes#Color_codes
998+ ```
999+
1000+ - ** ` GlintComponent ` ** : Toggles enchantment glow effect.
1001+ ** Example:**
1002+ ``` php
1003+ $item->addComponent(new GlintComponent(true)); // Adds an enchantment glow to the item
1004+ ```
1005+
1006+ - ** ` InteractButtonComponent ` ** : Configures touch control interaction button (supports custom text).
1007+ ** Example:**
1008+ ``` php
1009+ $item->addComponent(new InteractButtonComponent("Use Item")); // Displays "Use Item" on the interact button
1010+ ```
1011+
1012+ - ** ` LiquidClippedComponent ` ** : Defines liquid block interaction behavior.
1013+ ** Example:**
1014+ ``` php
1015+ $item->addComponent(new LiquidClippedComponent(true)); // Allows interaction with liquid blocks
1016+ ```
9721017
9731018### Item Customization
974- - ` DyeableComponent ` : Enables cauldron-based dyeing (requires ` dyed ` texture definition)
975- - ` EnchantableSlotComponent ` : Restricts applicable enchantment types (e.g., bow-only enchants)
976- - ` EnchantableValueComponent ` : Sets base enchantment strength
1019+ - ** ` DyeableComponent ` ** : Enables cauldron-based dyeing (requires ` dyed ` texture definition).
1020+ ** Example:**
1021+ ``` php
1022+ $item->addComponent(new DyeableComponent("#hex")); // Allows the item to be dyed in a cauldron
1023+ ```
1024+
1025+ - ** ` EnchantableSlotComponent ` ** : Restricts applicable enchantment types (e.g., bow-only enchants).
1026+ ** Example:**
1027+ ``` php
1028+ $item->addComponent(new EnchantableSlotComponent(self::SLOT_NAME)); // Allows only slot_name enchantments
1029+ ```
1030+
1031+ - ** ` EnchantableValueComponent ` ** : Sets base enchantment strength.
1032+ ** Example:**
1033+ ``` php
1034+ $item->addComponent(new EnchantableValueComponent(10)); // Sets base enchantment strength to 10
1035+ ```
9771036
9781037### Combat & Durability
979- - ` DamageComponent ` : Increases attack damage (positive values only)
980- - ` DamageAbsorptionComponent ` : Reduces incoming damage when equipped as armor (requires durability)
1038+ - ** ` DamageComponent ` ** : Increases attack damage (positive values only).
1039+ ** Example:**
1040+ ``` php
1041+ $item->addComponent(new DamageComponent(5)); // Adds 5 extra damage to the item
1042+ ```
1043+
1044+ - ** ` DamageAbsorptionComponent ` ** : Reduces incoming damage when equipped as armor (requires durability).
1045+ ** Example:**
1046+ ``` php
1047+ $item->addComponent(new DamageAbsorptionComponent(3)); // Absorbs 3 points of damage
1048+ ```
9811049
9821050### Specialized Systems
983- - ` BundleInteractionComponent ` : Enables bundle storage mechanics (requires ` storage_item ` component)
984- - ` UseModifiersComponent ` : Configures item usage timing for food/throwable/shooter items
985- ```
986-
987- **Key Improvements:**
988- - Structured hierarchy with clear section separation
989- - Component grouping by functional category
990- - Consistent formatting for code blocks and component names
991- - Concise yet descriptive explanations
992- - Explicit dependency warnings
993- - Removed redundant technical jargon
1051+ - ** ` BundleInteractionComponent ` ** : Enables bundle storage mechanics (requires ` storage_item ` component).
1052+ ** Example: **
1053+ ``` php
1054+ $item->addComponent(new BundleInteractionComponent(4)); // Enables Bundle Interactions with 4 slots
1055+ ```
1056+
1057+ - ** ` UseModifiersComponent ` ** : Configures item usage timing for food/throwable/shooter items.
1058+ ** Example: **
1059+ ``` php
1060+ $item->addComponent(new UseModifiersComponent(1.0, 1.5)); // Sets item usage modifiers +1.0 with duration to 1.5 seconds
1061+ ```
0 commit comments