|
| 1 | +# MACROPAD Hotkeys example: Minecraft Effects (Creative) for Bedrock Edition |
| 2 | + |
| 3 | +# NOTE: There appears to be a line length limit. Exceeding that limit appears |
| 4 | +# to result in silent failure. Therefore, the key sequences are split |
| 5 | +# across multiple lines. |
| 6 | + |
| 7 | +from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values |
| 8 | + |
| 9 | +# See https://minecraft.fandom.com/wiki/Effect |
| 10 | + |
| 11 | +DELAY_AFTER_SLASH = 0.80 # required so minecraft has time to bring up command screen |
| 12 | +DELAY_BEFORE_RETURN = 0.10 # give minecraft time to show all the keys pressed... |
| 13 | + |
| 14 | +app = { # REQUIRED dict, must be named 'app' |
| 15 | + 'name' : 'Minecraft PE (effect)', # Application name |
| 16 | + # |
| 17 | + # /effect <player: target> <effect: Effect> |
| 18 | + # [seconds: int] [amplifier: int] [hideParticles: Boolean] |
| 19 | + # |
| 20 | + 'macros' : [ # List of button macros... |
| 21 | + # COLOR LABEL KEY SEQUENCE |
| 22 | + # 1st row ---------- |
| 23 | + (0x002000, 'speed', [ |
| 24 | + '/', DELAY_AFTER_SLASH, |
| 25 | + 'effect @s speed 999999999 1 true', |
| 26 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 27 | + (0x002000, 'str', [ |
| 28 | + '/', DELAY_AFTER_SLASH, |
| 29 | + 'effect @s strength 999999999 1 true', |
| 30 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 31 | + (0x002000, 'haste', [ |
| 32 | + '/', DELAY_AFTER_SLASH, |
| 33 | + 'effect @s haste 999999999 1 true', |
| 34 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 35 | + # 2nd row ---------- |
| 36 | + (0x002000, 'jump', [ |
| 37 | + '/', DELAY_AFTER_SLASH, |
| 38 | + 'effect @s jump_boost 999999999 1 true', |
| 39 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 40 | + (0x000030, 'breath', [ |
| 41 | + '/', DELAY_AFTER_SLASH, |
| 42 | + 'effect @s water_breathing 999999999 0 true', |
| 43 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 44 | + (0x202020, 'darkv', [ |
| 45 | + '/', DELAY_AFTER_SLASH, |
| 46 | + 'effect @s night_vision 999999999 0 true', |
| 47 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 48 | + # 3rd row ---------- |
| 49 | + (0x300000, 'health', [ |
| 50 | + '/', DELAY_AFTER_SLASH, |
| 51 | + 'effect @s health_boost 999999999 4 true', |
| 52 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 53 | + (0x300000, 'regen', [ |
| 54 | + '/', DELAY_AFTER_SLASH, |
| 55 | + 'effect @s regeneration 999999999 4 true', |
| 56 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 57 | + (0x002000, 'absorb', [ |
| 58 | + '/', DELAY_AFTER_SLASH, |
| 59 | + 'effect @s absorption 999999999 3 true', |
| 60 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 61 | + # 4th row --------- |
| 62 | + (0x002000, 'resist', [ |
| 63 | + '/', DELAY_AFTER_SLASH, |
| 64 | + 'effect @s resistance 999999999 3 true', |
| 65 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 66 | + (0x101010, 'invis', [ |
| 67 | + '/', DELAY_AFTER_SLASH, |
| 68 | + 'effect @s invisibility 999999999 0 true', |
| 69 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 70 | + (0x300000, 'fire_r', [ |
| 71 | + '/', DELAY_AFTER_SLASH, |
| 72 | + 'effect @s fire_resistance 999999999 0 true', |
| 73 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 74 | + # Encoder button --- Remove all status effects.... |
| 75 | + (0x000000, '', [ |
| 76 | + '/', DELAY_AFTER_SLASH, |
| 77 | + 'effect @s clear', |
| 78 | + DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]), |
| 79 | + ] |
| 80 | +} |
0 commit comments