Created
November 25, 2016 20:05
-
-
Save kane-thornwyrd/8b6ee91b8833d541f59082dd36c36a18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $spawn = 8 255 8 | |
var $altarAS = @e[type=ArmorStand,name=initAltar,tag=magitekchronicles] | |
var $trueAltarAS = @e[type=ArmorStand,name=Altar,tag=magitekchronicles] | |
var $naturalSpawnAS = @e[type=ArmorStand,name=naturalSpawn,tag=magitekchronicles] | |
var $trueSpawnAS = @e[type=ArmorStand,name=trueSpawn,tag=magitekchronicles] | |
var $newPlayerNear = @p[score_villagerTalk=0,r=5] | |
var $oldPlayerNear = @p[score_villagerTalk_min=1,r=10] | |
//=========================================================================== | |
// Functions tools | |
def ^giveSpecialAS( $name ): | |
give @p armor_stand 1 0 | |
{EntityTag:{ | |
CustomName:$name,NoGravity:1b,Invisible:1b,CustomNameVisible:0b, | |
Tags:["magitekchronicles"] | |
},display:{Name:$name},ench:[]} | |
def ^delay( $delay ; $coord = ~-1 ~ ~ ): | |
c!: summon AreaEffectCloud $coord {Tags:[nTicksLater], Age: ( 0 - $delay + 1 )} | |
//=========================================================================== | |
// Function Init | |
def ^init(): | |
kill @e[tag=magitekchronicles] | |
scoreboard players set @p villagerTalk 0 | |
scoreboard objectives add villagerTalk stat.talkedToVillager | |
gamerule logAdminCommands false | |
gamerule commandBlockOutput false | |
setworldspawn $spawn | |
summon ArmorStand $spawn {CustomName:naturalSpawn,NoGravity:1b,Invisible:1b,CustomNameVisible:0b,Tags:["magitekchronicles"]} | |
gamerule spawnRadius 0 | |
execute @a ~ ~ ~ hqm quest | |
// Function Scenario | |
def ^intro(): | |
?: execute $naturalSpawnAS ~ ~ ~ effect $newPlayerNear minecraft:blindness 15 255 | |
?: execute $naturalSpawnAS ~ ~ ~ effect $newPlayerNear minecraft:slowness 15 255 | |
?: execute $naturalSpawnAS ~ ~ ~ title $newPlayerNear title ["", | |
{"text":"Magitek Chronicles","color":"dark_purple","bold":true}] | |
?: execute $naturalSpawnAS ~ ~ ~ title $newPlayerNear subtitle ["", | |
{"text":"Magitek Chronicles","color":"dark_green","obfuscated":true}] | |
?: execute $naturalSpawnAS ~ ~ ~ tellraw $newPlayerNear ["", | |
{"text":"<","color":"white"},{"text":"Magitek","color":"gold"},{"text":">","color":"white"}, | |
{"text":" I saved you from the carnage.","italic":true,"color":"none"}] | |
?: execute $naturalSpawnAS ~ ~ ~ tellraw $newPlayerNear ["", | |
{"text":"<","color":"white"},{"text":"Magitek","color":"gold"},{"text":">","color":"white"}, | |
{"text":" I can help you... Take my Tome of Knowledge !","italic":true,"color":"none"}] | |
?: execute $naturalSpawnAS ~ ~ ~ tp $newPlayerNear $altarAS | |
def ^deal(): | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~0.4 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~0.3 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~0.2 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~0.1 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~ ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~-0.1 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~-0.2 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~-0.3 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ particle enchantmenttable ~-0.4 ~2 ~ 0 1 0 0 3 | |
?: execute $trueAltarAS ~ ~ ~ playsound minecraft:entity.elder_guardian.ambient voice $newPlayerNear | |
//=========================================================================== | |
^init() | |
^giveSpecialAS( initAltar ) | |
^giveSpecialAS( trueSpawn ) | |
^giveSpecialAS( Altar ) | |
// Delay framework | |
chain ~ ~-1 ~, -x: | |
r: testfor @e[tag=nTicksLater] {Age:-1} | |
?: execute @e[tag=nTicksLater] ~ ~ ~ blockdata ~ ~ ~ {auto:1b} | |
?: execute @e[tag=nTicksLater] ~ ~ ~ blockdata ~ ~ ~ {auto:0b} | |
// Scenario start | |
chain ~ ~-1 ~1, -x: | |
r: execute $naturalSpawnAS ~ ~ ~ testfor $newPlayerNear: | |
^intro() | |
chain ~ ~-1 ~2, -x: | |
r: execute $trueAltarAS ~ ~ ~ testfor $newPlayerNear: | |
^deal() | |
//chain ~ ~-1 ~2, -x: | |
// i!: say hi | |
// ^delay(50) | |
// i0:say "world" | |
// Normal Respawn | |
chain ~ ~-1 ~3, -x: | |
r: execute $naturalSpawnAS ~ ~ ~ testfor $oldPlayerNear | |
?: execute $naturalSpawnAS ~ ~ ~ effect $oldPlayerNear minecraft:nausea 15 255 | |
?: execute $naturalSpawnAS ~ ~ ~ effect $oldPlayerNear minecraft:nausea 15 255 | |
?: execute $naturalSpawnAS ~ ~ ~ effect $oldPlayerNear minecraft:blindness 15 255 | |
?: execute $naturalSpawnAS ~ ~ ~ give $oldPlayerNear hardcorequesting:quest_book 1 {display:{Name:"Magitek Tome"},ench:[],Glowing:1,CustomName:"Magitek Tome"} | |
?: execute $naturalSpawnAS ~ ~ ~ tp $oldPlayerNear $trueSpawnAS | |
chain ~ ~-1 ~4, -x: | |
i0: say Initialization: | |
execute $trueAltarAS ~ ~ ~ summon Villager ~ ~ ~ { | |
Offers:{Recipes:[]},NoAI:1,Silent:1, | |
Tags:["magitekchronicles"], | |
Invulnerable:1b, NoGravity: 1b, | |
ActiveEffects:[{ | |
Id: 14, | |
Duration: 35555, ShowParticles: 0b | |
}]} | |
execute $trueAltarAS ~ ~ ~ setblock ~ ~ ~ props:blockProps 0 replace {BlockType:539} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment