tank_handler: type: world events: on player drags liquid_tank in backpack_script: - determine cancelled #fill tank on player right clicks *_bucket in inventory: - determine passively cancelled - define slots - define current -1 - define max 1 - define valid_slot -1 #find a valid slot if there is one - foreach <[slots]> as:slot: - if ].has_flag[liquid_level]>: - define current ].flag[liquid_level.current]> - define max ].flag[liquid_level.max]> - if ( <[current].is_less_than[<[max]>]> && ].material.name> == ) || <[current]> == 0: - define valid_slot <[slot]> - foreach stop #valid slot found - if <[valid_slot]> > 0: - inventory flag liquid_level.current:++ slot:<[valid_slot]> destination: - if !].has_flag[title_changed]>: - inventory flag title_changed slot:<[valid_slot]> destination: - define type ].material> - inventory adjust slot:<[valid_slot]> display:]> destination: - define current ].flag[liquid_level.current]> - inventory adjust slot:<[valid_slot]> "lore:<&nl><&f>Niveau: <&7><[current]><&f>/<&6><[max]>" destination: - inventory adjust slot: material:bucket destination: - if ].material> != : - inventory adjust slot:<[valid_slot]> destination: material: #no valid slot found, send info message - else: - define tank_type ]> - define tanks ].parse_tag[<[parse_value].material>]> - if <[tanks].contains[]>: - narrate " " - narrate - else: - narrate