7 lines
14 KiB
JSON
7 lines
14 KiB
JSON
{
|
|
"_fv": 6,
|
|
"_type": "procedure",
|
|
"definition": {
|
|
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable type=\"Boolean\" id=\"detect_coffre\">detect_coffre</variable><variable type=\"Number\" id=\"test_x\">test_x</variable><variable type=\"Number\" id=\"text_z\">text_z</variable><variable type=\"Number\" id=\"xx\">xx</variable><variable type=\"Number\" id=\"yy\">yy</variable><variable type=\"Number\" id=\"zz\">zz</variable><variable type=\"Number\" id=\"NumCoffre\">NumCoffre</variable></variables><block type=\"event_trigger\" deletable=\"false\" x=\"345\" y=\"102\"><field name=\"trigger\">No additional trigger</field><next><block type=\"controls_if\"><value name=\"IF0\"><block type=\"logic_binary_ops\" inline=\"false\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"logic_binary_ops\" inline=\"false\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"math_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"math_dual_ops\"><field name=\"OP\">MOD</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"entity_pos_x\"/></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><value name=\"B\"><block type=\"math_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"math_dual_ops\"><field name=\"OP\">MOD</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"entity_pos_z\"/></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value></block></value><value name=\"B\"><block type=\"logic_binary_ops\" inline=\"false\"><field name=\"OP\">OR</field><value name=\"A\"><block type=\"math_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"math_dual_ops\"><field name=\"OP\">MOD</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"entity_pos_x\"/></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value><value name=\"B\"><block type=\"math_binary_ops\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"math_dual_ops\"><field name=\"OP\">MOD</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"entity_pos_z\"/></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value></block></value></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_number\"><field name=\"VAR\">local:NumCoffre</field><value name=\"VAL\"><block type=\"math_number\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set_number\"><field name=\"VAR\">local:test_x</field><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"entity_pos_x\"/></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><next><block type=\"variables_set_number\"><field name=\"VAR\">local:text_z</field><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"entity_pos_z\"/></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><next><block type=\"entity_send_chat\"><value name=\"text\"><block type=\"text_join\"><mutation items=\"4\"/><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">X: </field></block></value><value name=\"ADD1\"><block type=\"variables_get_number\"><field name=\"VAR\">local:test_x</field></block></value><value name=\"ADD2\"><block type=\"text\"><field name=\"TEXT\"> Z: </field></block></value><value name=\"ADD3\"><block type=\"variables_get_number\"><field name=\"VAR\">local:text_z</field></block></value></block></value><value name=\"actbar\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"variables_set_number\"><field name=\"VAR\">local:zz</field><comment pinned=\"false\" h=\"54\" w=\"149\">Sets number variable for the X coordinates.</comment><value name=\"VAL\"><block type=\"variables_get_number\"><field name=\"VAR\">local:text_z</field></block></value><next><block type=\"variables_set_logic\"><field name=\"VAR\">local:detect_coffre</field><comment pinned=\"false\" h=\"65\" w=\"145\">sets a variable to false before the system starts the test.</comment><value name=\"VAL\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"controls_repeat_ext\"><value name=\"TIMES\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value><statement name=\"DO\"><block type=\"variables_set_number\"><field name=\"VAR\">local:yy</field><comment pinned=\"false\" h=\"53\" w=\"142\">Sets number variable for the Y coordinates.</comment><value name=\"VAL\"><block type=\"math_number\"><field name=\"NUM\">2</field></block></value><next><block type=\"controls_repeat_ext\"><value name=\"TIMES\"><block type=\"math_number\"><field name=\"NUM\">254</field></block></value><statement name=\"DO\"><block type=\"variables_set_number\"><field name=\"VAR\">local:xx</field><comment pinned=\"false\" h=\"51\" w=\"144\">Sets number variable for the Z coordinates.</comment><value name=\"VAL\"><block type=\"variables_get_number\"><field name=\"VAR\">local:test_x</field></block></value><next><block type=\"controls_repeat_ext\"><value name=\"TIMES\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value><statement name=\"DO\"><block type=\"controls_if\"><value name=\"IF0\"><block type=\"compare_mcblocks\" inline=\"false\"><comment pinned=\"false\" h=\"53\" w=\"157\">Checks for a block at the current variable location.</comment><value name=\"a\"><block type=\"world_data_blockat\" inline=\"false\"><value name=\"x\"><block type=\"variables_get_number\"><field name=\"VAR\">local:xx</field></block></value><value name=\"y\"><block type=\"variables_get_number\"><field name=\"VAR\">local:yy</field></block></value><value name=\"z\"><block type=\"variables_get_number\"><field name=\"VAR\">local:zz</field></block></value></block></value><value name=\"b\"><block type=\"mcitem_allblocks\"><field name=\"value\">Blocks.CHEST</field></block></value></block></value><statement name=\"DO0\"><block type=\"variables_set_logic\"><field name=\"VAR\">local:detect_coffre</field><comment pinned=\"false\" h=\"67\" w=\"160\">If the block is found, the variable that was set to false will be set to true.</comment><value name=\"VAL\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"variables_set_number\"><field name=\"VAR\">local:NumCoffre</field><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get_number\"><field name=\"VAR\">local:NumCoffre</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></next></block></statement><next><block type=\"variables_set_number\"><field name=\"VAR\">local:xx</field><comment pinned=\"false\" h=\"67\" w=\"165\">If no block is found, it will increase the variable Z coordinate by 1.</comment><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get_number\"><field name=\"VAR\">local:xx</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></next></block></statement><next><block type=\"variables_set_number\"><field name=\"VAR\">local:yy</field><comment pinned=\"false\" h=\"67\" w=\"165\">If no block is found, it will increase the variable Y coordinate by 1.</comment><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get_number\"><field name=\"VAR\">local:yy</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></next></block></next></block></statement><next><block type=\"variables_set_number\"><field name=\"VAR\">local:zz</field><comment pinned=\"false\" h=\"68\" w=\"160\">If no block is found, it will increase the variable X coordinate by 1.</comment><value name=\"VAL\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get_number\"><field name=\"VAR\">local:zz</field></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">1</field></block></value></block></value></block></next></block></next></block></statement><next><block type=\"controls_if\"><mutation else=\"1\"/><comment pinned=\"false\" h=\"68\" w=\"178\">In the \"do\" section, you can add whatever you want it to do if it finds the block.</comment><value name=\"IF0\"><block type=\"logic_binary_ops\"><field name=\"OP\">EQ</field><comment pinned=\"false\" h=\"52\" w=\"156\">Tests if the variable is true.</comment><value name=\"A\"><block type=\"variables_get_logic\"><field name=\"VAR\">local:detect_coffre</field></block></value><value name=\"B\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value></block></value><statement name=\"DO0\"><block type=\"entity_send_chat\"><value name=\"text\"><block type=\"text_join\"><mutation items=\"2\"/><value name=\"ADD0\"><block type=\"text\"><field name=\"TEXT\">Coffre : </field></block></value><value name=\"ADD1\"><block type=\"variables_get_number\"><field name=\"VAR\">local:NumCoffre</field></block></value></block></value><value name=\"actbar\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement><statement name=\"ELSE\"><block type=\"entity_send_chat\"><value name=\"text\"><block type=\"text\"><field name=\"TEXT\">Pas Coffre</field></block></value><value name=\"actbar\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block><block type=\"controls_if\" x=\"2480\" y=\"179\"><comment pinned=\"false\" h=\"86\" w=\"233\">This example will test if the entity is holding a specific item. If it is true, then it will give the entity a level 2 status effect of speed for 3 seconds.</comment><value name=\"IF0\"><block type=\"compare_mcitems\"><value name=\"a\"><block type=\"entity_iteminhand\"/></value><value name=\"b\"><block type=\"mcitem_all\"><field name=\"value\">Blocks.SAPLING#0</field></block></value></block></value><statement name=\"DO0\"><block type=\"block_add\"><value name=\"block\"><block type=\"mcitem_allblocks\"><field name=\"value\">Blocks.DIAMOND_BLOCK</field></block></value><value name=\"x\"><block type=\"math_dual_ops\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUND</field><value name=\"NUM\"><block type=\"entity_pos_x\"/></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value><value name=\"y\"><block type=\"math_dual_ops\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"entity_pos_y\"/></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">2</field></block></value></block></value><value name=\"z\"><block type=\"math_dual_ops\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUNDDOWN</field><value name=\"NUM\"><block type=\"math_dual_ops\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"math_singular_ops\"><field name=\"OP\">ROUND</field><value name=\"NUM\"><block type=\"entity_pos_z\"/></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value></block></value><value name=\"B\"><block type=\"math_number\"><field name=\"NUM\">16</field></block></value></block></value></block></statement></block></xml>"
|
|
}
|
|
} |