Create a Minecraft Bedrock Edition behavior pack script using the latest @minecraft/server API. The add-on is called "Vampire Arrow". Do not create custom items; this script will only modify the behavior of the vanilla "minecraft:arrow".
Please write the complete main.js (or index.js) script implementing the following features:
- Constant Hold Effects:
Using system.runInterval, check all players in the world. If a player is holding a standard minecraft:arrow in their main hand, continuously apply the following effects to them:
- Strength (Amplifier 255)
- Saturation (so they never run out of hunger)
- Speed 3 (Amplifier 2)
- Haste 3 (Amplifier 2)
- Night Vision 3 (Amplifier 2)
- Lifesteal Mechanic:
Listen to the entity damage event (e.g., world.afterEvents.entityHurt or entityHitEntity). If the attacking entity is a Player and they are holding a minecraft:arrow in their main hand, heal the player for 10 health points (which equals 5 hearts).
- Sneak/Crouch Aura:
Inside the same interval loop, check if the player holding the minecraft:arrow is currently sneaking (isSneaking). If they are sneaking, activate a "Blood Aura":
- Spawn red particles (e.g., redstone dust or a similar red vanilla particle) in a radius around the player to visually represent the aura.
- Query all entities within a 5-block radius of the sneaking player.
- Apply Slowness 3 and Weakness 3 to all entities caught in the radius (make sure to exclude the player holding the arrow from these debuffs). These debuffs should only last for a short duration (e.g., 2 seconds) so they wear off quickly once the player stops sneaking or the entity leaves the radius.
Ensure the code uses modern @minecraft/server syntax (e.g., getComponent('equippable') or getComponent('inventory') to check the held item, and standard dimension querying for the aura). Add helpful comments explaining how the loops and events work.
The generation was stopped before any content could be produced.
No files in this session