Date: 2024/04/11 11:00:11 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
61
62
63
64
65
66
delight_world_event:
type: world
events:
on player right clicks block:
- if <context.item.contains[oraxen:id=string:cooking_pot]>:
- flag <player.target> cooking_pot:true
- note <inventory[delight_cooking_pot_inventory]> as:delight_cooking_pot_inventory_<player.target.uuid>
on player right clicks entity:
- if <context.entity.has_flag[cooking_pot]> && <context.entity.flag[cooking_pot]>:
- define x <context.entity.location.below.material.item>
- if <[x].contains[campfire]>:
- adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<<>shift:-8<>><<>glyph:cookingpot_on<>>
- inventory open destination:delight_cooking_pot_inventory_<context.entity.uuid>
- else :
- adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<<>shift:-8<>><<>glyph:cookingpot<>>
- inventory open destination:delight_cooking_pot_inventory_<context.entity.uuid>
- wait 5
- adjust <inventory[delight_cooking_pot_inventory_<context.entity.uuid>]> title:<<>shift:-8<>><<>glyph:cookingpot_on<>>
delight_cooking_pot_inventory:
type: inventory
inventory: chest
title: "<<>shift:-8<>><<>glyph:cookingpot<>>"
gui: true
slots:
- [] [] [] [] [] [] [] [] []
- [] [] [] [] [] [] [] [] []
- [] [] [] [] [] [] [] [] []
delight_cooking_pot_backend:
type: world
events:
on player left clicks item in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
- if not <context.is_shift_click>:
- determine cancelled:false
on player right clicks item in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
- if not <context.is_shift_click>:
- determine cancelled:false
on player drags in delight_cooking_pot_inventory bukkit_priority:HIGH ignorecancelled:true:
- if <context.slot> == 2|3|4|11|12|13:
- determine cancelled:false
on player left clicks in delight_cooking_pot_inventory slot:2|3|4|11|12|13 bukkit_priority:HIGH ignorecancelled:true:
- define identifiers oraxen:id=string:tomato|potato|cod|egg
- define x 0
- foreach <[identifiers]> key:key as:id :
- if not <context.slot.contains[<[id]>]> && <context.cursor_item.contains[<[id]>]>:
- define x:+:1
- foreach <context.inventory.map_slots> key:key as:slot:
- foreach <[identifiers]> key:key as:id :
- if <[slot].contains[<[id]>]> && not <context.cursor_item.contains[air]>:
- define x:+:1
# - narrate "<[x]> <list[<[identifiers]>].size>""
- if <list[<[identifiers]>].size> == <[x]>:
- inventory set d:<context.inventory> o:apple slot:8
- wait 1
- inventory adjust d:<context.inventory> slot:2 quantity:<context.inventory.slot[2].quantity.sub[1]>
- inventory adjust d:<context.inventory> slot:3 quantity:<context.inventory.slot[3].quantity.sub[1]>
- inventory adjust d:<context.inventory> slot:4 quantity:<context.inventory.slot[4].quantity.sub[1]>
- inventory adjust d:<context.inventory> slot:11 quantity:<context.inventory.slot[11].quantity.sub[1]>
- inventory adjust d:<context.inventory> slot:12 quantity:<context.inventory.slot[12].quantity.sub[1]>
- inventory adjust d:<context.inventory> slot:13 quantity:<context.inventory.slot[13].quantity.sub[1]>
- narrate Done!!
- narrate <context.item> targets:<server.online_players> per_player
- narrate <context.slot> targets:<server.online_players> per_player
- narrate <[x]> targets:<server.online_players> per_player