Code Monkey home page Code Monkey logo

diamonddude986's Projects

mcpecustomblocks.js icon mcpecustomblocks.js

function newLevel(){ ModPE.defineBlock(25, "Jukebox", [74, 75, 74, 74, 74, 74], false, 0); // [바닥, 위, 나머지 둘레] } function useItem(x, y, z, item, block, side, itemData, blockData){ var pos = getSide(x, y, z, side); if(item == 25){ setTile(pos[0], pos[1], pos[2], 25, 0); removeItemInventory(25, 0, 1); } } function destroyBlock(x, y, z, side){ if(getTile(x, y, z) == 25) Level.dropItem(x, y, z, 0, 25, 1, 0); } function getSide(x, y, z, side){ var pos = []; switch(side){ case 0: pos = [x, y - 1, z]; // 아래쪽 break; case 1: pos = [x, y + 1, z]; // 위쪽 break; case 2: pos = [x, y, z - 1]; // 남쪽 break; case 3: pos = [x, y, z + 1]; // 북쪽 break; case 4: pos = [x - 1, y, z]; // 동쪽 break; case 5: pos = [x + 1, y, z]; // 서쪽 break; } return pos; } function removeItemInventory(id, damage, count){ for(var i = 9; i <= 44; i++){ if(Player.getInventorySlot(i) == id && Player.getInventorySlotData(i) == damage){ var c = (Player.getInventorySlotCount(i) - count); Player.clearInventorySlot(i); if(c > 0){ addItemInventory(id, c, damage); return; }else if(c < 0){ count = parseInt(c); }else return; } } }

pocketmine-mp icon pocketmine-mp

PocketMine-MP is a server software for Minecraft: Pocket Edition. It has a Plugin API that enables a developer to extend it and add new features, or change default ones

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.