Date: 2014/06/22 19:16:10 UTC-07: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
'VehicleManagerEvents':
type: world
debug: true
events:
# Minecart stuff
on player right clicks with MyCartItem:
- determine passively CANCELLED
- run s@VehicleManagerTask p:minecart def:<context.location>|<context.item>
on player exits minecart:
- if !<player.inventory.contains[i@MyCartItem]> {
- remove <context.vehicle>
- give <player> i@MyCartItem
}
on minecart collides with entity:
- announce to_flagged:admin "A <context.vehicle> crashed into <context.entity>"
- determine CANCELLED
on i@MyCartItem spawns:
- determine CANCELLED
on player clicks i@MyCartItem in inventory:
- determine CANCELLED
# Make sure players get the item on join and if they die
on player joins:
- run s@GiveDefaultParkItems delay:2t instantly
'GiveDefaultParkItems':
type: task
debug: true
script:
- if !<player.inventory.contains[i@MyCartItem]> {
- if <player.get_vehicle.entity_type> != minecart {
- give <player> i@MyCartItem
}
}
'VehicleManagerTask':
type: task
debug: true
script:
- narrate ""
minecart:
- ^define rails 'm@rails|m@powered_rail'
- ^if !<def[rails].contains[<def[1].material>]> queue stop
- ^mount <player>|minecart <def[1].add[0.5,0.5,0.5]>
- ^take i@MyCartItem
'MyCartItem':
type: item
material: minecart
display name: <&3>My Cart
lore:
- Your personal Minecart
- Keep it with you always
bound: true