Add dupe prevention mechanism and fix LiteProfiles menu edge case

This commit is contained in:
Rares Bozga
2026-03-21 13:33:28 +02:00
parent 44530c5edf
commit 6094306182
5 changed files with 33 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ compatibility_check_world:
after player joins:
- if <proc[settings_get].context[<player>|general_ignore_version_compatibility_check]>:
- stop
- define player_version <player.viaversion_version.split[-].get[2]>
- define player_version <player.viaversion_version>
- define server_version <server.version.split[(].get[2].split[:].get[2].split[)].get[1].trim>
- if <proc[compatibility_check_compare_versions].context[<[player_version]>|<[server_version]>]> == -1:
- wait 5s

View File

@@ -0,0 +1,26 @@
no_duping_custom_items:
debug: false
type: world
events:
on player clicks item in inventory:
- if <player.is_op>:
- stop
- if <player.gamemode> != creative:
- stop
- if <context.item.material.advanced_matches[iron_horse_armor|note_block].if_null[true]> && <context.cursor_item.material.advanced_matches[iron_horse_armor|note_block].if_null[true]>:
- stop
- if <context.item.has_custom_model_data.if_null[false]> || <context.cursor_item.has_custom_model_data.if_null[false]>:
- determine cancelled passively
- adjust <player> item_on_cursor:air
- inventory update
on player drags in inventory:
- if <player.is_op>:
- stop
- if <player.gamemode> != creative:
- stop
- if <context.item.material.advanced_matches[iron_horse_armor|note_block].if_null[true]> && <context.cursor_item.material.advanced_matches[iron_horse_armor|note_block].if_null[true]>:
- stop
- if <context.item.has_custom_model_data.if_null[false]> || <context.cursor_item.has_custom_model_data.if_null[false]>:
- determine cancelled passively
- adjust <player> item_on_cursor:air
- inventory update