{"action":"created","issue":{"url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/482","labels_url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/482/comments","events_url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/482/events","html_url":"https://github.com/zhuowei/MCPELauncher/issues/482","id":125864572,"number":482,"title":"List of New Functions and Hooks","user":{"login":"MrLeons7","id":15315303,"avatar_url":"https://avatars.githubusercontent.com/u/15315303?v=3","gravatar_id":"","url":"https://api.github.com/users/MrLeons7","html_url":"https://github.com/MrLeons7","followers_url":"https://api.github.com/users/MrLeons7/followers","following_url":"https://api.github.com/users/MrLeons7/following{/other_user}","gists_url":"https://api.github.com/users/MrLeons7/gists{/gist_id}","starred_url":"https://api.github.com/users/MrLeons7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrLeons7/subscriptions","organizations_url":"https://api.github.com/users/MrLeons7/orgs","repos_url":"https://api.github.com/users/MrLeons7/repos","events_url":"https://api.github.com/users/MrLeons7/events{/privacy}","received_events_url":"https://api.github.com/users/MrLeons7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-11T02:52:48Z","updated_at":"2016-01-12T15:36:27Z","closed_at":null,"body":"I created a list of Functions and Hooks I wish existed in Mcpe:\r\n\r\n*Functions:\r\n-function createWorld(){ //code only works when the world is created\r\n-function Generate(){ //would be used to generate new structures to the world\r\n-function craftingItem(){ //something happens to craftar an item :)\r\n\r\n*Hooks:\r\n-Item.setSword(id,dmg,damage,durability,on); //on == power to charm and false or otherwise\r\n-Item.setPickase(id,dmg,damage,3,on);\r\n-Item.setShovel(id,dmg,damage,3,on);\r\n-Item.setAxe(id,dmg,damage,3,on);\r\n-Item.setBow(id,dmg,damage,3,on);\r\n-Item.setLightLevel(id,dmg,lightLevel);\r\n-Item.setFurnace\r\n-Block.definedOre(id,bla,bla,bla);\r\n-Block.definedChest(id,bla,bla,bla,);\r\n-Block.definedFurnace(id,dmg,Texture...,speed,);\r\n-Item.removeCraftingRecipe(id,dmg);//Remove alls recipes the Item\r\n-Entity.setCollisionType(ent,maxx,maxy,maxz);//isto define a colisão de uma entidade\r\n-Item.addFurnaceFuel(id,dmg,burnedtime);\r\n\r\nObs:\r\n*Weapons and Tools can look at something already exists as well:\r\nItem.setSword(id,dmg,id mirrored,on); Ex: Item.setSword(id,dmg,276);// work as a diamond sword\r\n\r\nI hope you enjoy, support to improve our MCPE :+1: "},"comment":{"url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/comments/170949317","html_url":"https://github.com/zhuowei/MCPELauncher/issues/482#issuecomment-170949317","issue_url":"https://api.github.com/repos/zhuowei/MCPELauncher/issues/482","id":170949317,"user":{"login":"DiegoGTRatty","id":13773620,"avatar_url":"https://avatars.githubusercontent.com/u/13773620?v=3","gravatar_id":"","url":"https://api.github.com/users/DiegoGTRatty","html_url":"https://github.com/DiegoGTRatty","followers_url":"https://api.github.com/users/DiegoGTRatty/followers","following_url":"https://api.github.com/users/DiegoGTRatty/following{/other_user}","gists_url":"https://api.github.com/users/DiegoGTRatty/gists{/gist_id}","starred_url":"https://api.github.com/users/DiegoGTRatty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiegoGTRatty/subscriptions","organizations_url":"https://api.github.com/users/DiegoGTRatty/orgs","repos_url":"https://api.github.com/users/DiegoGTRatty/repos","events_url":"https://api.github.com/users/DiegoGTRatty/events{/privacy}","received_events_url":"https://api.github.com/users/DiegoGTRatty/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T15:36:27Z","updated_at":"2016-01-12T15:36:27Z","body":"You can technically make function Generate() within your code.\r\n\r\nYou would need a few arrays to make it work though. With all of the info. related to the structure. \r\n\r\n```lelX = [x, x, x, x, x, x, x, x, x, x];\r\nlelY = [y, 70, 45, 90, 10, 25, 35, 15, 80, 110];\r\nlelZ = [Math.random()*500, 20, 30, 40, 50, 60, 70, 80, 90, 100];\r\nlelB = [51, 51, 49, 20, 51, 51, 51, 51, 51, 12];\r\nlelD = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\ndiamondB = [51, 51, 51, 51, 51, 51, 51, 51, 51, 51];\r\ndiamondD = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n\r\nfunction Generate(x, y, z, whichStructure) {\r\n    if (whichStructure == \"diamondz\") {\r\n        for (n = 0; n <= 10; n++) {\r\n            setTile (x, y+n, z, diamondB, diamondD); \r\n        }\r\n    }\r\n    if (whichStructure == \"lel\") {\r\n        for (n = 0; n <= 10; n++) {\r\n            setTile (lelX, lelY+n, lelZ, lelB, lelD); \r\n        }\r\n    }\r\n}\r\n```\r\n\r\nAlso, why Item.setLightLevel? \r\n"}}