• check_circle Functions
  • 2,276 views, 1 today
  • 69 downloads, 0 today
  • 1
  • 1
gogoghouha's Avatar gogoghouha
Level 13 : Journeyman Mage
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
CompatibilityMinecraft 1.17
toMinecraft 1.18
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome