So I've got a project I'm working on. I want to have the player kill a boss, and get some of what he has. But I want it to be at full health. Right now, everytime the mob drops loot, I get loot that is in the red in the health bar. How can I fix this?
/summon Zombie ~ ~1 ~ {Equipment:[{Count:1,id:276,tag:{ display:{Name:A Thousand Whispers,Lore:[This was Rashe’s sword until you killed him],ench:[{id:16,lvl:3}]}}},{Count:1,id:305,tag:{ench:[{id:2,lvl:4}]}},{Count:1,id:304,tag:{ench:[{id:7,lvl:2}]}},{Count:1,id:303,tag:{ench:[{id:34,lvl:3}]}},{id:397,Damage:3,tag:{SkullOwner:jeb_}}],CustomName:Rashe,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:100},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:3},{Name:generic.followRange,Base:25}],DropChances:[1.0F,0.9F,0.7F,0.5F,0.0F]}
So I've got a project I'm working on. I want to have the player kill a boss, and get some of what he has. But I want it to be at full health. Right now, everytime the mob drops loot, I get loot that is in the red in the health bar. How can I fix this?
/summon Zombie ~ ~1 ~ {Equipment:[{Count:1,id:276,tag:{ display:{Name:A Thousand Whispers,Lore:[This was Rashe’s sword until you killed him],ench:[{id:16,lvl:3}]}}},{Count:1,id:305,tag:{ench:[{id:2,lvl:4}]}},{Count:1,id:304,tag:{ench:[{id:7,lvl:2}]}},{Count:1,id:303,tag:{ench:[{id:34,lvl:3}]}},{id:397,Damage:3,tag:{SkullOwner:jeb_}}],CustomName:Rashe,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:100},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:3},{Name:generic.followRange,Base:25}],DropChances:[1.0F,0.9F,0.7F,0.5F,0.0F]}
This is my current code.
Unfortunately I don't believe there is a way to define the durability of a tool dropped by a mob. Even when the damage is defined, the durability is randomized. The most I could suggest is to have multiple of the same item (increasing the Count to 3 or 4, possibly) to allow the player to repair it.
Other possibilities are to give the player the items after the boss has died via a chest or /give command, but that all depends on your boss fight.
dang it. Well, thanks anyways. How would I have it give you the item when the mob is dead? And can I use a command block to make it say stuff when it hits a certain amount of health?
dang it. Well, thanks anyways. How would I have it give you the item when the mob is dead? And can I use a command block to make it say stuff when it hits a certain amount of health?
You can track zombie kills with the "stat.killEntity.Zombie" objective-type, but this will only work if the only zombie in the arena is the boss. For example:
When a player kills a zombie, their "BOSSKILL" score increases by 1. In the /give command, the coordinates for the arena are listed to ensure that players haven't just gone out and killed a zombie not part of the battle. The second command block just sets the players' BOSSKILL score to 0 to prevent multiple firings.
If you need to include more /give commands, you could just add a repeater after the comparator, like so:
Just make sure that the /scoreboard command comes last.
With the above, you will need to make sure the clock only starts when the boss fight is started, as the mechanism will track every zombie kill made in the arena. To make sure that there are no zombies naturally spawned, I recommend turning off the "doMobSpawning" gamerule, as well as setting the game to peaceful and back to a higher difficulty before summoning the boss.
You should also set the players' "BOSSKILL" score to 0 before summoning the boss and starting the clock. You could also just not have the objective itself exist until the fight starts. This will ensure players don't try to kite a regular zombie into the arena and kill it to win the fight.
----
As far as detecting mob health goes, you cannot. You also cannot track the total damage dealt by users, only when they successfully deal damage. Smoke and mirrors can be used to make it seem like the player has taken off half the health of the mob, but that can become fairly complex.
You would essentially have to track the number of times the player hits the boss, but they can also just use their fists to increase that score. The "stat.useItem.276" can track when a diamond sword is used, which can be cross-referenced with the "stat.damageDealt" score to make sure the player is using a satisfactory weapon. You would also need to set this up for multiple people, since the scores would be shared and cannot be combined too easily.
If you'd still like to do something like that, I can help further.
yeah, that won't work because you can use different types of weapons.
Several mechanisms can be created to track each different type of weapon. The biggest issue, which will probably ensure this is useless, is that bow usage can't be tracked due to a bug, which can be viewed here: https://mojang.atlassian.net/browse/MC-31047
So I've got a project I'm working on. I want to have the player kill a boss, and get some of what he has. But I want it to be at full health. Right now, everytime the mob drops loot, I get loot that is in the red in the health bar. How can I fix this?
/summon Zombie ~ ~1 ~ {Equipment:[{Count:1,id:276,tag:{ display:{Name:A Thousand Whispers,Lore:[This was Rashe’s sword until you killed him],ench:[{id:16,lvl:3}]}}},{Count:1,id:305,tag:{ench:[{id:2,lvl:4}]}},{Count:1,id:304,tag:{ench:[{id:7,lvl:2}]}},{Count:1,id:303,tag:{ench:[{id:34,lvl:3}]}},{id:397,Damage:3,tag:{SkullOwner:jeb_}}],CustomName:Rashe,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:100},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:3},{Name:generic.followRange,Base:25}],DropChances:[1.0F,0.9F,0.7F,0.5F,0.0F]}
This is my current code.
You could give it the "Unbreakable" Tag and there would be no damage to it. The downside is that it cant break ever.
Rollback Post to RevisionRollBack
LIFE IS MORE THAN SURVIVAL! There is also Creative, Hardcore, and Adventure.
I use the killEntity score to check for boss deaths, and then open a door at the end so you can get the loot and leave only when the boss is dead. I just make sure the boss is the only entity of his type, and before the fight set the score back to 0 just in case you killed some of his 'kin' earlier and it somehow tracked it.
However, if you don't like this, another option is to "/clear" the item(s) from the players inventory shortly after the boss' death, like upon leaving the room. The output of that command will only read 'true' (aka power a redstone comparator) if it successfully clears the item(s) from the players inventory. If it does, you can then have it re-give the items to the player, names and lore and all, but at full health.
Another great thing about this is that you can have it, when it checks to see if it successfully cleared the item, also use that to see if you've killed the boss, which would allow you to have minions or custom minions of the same type as the boss.
That would be my solution, hope it helps! (:
[Edit] If you need help learning how to do this exactly, I would be glad to give you more detailed instructions. On an unrelated but slightly related note, I need to go learn why my custom sounds are suddenly all breaking even though I redid my resource pack to the new formats/names... >.>
So I've got a project I'm working on. I want to have the player kill a boss, and get some of what he has. But I want it to be at full health. Right now, everytime the mob drops loot, I get loot that is in the red in the health bar. How can I fix this?
/summon Zombie ~ ~1 ~ {Equipment:[{Count:1,id:276,tag:{ display:{Name:A Thousand Whispers,Lore:[This was Rashe’s sword until you killed him],ench:[{id:16,lvl:3}]}}},{Count:1,id:305,tag:{ench:[{id:2,lvl:4}]}},{Count:1,id:304,tag:{ench:[{id:7,lvl:2}]}},{Count:1,id:303,tag:{ench:[{id:34,lvl:3}]}},{id:397,Damage:3,tag:{SkullOwner:jeb_}}],CustomName:Rashe,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:100},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:3},{Name:generic.followRange,Base:25}],DropChances:[1.0F,0.9F,0.7F,0.5F,0.0F]}
This is my current code.
As of a recent discovery by FireArceus64, if you set the DropChances of an item any higher than 1.0, such as 1.1, the item the mob drops will retain the durability you set via the Damage tag (and no Damage tag means a fully-functional item).
If you set the DropChances of an item any higher than 1.0, such as 1.1, the item the mob drops will retain the durability you set via the Damage tag (and no Damage tag means a fully-functional item).
That doesn't really work in this case. Looking at the original command, it appears as though JMEL2012 wants a chance to drop some loot. Settling the drop chances to higher than 1.0f will guarantee a drop. So, if you want custom drop chances, you'll probably have to go with enchanting each item with Unbreaking.
/summon Zombie ~ ~1 ~ {Equipment:[{Count:1,id:276,tag:{ display:{Name:A Thousand Whispers,Lore:[This was Rashe’s sword until you killed him],ench:[{id:16,lvl:3}]}}},{Count:1,id:305,tag:{ench:[{id:2,lvl:4}]}},{Count:1,id:304,tag:{ench:[{id:7,lvl:2}]}},{Count:1,id:303,tag:{ench:[{id:34,lvl:3}]}},{id:397,Damage:3,tag:{SkullOwner:jeb_}}],CustomName:Rashe,CustomNameVisible:1,Attributes:[{Name:generic.maxHealth,Base:100},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:3},{Name:generic.followRange,Base:25}],DropChances:[1.0F,0.9F,0.7F,0.5F,0.0F]}
This is my current code.
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
Unfortunately I don't believe there is a way to define the durability of a tool dropped by a mob. Even when the damage is defined, the durability is randomized. The most I could suggest is to have multiple of the same item (increasing the Count to 3 or 4, possibly) to allow the player to repair it.
Other possibilities are to give the player the items after the boss has died via a chest or /give command, but that all depends on your boss fight.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
You can track zombie kills with the "stat.killEntity.Zombie" objective-type, but this will only work if the only zombie in the arena is the boss. For example:
Objective needed
Mechanism:
Command block on the RIGHT:
Command block on the LEFT:
Alternatively:
Summary:
When a player kills a zombie, their "BOSSKILL" score increases by 1. In the /give command, the coordinates for the arena are listed to ensure that players haven't just gone out and killed a zombie not part of the battle. The second command block just sets the players' BOSSKILL score to 0 to prevent multiple firings.
If you need to include more /give commands, you could just add a repeater after the comparator, like so:
Just make sure that the /scoreboard command comes last.
With the above, you will need to make sure the clock only starts when the boss fight is started, as the mechanism will track every zombie kill made in the arena. To make sure that there are no zombies naturally spawned, I recommend turning off the "doMobSpawning" gamerule, as well as setting the game to peaceful and back to a higher difficulty before summoning the boss.
You should also set the players' "BOSSKILL" score to 0 before summoning the boss and starting the clock. You could also just not have the objective itself exist until the fight starts. This will ensure players don't try to kite a regular zombie into the arena and kill it to win the fight.
----
As far as detecting mob health goes, you cannot. You also cannot track the total damage dealt by users, only when they successfully deal damage. Smoke and mirrors can be used to make it seem like the player has taken off half the health of the mob, but that can become fairly complex.
You would essentially have to track the number of times the player hits the boss, but they can also just use their fists to increase that score. The "stat.useItem.276" can track when a diamond sword is used, which can be cross-referenced with the "stat.damageDealt" score to make sure the player is using a satisfactory weapon. You would also need to set this up for multiple people, since the scores would be shared and cannot be combined too easily.
If you'd still like to do something like that, I can help further.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
http://www.minecraftforum.net/topic/2114709-the-doom-of-the-doctor/
Several mechanisms can be created to track each different type of weapon. The biggest issue, which will probably ensure this is useless, is that bow usage can't be tracked due to a bug, which can be viewed here: https://mojang.atlassian.net/browse/MC-31047
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
You could give it the "Unbreakable" Tag and there would be no damage to it. The downside is that it cant break ever.
LIFE IS MORE THAN SURVIVAL! There is also Creative, Hardcore, and Adventure.
However, if you don't like this, another option is to "/clear" the item(s) from the players inventory shortly after the boss' death, like upon leaving the room. The output of that command will only read 'true' (aka power a redstone comparator) if it successfully clears the item(s) from the players inventory. If it does, you can then have it re-give the items to the player, names and lore and all, but at full health.
Another great thing about this is that you can have it, when it checks to see if it successfully cleared the item, also use that to see if you've killed the boss, which would allow you to have minions or custom minions of the same type as the boss.
That would be my solution, hope it helps! (:
[Edit] If you need help learning how to do this exactly, I would be glad to give you more detailed instructions. On an unrelated but slightly related note, I need to go learn why my custom sounds are suddenly all breaking even though I redid my resource pack to the new formats/names... >.>
As of a recent discovery by FireArceus64, if you set the DropChances of an item any higher than 1.0, such as 1.1, the item the mob drops will retain the durability you set via the Damage tag (and no Damage tag means a fully-functional item).
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
That doesn't really work in this case. Looking at the original command, it appears as though JMEL2012 wants a chance to drop some loot. Settling the drop chances to higher than 1.0f will guarantee a drop. So, if you want custom drop chances, you'll probably have to go with enchanting each item with Unbreaking.
Link Removed
Link Removed