Skip to content

Instantly share code, notes, and snippets.

@Tsa6
Last active January 1, 2016 20:29
Show Gist options
  • Save Tsa6/8197687 to your computer and use it in GitHub Desktop.
Save Tsa6/8197687 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: Fancy;
src: url('http://themes.googleusercontent.com/static/fonts/newrocker/v1/WxdbiEM9pvmAfOzkEv7pc73hpw3pgy2gAi-Ip7WPMi0.woff');
}
body {
background-color: lightgreen;
font-family:'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding: 100px;
font-size: 13px;
}
h1 {
text-align: center;
font-family: Fancy;
font-size: 400%
}
</style>
</head>
<body>
<h1> Firework Generator </h1>
Give as an item? <input type=checkbox id='ItemCheck' onClick='makeCommand()'> <br>
Infinite use? (Forces Item Mode) <input type=checkbox id='InfiniteCheck' onClick='makeCommand()'>
<br>
<input type='button' value='Make New' onClick='makeCommand()'> <input type='button' value='How to Use' onClick='info()'>
<p>
<br>
<br>
</p>
<p>Your command is...
<br>
<br>
</p>
<p id='command'>Loading...</p>
<img src='http://i.imgur.com/CA2jGUb.png' align=right>
<script>
function info(){
alert("Type this command into a command block and power it to spawn the firework. If you don't know how to get a command block, in a creative world, or world with cheats on, type '/give @p command_block'.")
}
function makeCommand() {
explosions = '';
if (document.getElementById('InfiniteCheck').checked) {
command = '/summon Item ~ ~1 ~ {Item:{';
} else if(document.getElementById('ItemCheck').checked){
command = '/give @p 401 1 0 ';
} else{
command = '/summon FireworksRocketEntity ~ ~1 ~ {LifeTime:' + (Math.round(Math.random() * 65) + 10) + ',FireworksItem:{id:401,';
}
command += 'tag:{display:{Name:Random Firework,Lore:["Made using Tsa6\'s Firework Genorator"]},Fireworks:{Flight:' + (Math.round(Math.random() * 2) + 1) + ',Explosions:[';
for (var i = 0; i < Math.round(Math.random() * 3) + 1; i++) {
explosions += '{';
explosions += 'Flicker:' + Math.round(Math.random());
explosions += ',Trail:' + Math.round(Math.random());
explosions += ',Type:' + Math.round(Math.random() * 4);
explosions += ',Colors:[';
explosions += Math.round(Math.random() * 255) + 256 * Math.round(Math.random() * 255) + 65536 * Math.round(Math.random() * 255);
explosions += ']';
if (Math.round(Math.random()) === 1) {
explosions += ',FadeColors:[';
explosions += Math.round(Math.random() * 255) + 256 * Math.round(Math.random() * 255) + 65536 * Math.round(Math.random() * 255);
explosions += ']';
}
explosions += '},';
}
command += explosions;
command += ']}}';
if (!document.getElementById('ItemCheck').checked && !document.getElementById('InfiniteCheck').checked) {
command += '}}';
} else if(document.getElementById('InfiniteCheck').checked){
command += ',Count:-1,id:401}}'
}
document.getElementById('command').innerHTML = command;
}
makeCommand();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment