entity_manipulator_item: debug: false type: item material: Lead display name: Entity Manipulator mechanisms: unbreakable: true flags: active_manipulator: false power: 15 entity_manipulator_inventory: debug: false type: inventory inventory: chest title: <&E>Entity Manipulator gui: true slots: - [rotate_facing_item] [] [] [] [] [] [] [] [inspector_gadget_item] - [] [] [] [] [] [] [] [] [] entity_manipulator_command: debug: false type: command name: entitymanipulator description: A stick that lets you manipulate targeted entities. usage: /entitymanipulator [<<>optional_amount<>>] aliases: - em permission: give.entitymanipulator script: - if : - give entity_manipulator_item quantity:1 - narrate "<&E>Right click while holding to select an active manipulator!" - narrate "<&E>Default Power: 15 - Type <&6>'/em <<>#<>>'<&E> for a different amount!" - if !: - if matches entity_manipulator_item: - if > 1: - narrate "<&c>Too many arguments provided.. Did you use the correct format?" - if == 1 && !: - narrate "<&c>Argument provided isn't a number" - if == 1 && : - narrate "<&E>Manipulator Power set to: <&6>" - inventory flag slot:hand power: - else if !matches entity_manipulator_item: - narrate "Hold the Manipulator in your main hand." entity_manipulator_item_world: debug: false type: world events: # - Item Specific Logic # Player selects item in toolbar. after player scrolls their hotbar item:entity_manipulator_item: - narrate "Active Manipulator: ].flag[active_manipulator]>" # Open Inventory and cancel world interaction. on player right clicks block with:entity_manipulator_item: - inventory open d:entity_manipulator_inventory - determine cancelled # Don't break any blocks. on player left clicks block with:entity_manipulator_item: - determine cancelled # Cancel Damage Dealt to Entity. NPC's still receive a damage triggered event though!! on player damages entity with:entity_manipulator_item bukkit_priority:high: - determine cancelled entity_manipulator_flagging_world: debug: true type: world events: # - Set Active Manipulation Flags: # Rotate Item after player clicks rotate_facing_item in entity_manipulator_inventory: - if matches entity_manipulator_item: - inventory flag slot:hand active_manipulator:rotate_facing - narrate "<&E>Active Tool Set: <&6>Rotate Entity Clockwise!" - narrate "<&E>Hold `Sneak` to reverse the rotation direction!" - inventory close after player clicks inspector_gadget_item in entity_manipulator_inventory: - if matches entity_manipulator_item: - inventory flag slot:hand active_manipulator:inspector_gadget - narrate "<&E>Active Tool Set: <&6>Inspector Gadget!" - inventory close entity_manipulator_triggered_world: debug: true type: world events: # - Triggered Logic on player animates ARM_SWING with:entity_manipulator_item: - define power - define target - if : - define power - - if <[target].exists>: - if !: - narrate "<&E>Right click to select a manipulator first!" # Inspector Gadget Logic - if == inspector_gadget: - narrate "<&E>Inspection Results:" - narrate "<&F>Health: <&6><[target].health.round_to_precision[0.01]>/<[target].health_max>" - narrate "<&F>X:<&6><[target].location.x.format_number[0.00].pad_left[6]> <&F>Y:<&6><[target].location.y.format_number[0.00].pad_left[6]> <&F>Z:<&6><[target].location.z.format_number[0.00].pad_left[6]>" - narrate "<&F>Body Yaw: <&6><[target].body_yaw>" - narrate "<&F>Head Yaw: <&6><[target].location.yaw> <&F>Head Pitch: <&6><[target].location.pitch>" - narrate "<&F>Sleeping: <&6><[target].is_sleeping>" - narrate "<&F>Sneaking: <&6><[target].is_sneaking>" - narrate "<&F>Sitting: <&6><[target].is_sitting>" - if <[target].item_in_hand> == : - narrate "<&F>Holding: <&6>Air" - else: - if <[target].item_in_hand.has_display>: - narrate "<&F>Holding: <&6><[target].item_in_hand.display>" - else: - narrate "<&F>Holding: <&6><[target].item_in_hand.material.name>" # Rotation Tool Logic - if == rotate_facing: - teleport <[target]> <[target].location.rotate_yaw[<[power]>]> # Manipulation Item Containers! inspector_gadget_item: type: item material: ender_eye display name: Inspector Gadget ## adjust head_angle:-180 eg rotate_facing_item: type: item material: arrow display name: Rotate Facing rotate_body_item: type: item material: spectral_arrow display name: Rotate Body