select_item.mcfunction 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # TODO: [HIM] 二分分拆 select_item 函数,以优化性能(顺便补一点使用这套东西的注释)
  2. execute if score @s temp matches 0 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:0b}]
  3. execute if score @s temp matches 1 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:1b}]
  4. execute if score @s temp matches 2 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:2b}]
  5. execute if score @s temp matches 3 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:3b}]
  6. execute if score @s temp matches 4 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:4b}]
  7. execute if score @s temp matches 5 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:5b}]
  8. execute if score @s temp matches 6 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:6b}]
  9. execute if score @s temp matches 7 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:7b}]
  10. execute if score @s temp matches 8 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:8b}]
  11. execute if score @s temp matches 9 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:9b}]
  12. execute if score @s temp matches 10 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:10b}]
  13. execute if score @s temp matches 11 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:11b}]
  14. execute if score @s temp matches 12 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:12b}]
  15. execute if score @s temp matches 13 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:13b}]
  16. execute if score @s temp matches 14 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:14b}]
  17. execute if score @s temp matches 15 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:15b}]
  18. execute if score @s temp matches 16 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:16b}]
  19. execute if score @s temp matches 17 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:17b}]
  20. execute if score @s temp matches 18 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:18b}]
  21. execute if score @s temp matches 19 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:19b}]
  22. execute if score @s temp matches 20 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:20b}]
  23. execute if score @s temp matches 21 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:21b}]
  24. execute if score @s temp matches 22 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:22b}]
  25. execute if score @s temp matches 23 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:23b}]
  26. execute if score @s temp matches 24 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:24b}]
  27. execute if score @s temp matches 25 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:25b}]
  28. execute if score @s temp matches 26 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:26b}]
  29. execute if score @s temp matches 27 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:27b}]
  30. execute if score @s temp matches 28 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:28b}]
  31. execute if score @s temp matches 29 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:29b}]
  32. execute if score @s temp matches 30 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:30b}]
  33. execute if score @s temp matches 31 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:31b}]
  34. execute if score @s temp matches 32 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:32b}]
  35. execute if score @s temp matches 33 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:33b}]
  36. execute if score @s temp matches 34 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:34b}]
  37. execute if score @s temp matches 35 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:35b}]
  38. execute if score @s temp matches 100 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:100b}]
  39. execute if score @s temp matches 101 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:101b}]
  40. execute if score @s temp matches 102 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:102b}]
  41. execute if score @s temp matches 103 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:103b}]
  42. execute if score @s temp matches -106 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:-106b}]
  43. execute if score @s temp matches 0 run item entity @s hotbar.0 replace air
  44. execute if score @s temp matches 1 run item entity @s hotbar.1 replace air
  45. execute if score @s temp matches 2 run item entity @s hotbar.2 replace air
  46. execute if score @s temp matches 3 run item entity @s hotbar.3 replace air
  47. execute if score @s temp matches 4 run item entity @s hotbar.4 replace air
  48. execute if score @s temp matches 5 run item entity @s hotbar.5 replace air
  49. execute if score @s temp matches 6 run item entity @s hotbar.6 replace air
  50. execute if score @s temp matches 7 run item entity @s hotbar.7 replace air
  51. execute if score @s temp matches 8 run item entity @s hotbar.8 replace air
  52. execute if score @s temp matches 9 run item entity @s inventory.0 replace air
  53. execute if score @s temp matches 10 run item entity @s inventory.1 replace air
  54. execute if score @s temp matches 11 run item entity @s inventory.2 replace air
  55. execute if score @s temp matches 12 run item entity @s inventory.3 replace air
  56. execute if score @s temp matches 13 run item entity @s inventory.4 replace air
  57. execute if score @s temp matches 14 run item entity @s inventory.5 replace air
  58. execute if score @s temp matches 15 run item entity @s inventory.6 replace air
  59. execute if score @s temp matches 16 run item entity @s inventory.7 replace air
  60. execute if score @s temp matches 17 run item entity @s inventory.8 replace air
  61. execute if score @s temp matches 18 run item entity @s inventory.9 replace air
  62. execute if score @s temp matches 19 run item entity @s inventory.10 replace air
  63. execute if score @s temp matches 20 run item entity @s inventory.11 replace air
  64. execute if score @s temp matches 21 run item entity @s inventory.12 replace air
  65. execute if score @s temp matches 22 run item entity @s inventory.13 replace air
  66. execute if score @s temp matches 23 run item entity @s inventory.14 replace air
  67. execute if score @s temp matches 24 run item entity @s inventory.15 replace air
  68. execute if score @s temp matches 25 run item entity @s inventory.16 replace air
  69. execute if score @s temp matches 26 run item entity @s inventory.17 replace air
  70. execute if score @s temp matches 27 run item entity @s inventory.18 replace air
  71. execute if score @s temp matches 28 run item entity @s inventory.19 replace air
  72. execute if score @s temp matches 29 run item entity @s inventory.20 replace air
  73. execute if score @s temp matches 30 run item entity @s inventory.21 replace air
  74. execute if score @s temp matches 31 run item entity @s inventory.22 replace air
  75. execute if score @s temp matches 32 run item entity @s inventory.23 replace air
  76. execute if score @s temp matches 33 run item entity @s inventory.24 replace air
  77. execute if score @s temp matches 34 run item entity @s inventory.25 replace air
  78. execute if score @s temp matches 35 run item entity @s inventory.26 replace air
  79. execute if score @s temp matches 100 run item entity @s armor.feet replace air
  80. execute if score @s temp matches 101 run item entity @s armor.legs replace air
  81. execute if score @s temp matches 102 run item entity @s armor.chest replace air
  82. execute if score @s temp matches 103 run item entity @s armor.head replace air
  83. execute if score @s temp matches -106 run item entity @s weapon.offhand replace air
  84. # scoreboard players reset @s temp