Date: 2023/03/10 21:13:09 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
entity_manipulator_item:
debug: false
type: item
material: bamboo
display name: Entity Manipulator
mechanisms:
unbreakable: true
flags:
active_manipulator: false
entity_manipulator_inventory:
debug: false
type: inventory
inventory: chest
title: <&8><bold>Entity Manipulator
gui: true
slots:
- [rotate_15_item] [] [] [] [] [] [] [] []
- [] [] [] [] [] [] [] [] []
entity_manipulator_command:
debug: false
type: command
name: entitymanipulator
description: A stick that lets you manipulate targeted entities.
usage: /entitymanipulator
aliases:
- em
permission: give.entitymanipulator
script:
- give entity_manipulator_item quantity:1
entity_manipulator_item_world:
debug: true
type: world
events:
# Player selects item in toolbar.
on player scrolls their hotbar item:entity_manipulator_item:
## Doesn't work.
- narrate <player.item_in_hand.has_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:low:
- narrate "Low Priority: <context.cancelled>"
- determine cancelled
on player damages entity with:entity_manipulator_item bukkit_priority:high:
- narrate "High Priority: <context.cancelled>"
- determine cancelled
# Set Active Manipulation Flag:
after player clicks rotate_15_item in entity_manipulator_inventory:
- if <player.item_in_hand> matches entity_manipulator_item:
- inventory flag slot:hand active_manipulator:rotate_15_item
- narrate "Active Tool Set: Rotate Entity 15 Degrees (clockwise)" targets:<server.online_players>
- inventory close
# Triggered Logic
on player animates ARM_SWING with:entity_manipulator_item:
- if <player.target.exists>:
## Doesn't work.
- if <player.item_in_hand.flag[active_manipulator]>:
- narrate <player.item_in_hand>
# Manipulation Item Containers!
rotate_15_item:
type: item
material: arrow