minecraftcommandapi
Version:
An API, which provides functions to generate Minecraft Commands
1 lines • 11.2 kB
JavaScript
var mcapi=function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var o=n(1);e.SummonCommand=o.SummonCommand,e.Achievement=o.Achievement,e.AchievementCommand=o.AchievementCommand,e.AchievementCommandFrom=o.AchievementCommandFrom,e.AchievementCommandTo=o.AchievementCommandTo,e.AchievementCommandCommand=o.AchievementCommandCommand;var i=n(24);e.Zombie=i.Zombie;var r=n(4);e.Position=r.Position,e.PositionType=r.PositionType,e.Version=r.Version},function(t,e,n){"use strict";var o=n(2);e.SummonCommand=o.SummonCommand;var i=n(18);e.Achievement=i.Achievement,e.AchievementCommand=i.AchievementCommand,e.AchievementCommandCommand=i.AchievementCommandCommand,e.AchievementCommandFrom=i.AchievementCommandFrom,e.AchievementCommandTo=i.AchievementCommandTo},function(t,e,n){"use strict";var o=n(3);e.SummonCommand=o.SummonCommand},function(t,e,n){"use strict";var o=n(4),i=function(){function t(t,e){this.entity=t,this.position=e}return Object.defineProperty(t.prototype,"Command",{get:function(){var t="/summon "+this.entity.Id;return t+=void 0!=this.position?this.position.Type==o.PositionType.Absolute?" "+this.position.X+" "+this.position.Y+" "+this.position.Z:" ~"+this.position.X+" ~"+this.position.Y+" ~"+this.position.Z:" ~ ~ ~",""!=this.entity.Command&&(t+=" "+this.entity.Command),t},enumerable:!0,configurable:!0}),t}();e.SummonCommand=i},function(t,e,n){"use strict";var o=n(5);e.EntityTag=o.EntityTag,e.Entity=o.Entity,e.EntityTagData=o.EntityTagData;var i=n(9);e.MobTag=i.MobTag,e.Mob=i.Mob,e.MobTagData=i.MobTagData;var r=n(13);e.Position=r.Position,e.PositionType=r.PositionType;var a=n(16);e.Version=a.Version},function(t,e,n){"use strict";var o=n(6);e.Entity=o.Entity;var i=n(7);e.EntityTag=i.EntityTag;var r=n(8);e.EntityTagData=r.EntityTagData},function(t,e,n){"use strict";var o=n(4),i=function(){function t(t,e){this.id=t,this.entityTag=e||new o.EntityTag}return Object.defineProperty(t.prototype,"Id",{get:function(){return this.id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Tag",{get:function(){return this.entityTag},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Command",{get:function(){var t=JSON.stringify(this.entityTag.Data).replace(/\"([^(\")"]+)\":/g,"$1:");return"{}"!=t?t:""},enumerable:!0,configurable:!0}),t}();e.Entity=i},function(t,e,n){"use strict";var o=n(5),i=function(){function t(){this.data=new o.EntityTagData}return Object.defineProperty(t.prototype,"UUIDLeast",{get:function(){return this.data.UUIDLeast},set:function(t){this.data.UUIDLeast=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UUIDMost",{get:function(){return this.data.UUIDMost},set:function(t){this.data.UUIDMost=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Invulnerable",{get:function(){return this.data.Invulnerable},set:function(t){this.data.Invulnerable=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NoAI",{get:function(){return this.data.NoAI},set:function(t){this.data.NoAI=t},enumerable:!0,configurable:!0}),t.prototype.AddPassenger=function(t){void 0==this.data.Passengers&&(this.data.Passengers=new Array);var e=t.Tag.Data;e.id=t.Id,this.data.Passengers.push(e)},Object.defineProperty(t.prototype,"Fire",{get:function(){return this.data.Fire},set:function(t){if(!(t>=-1&&t<=32767))throw new RangeError("Value must be between -1 and 32767");this.data.Fire=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NoGravity",{get:function(){return this.data.NoGravity},set:function(t){this.data.NoGravity=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Data",{get:function(){return this.data},enumerable:!0,configurable:!0}),t}();e.EntityTag=i},function(t,e){"use strict";var n=function(){function t(){}return t}();e.EntityTagData=n},function(t,e,n){"use strict";var o=n(10);e.Mob=o.Mob;var i=n(11);e.MobTag=i.MobTag;var r=n(12);e.MobTagData=r.MobTagData},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=function(t){function e(e,n){return t.call(this,e,n||new i.MobTag)||this}return o(e,t),Object.defineProperty(e.prototype,"Tag",{get:function(){return this.entityTag},enumerable:!0,configurable:!0}),e}(i.Entity);e.Mob=r},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=function(t){function e(){var e=t.apply(this,arguments)||this;return e.data=new i.MobTagData,e}return o(e,t),Object.defineProperty(e.prototype,"AttackTime",{get:function(){return this.data.AttackTime},set:function(t){this.data.AttackTime=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Data",{get:function(){return this.data},enumerable:!0,configurable:!0}),e}(i.EntityTag);e.MobTag=r},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(i.EntityTagData);e.MobTagData=r},function(t,e,n){"use strict";var o=n(14);e.PositionType=o.PositionType;var i=n(15);e.Position=i.Position},function(t,e){"use strict";var n;!function(t){t[t.Relative=0]="Relative",t[t.Absolute=1]="Absolute"}(n=e.PositionType||(e.PositionType={}))},function(t,e){"use strict";var n=function(){function t(t,e,n,o){this.x=t,this.y=e,this.z=n,this.type=o}return Object.defineProperty(t.prototype,"X",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Z",{get:function(){return this.z},set:function(t){this.z=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),t}();e.Position=n},function(t,e,n){"use strict";var o=n(17);e.Version=o.default},function(t,e){"use strict";var n=function(){function t(t,e){this.name=t,this.mcVersion=e}return Object.defineProperty(t.prototype,"Name",{get:function(){return this.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MCVersion",{get:function(){return this.mcVersion},enumerable:!0,configurable:!0}),t}();e.Version=n,Object.defineProperty(e,"__esModule",{value:!0}),e.default=new n("0.0.4","1.11")},function(t,e,n){"use strict";var o=n(19);e.Achievement=o.Achievement;var i=n(20);e.AchievementCommand=i.AchievementCommand;var r=n(21);e.AchievementCommandFrom=r.AchievementCommandFrom;var a=n(22);e.AchievementCommandTo=a.AchievementCommandTo;var c=n(23);e.AchievementCommandCommand=c.AchievementCommandCommand},function(t,e){"use strict";var n;!function(t){t[t.openInventory=0]="openInventory",t[t.mineWood=1]="mineWood",t[t.buildWorkBench=2]="buildWorkBench",t[t.buildPickaxe=3]="buildPickaxe",t[t.buildFurnace=4]="buildFurnace",t[t.acquireIron=5]="acquireIron",t[t.buildHoe=6]="buildHoe",t[t.makeBread=7]="makeBread",t[t.bakeCake=8]="bakeCake",t[t.buildBetterPickaxe=9]="buildBetterPickaxe",t[t.cookFish=10]="cookFish",t[t.onARail=11]="onARail",t[t.buildSword=12]="buildSword",t[t.killEnemy=13]="killEnemy",t[t.killCow=14]="killCow",t[t.flyPig=15]="flyPig",t[t.snipeSkeleton=16]="snipeSkeleton",t[t.diamonds=17]="diamonds",t[t.portal=18]="portal",t[t.ghast=19]="ghast",t[t.blazeRod=20]="blazeRod",t[t.potion=21]="potion",t[t.theEnd=22]="theEnd",t[t.theEnd2=23]="theEnd2",t[t.enchantments=24]="enchantments",t[t.overkill=25]="overkill",t[t.bookcase=26]="bookcase",t[t.exploreAllBiomes=27]="exploreAllBiomes",t[t.spawnWither=28]="spawnWither",t[t.killWither=29]="killWither",t[t.fullBeacon=30]="fullBeacon",t[t.breedCow=31]="breedCow",t[t.diamondsToYou=32]="diamondsToYou",t[t.overpowered=33]="overpowered",t[t.all=34]="all"}(n=e.Achievement||(e.Achievement={}))},function(t,e,n){"use strict";var o=n(18),i=function(){function t(){}return t.prototype.Give=function(t){return new o.AchievementCommandTo(t)},t.prototype.Take=function(t){return new o.AchievementCommandFrom(t)},t}();e.AchievementCommand=i},function(t,e,n){"use strict";var o=n(18),i=function(){function t(t){this.achievement=t}return t.prototype.From=function(t){return new o.AchievementCommandCommand(!1,this.achievement,t)},t}();e.AchievementCommandFrom=i},function(t,e,n){"use strict";var o=n(18),i=function(){function t(t){this.achievement=t}return t.prototype.To=function(t){return new o.AchievementCommandCommand(!0,this.achievement,t)},t}();e.AchievementCommandTo=i},function(t,e,n){"use strict";var o=n(18),i=function(){function t(t,e,n){this.isGiven=t,this.achievement=e,this.playerName=n}return t.prototype.GetAchievementName=function(t){return o.Achievement[t]},Object.defineProperty(t.prototype,"Command",{get:function(){var t="/achievement ";return t+=this.isGiven?"give ":"take ",t+=this.achievement==o.Achievement.all?"* ":"achievement."+this.GetAchievementName(this.achievement)+" ",t+=this.playerName},enumerable:!0,configurable:!0}),t}();e.AchievementCommandCommand=i},function(t,e,n){"use strict";var o=n(25);e.Zombie=o.Zombie},function(t,e,n){"use strict";var o=n(26);e.Zombie=o.Zombie;var i=n(27);e.ZombieTag=i.ZombieTag;var r=n(28);e.ZombieTagData=r.ZombieTagData},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=n(25),a=function(t){function e(){return t.call(this,"Zombie",new r.ZombieTag)||this}return o(e,t),Object.defineProperty(e.prototype,"Tag",{get:function(){return this.entityTag},enumerable:!0,configurable:!0}),e}(i.Mob);e.Zombie=a},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=n(25),a=function(t){function e(){var e=t.apply(this,arguments)||this;return e.data=new r.ZombieTagData,e}return o(e,t),Object.defineProperty(e.prototype,"CanBreakDoors",{get:function(){return this.data.CanBreakDoors},set:function(t){this.data.CanBreakDoors=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Data",{get:function(){return this.data},enumerable:!0,configurable:!0}),e}(i.MobTag);e.ZombieTag=a},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),r=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(i.MobTagData);e.ZombieTagData=r}]);