SNEAK ENCHANT v2.0 (1.21.9-26.2)
======================
Crouch to roll a random enchantment (+1 level) on every item you carry, armor and offhand included.

DEFAULTS = SNEAK ENCHANT 1.2
Out of the box this behaves like 1.2: every crouch rolls one random enchantment (+1 level) on each slot.
No cooldown, no jackpot, no backfire, no actionbar text, no ranking. The extras are all there, switched off:
turn them on in the settings whenever you want more chaos.

THE EXTRAS (all OFF by default)
- COOLDOWN: ticks between rolls per player.
- JACKPOT: your held item gets one random non-curse enchantment boosted by several levels.
- BACKFIRE: a curse (Binding or Vanishing) lands on your held item and you get a short bad-luck effect.
- ACTIONBAR: shows how many items were enchanted. RANKING: sidebar with the levels each player has gained.
- SLOTS: choose which slots roll (hotbar, main inventory, armor, offhand). Spectators never roll.

SETTINGS SCREEN (quick access)  <- this is the menu of this build
Type   /trigger sneak_menu   (or /function sneak_enchant:menu, or click [Open settings] in the welcome message).
A real screen opens with checkboxes and sliders for EVERY option, already showing what is set right now.
Press Apply to save. Buttons: Apply, Reset to defaults, Reset ranking, Close.
There is no chat panel in this build: the quick access screen is the only menu.
Opening it is free for everybody; Apply and the reset buttons need operator permissions (cheats on in singleplayer).

NO G KEY (on purpose)
Minecraft only lets the G key (Quick Actions) open a dialog that is a real data pack file, and ANY data pack that
contains a dialog file makes Minecraft show the "Experimental Settings" warning every time you open the world.
So this pack has no G-key entry and no dialog file: the screen is an inline dialog opened with /trigger sneak_menu.

CONFIG  (operators)
Show the config:        /function sneak_enchant:config
Change a value:         /scoreboard players set <n> sneak_cfg <value>
Reset to defaults:      /function sneak_enchant:defaults
Reset the ranking:      /function sneak_enchant:reset_ranking

  #enabled         1    1 = on, 0 = off
  #cooldown        0    ticks between rolls per player (20 = 1 second, 0 = none)
  #rolls           1    random enchants rolled on every slot per crouch (1-10)
  #curses          1    1 = curses can roll, 0 = curses never roll
  #jackpot         0    % chance of a JACKPOT per crouch (0 = never)
  #jackpot_levels  5    levels a jackpot adds to the held item (1-50)
  #backfire        0    % chance of a BACKFIRE per crouch (0 = never)
  #actionbar       0    1 = show the actionbar messages
  #announce        1    1 = tell everyone about jackpots and backfires
  #ranking         0    1 = show the levels ranking in the sidebar
  #effects         1    1 = play sounds and particles
  #hotbar          1    1 = the hotbar slots get enchants
  #inventory       1    1 = the main inventory slots get enchants
  #armor           1    1 = worn armor gets enchants
  #offhand         1    1 = the offhand gets enchants

Example: /scoreboard players set #cooldown sneak_cfg 100
Tip: many players crouching in the same tick with #rolls set very high can hit Minecraft's command chain limit
(/gamerule maxCommandChainLength); raise it if you ever see rolls getting cut short.

Builds: 1.17.x-1.19.x | 1.20.x-1.21.5 | 1.21.6-1.21.8 | 1.21.9-26.2 | 26.3. Use the one that matches your Minecraft
version (they are separate because Mojang changed the pack format rules).
Installing over 1.3.1: delete the old SneakEnchant-1_3_1 zip from the world's datapacks folder first. Your settings are kept.

CHANGES IN 2.0
- Renamed to 2.0.
- NEW: settings screen (quick access) opened with /trigger sneak_menu. Opening the menu no longer shows a chat panel in this build.
- FIXED: the "Experimental Settings" warning when opening the world (1.21.6+). It came from the dialog file used for
  the G key; that file is gone and the screen is opened with /trigger sneak_menu instead (no G key).
- FIXED: the settings screen used to open showing the DEFAULTS, so pressing Apply could silently overwrite your real
  settings. It now opens with the current values.
- FIXED: slider values arriving as decimals could make Apply fail; values are now read safely and clamped to their range.
- FIXED: a setting outside the slider range (set by command) stopped the settings screen from opening.
- FIXED: the reset buttons of the screen gave no feedback; they now tell you and reopen the screen.
