2

Hello I Need Help With Commands

VladyKun's Avatar VladyKun6/28/18 10:59 pm
2 emeralds 222 3
7/2/2018 2:55 pm
AgentShieldjj's Avatar AgentShieldjj
Can anybody help howw i can stich together these two "scripts" together so when i press the button on command block i get dyed leather boots with other script making those boots when wearing lowering your health bar
These are the commands i wanna combine together

This one gives you leather boots in red color and with a name tag "Scout"
/give @p minecraft:leather_boots 1 0 {display:{color:15066419,Name:Scout}

And this one also gives you leather boots but they do not get colored these boots just lower your health bar
when wearing
replaceitem entity @p slot.armor.feet leather_boots1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-10,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}


Please help! T^T
Posted by VladyKun's Avatar
VladyKun
Level 1 : New Miner
0

Create an account or sign in to comment.

3

1
07/02/2018 2:55 pm
Level 33 : Artisan Creeper Hugger
AgentShieldjj
AgentShieldjj's Avatar
hey I got the the command for you But didn't know what color you wanted so i did yellow

Command:


/give @p leather_boots 1 0 {display:{Name:Scout,Lore:["Where The Hearts?"],color:16701501},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-10,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}
2
06/29/2018 3:06 amhistory
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
Well, now that SUPERI0N has solved the first problem I'll try to take on the second part :)

So, if people don't own the boots then we want to run Super's command below. And if they do own the boots those should be replaced by what you have above. The solution to that is simple: tagging.

First, add a tag to those boots. We'll just use Super's command and what you need to do is add that in front of "display:{":

/give @p minecraft:leather_boots 1 0 {tag:["specialboots"],display:{color:15066419,Name:Scout}}

(note: I can't be bothered to use the full command, I'm only trying to help with the "combining", you can work out those details yourself).

This makes it a lot easier on us to test for those boots later. Otherwise you'd have to muck with color codes and jeb knows what... Now for the trick to combine your scripts / commands.

Put this into your commandblock:

/testfor @p {Inventory:[{id:"minecraft:leather_boots",Count:1b,tag:{tag:["specialboots"]}}]}

Then add a conditional chain command block behind it:

/scoreboard players tag @p add gotboots

Now we're reaching a problem because we still need things done if the player doesn't have the items in their inventory. 1.13 fixed this by allowing @p[nbt:{}] but no such luck yet. SO...

Make a redstone connection from the first command block and be sure to use a repeater set to two or three ticks before the other command block! This will make sure that if the player pushes the button to activate all this they're actually firing up 2 series of commands. But the repeater will make sure that the other series won't get fired before the first.

In this second setup you do your things... If the player doesn't have the boots then they're also not tagged. And vice versa.

So use a command block which has this command:

/give @p[tag=!gotboots] minecraft:leather_boots 1 0 {tag:["specialboots"],display:{color:15066419,Name:Scout}}

Put a regular chain command block behind it which uses:

/give @p[tag=gotboots] minecraft:leather_boots 1 0 {tag:["cursedboots"]}

You could also opt to use 'replaceitem' but do keep in mind that this would allow players to cheat. I mean: all they'd have to do is make sure they're not wearing the boots and you're home free. This is also why I didn't specifically test for the slot.

Which reminds me: maybe curse of binding could help; that would prevent players from removing these items. And in which case you could fully focus on the "shoe slot", even in my testfor command. In that case you should include: Slot:100b, right after Count. So:

/testfor @p {Inventory:[{id:"minecraft:leather_boots",Count:1b,Slot:100b,tag:{tag:["specialboots"]}}]}

... this would test if the player is actually wearing those 'specialboots'.

Hope this can help.
2
06/28/2018 11:40 pm
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
Hmm, the first command you provided gives me yellow boots and not red. Since I'm a little confused on which one you need, I'll provide a command for both colors.

Yellow Boots
/give @p minecraft:leather_boots 1 0 {display:{color:15066419,Name:Scout},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-10,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}
Red Boots
/give @p minecraft:leather_boots 1 0 {display:{color:11546150,Name:Scout},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-10,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}
I hope this helps! :)
~SUPERIONtheKnight
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome