- check_circle Functions
Published Aug 23rd, 2021, 8/23/21 4:19 pm
- 2,276 views, 1 today
- 69 downloads, 0 today
0
This data pack provides a template of a for-loop,
which is implemented for the following example:
-- sulker box at block.pos=(x=0,y=200,z=0)
-- the for loop overide the items inside that shulker box:
---- for every instance of "i" in ["start", "finish"]:
---- a stack of carrots with an amount "i" is placed at slot "i" of that shulker box
the key minecraft features/functions that are used in this for-loop example:
-- '/scoreboard'
-- '/data modify storage'
-- '/data modify block'
-- '/execute store result' (!! underrated !!)
extensive explantions of the template are available inside the code
major limitations:
-- cannot modify(*1) player invertory the same manner:
---- player inventory not changeable via '/data modify' only '/item replace ... Inventory[3]' or 'Hotbar.8' available
---- with caveat that e.g.'Inventory[.]' not indexable by variable "i" in the for loop (or at least not with my current understanding)
(*1) can read and copy data though
to run the example: '/function for:for_a__setup '
then: '/function for:for_a__do'
to uninstall: '/function for:uninstall_for_a'
--- gogoghouha
which is implemented for the following example:
-- sulker box at block.pos=(x=0,y=200,z=0)
-- the for loop overide the items inside that shulker box:
---- for every instance of "i" in ["start", "finish"]:
---- a stack of carrots with an amount "i" is placed at slot "i" of that shulker box
the key minecraft features/functions that are used in this for-loop example:
-- '/scoreboard'
-- '/data modify storage'
-- '/data modify block'
-- '/execute store result' (!! underrated !!)
extensive explantions of the template are available inside the code
major limitations:
-- cannot modify(*1) player invertory the same manner:
---- player inventory not changeable via '/data modify' only '/item replace ... Inventory[3]' or 'Hotbar.8' available
---- with caveat that e.g.'Inventory[.]' not indexable by variable "i" in the for loop (or at least not with my current understanding)
(*1) can read and copy data though
to run the example: '/function for:for_a__setup '
then: '/function for:for_a__do'
to uninstall: '/function for:uninstall_for_a'
--- gogoghouha
Compatibility | Minecraft 1.17 |
to | Minecraft 1.18 |
Tags |
tools/tracking
5271043
119
forloop
Create an account or sign in to comment.