JonGamer16
Member

57 posts
2 reputation

IGN: JonGamer16
By JonGamer16 » over 2 years ago
Just a curious question, I wonder how you guys got the items to have a cooldown when you use them, and the elytra to only pop up when you jump off of something, and stuff like that. I think they would be cool to put in some of the maps I make to play with friends on. If you can't show me everything, I'd at least like to know how to do item cooldowns for different items. Thanks!







OjOrangeJuice
Member

52 posts
4 reputation

IGN: OjOrangeJuice
By OjOrangeJuice » over 2 years ago
Yeah it's actually very impressive that Ao did all this through command blocks! Gg to that and gj to Ao for spending so much time and work into this server, I'm happy it's here cause it is the only good 1.9 pvp server.







AoElite
Admin

651 posts
93 reputation

IGN: AoElite
By AoElite » over 2 years ago
It's complicated.





-AoElite

Ban appeal format link



JonGamer16
Member

57 posts
2 reputation

IGN: JonGamer16
By JonGamer16 » over 2 years ago
I can handle complicated. I've actually got some experience with command blocks, myself. I know most of the stuff probably has to do with scoreboards, but I've never been able to get the hang of them. I could possibly learn how the syntaxes and things work if you show me a few example commands, though- I catch on to stuff pretty quickly.







AoElite
Admin

651 posts
93 reputation

IGN: AoElite
By AoElite » over 2 years ago
It's complicated.





-AoElite

Ban appeal format link



JonGamer16
Member

57 posts
2 reputation

IGN: JonGamer16
By JonGamer16 » over 2 years ago
Is anyone else generous enough to show me how it all works?







AoElite
Admin

651 posts
93 reputation

IGN: AoElite
By AoElite » over 2 years ago
I doubt it





-AoElite

Ban appeal format link



JonGamer16
Member

57 posts
2 reputation

IGN: JonGamer16
By JonGamer16 » over 2 years ago
Well, guess there's always youtube...







AoElite
Admin

651 posts
93 reputation

IGN: AoElite
By AoElite » over 2 years ago
Yep





-AoElite

Ban appeal format link



shanewolf38
Member

5 posts
6 reputation

IGN: shanewolf38
By shanewolf38 » over 2 years ago
If you wanted to make a timing system for potions, here is a system with some explanations on how to do it. This is a system where a player can only have one potion at a time, and note that in this system every potion has the same regeneration time.

Objectives:
/scoreboard objectives add Potion stat.useItem.minecraft.splash_potion
/scoreboard objectives add Timer dummy

Commands:

1. /scoreboard players add @a[score_Potion=1] Timer 200
2. /execute @a[score_Potion=1] ~ ~ ~ scoreboard players operation @s Potion = @s Timer
3. /scoreboard players set @a[score_Potion_min=201,score_Timer_min=201] Timer 200
4. /scoreboard players remove @a[score_Potion_min=200,score_Timer_min=1] Timer 1
5. /give @a[score_Timer=0,score_Potion_min=201,score_Potion=201] splash_potion 1 0 {Potion:harming,Identifier:1}
6. /give @a[score_Timer=0,score_Potion_min=202,score_Potion=202] splash_potion 1 0 {Potion:poison,Identifier:2}
7. /scoreboard players reset @a[score_Potion_min=200,score_Timer=0] Potion
8. /scoreboard players set @a Timer 1 {SelectedItem:{id:"minecraft:splash_potion",tag:{Identifier:1}}}
9. /scoreboard players set @a Timer 2 {SelectedItem:{id:"minecraft:splash_potion",tag:{Identifier:2}}}

Explanation:

Examining the last two commands, number 8 and 9, they are really what start the system. They set the Timer score for the player, which in this case acts as an identifier. You may wonder what the "Identifier:#" tag is in the items, and that's a good question. It's actually a fake tag that I invented. Most people use the lore on an item to identify them, but I choose to use fake tags which don't appear when hovering over the item; they're completely hidden. So the one with an Identifier:1 is harming that is given to the player with /give and Identifier:2 is poison (refer to commands 5 and 6).

1. When a potion is thrown the Potion score gets set to 1, and this command adds 200 to the Timer score. This is important, since 200 is being added it also adds 200 to the identifier, so harming is now 201 and poison is 202.

2. Everyone who has just thrown a potion gets their Potion score set equal to their Timer score. This essentially makes the Potion score the identifier, and also makes it so Potion no longer equals 1, which makes sure the 1 command doesn't get run again.

3. This sets the Timer score of every player who just threw a potion (Timer_min=201} to 200.

4. This just counts down the Timer score for every player who is regenerating a potion (score_Potion_min=200)

5. This gives the harming potion back to a player with a score of Potion=201 (the harming identifier) and a Timer score of 0.

6. This gives the poison potion back to a player with a score of Potion=202 (the poison identifier) and a Timer score of 0.

7. This resets the Potion score of anyone who has just had their potion regenerated.

And that's basically it. Any number of potions can be added to it, and each one will increase the system by two commands.
If you wanted to make it so every potion had a different regeneration time, you'd have to add some more objectives and maybe some tags, and it would be more commands. If you wanted a system that could handle two potions, or three, etc., you'd need multiple timers and what not.

Also, to detect when a player is in the air, you can run
/scoreboard players tag @a add Air {OnGround:0b}
/scoreboard players tag @a[tag=Air] remove Air {OnGround:1b}

Here's a really helpful page which lists tags like these: http://minecraft.gamepedia.com/Chunk_format#Entity_Format

Hope this helps. :)