The syntax of /setblock
is:
/setblock <x> <y> <z> <TimeName> [dataValue] [oldBlockHandling] [dataTag]
Which means that you need to specify an [oldBlockHandling]
mode (E.G: replace
) before you can specify the [dataTag]
.
The name tag of an entity or tile entity is CustomName
, rather than just Name
as it is on items. Also, neither it nor Lock
are stored in a Display
compound tag.
This should be your fixed command:
/setblock ~-1 ~-1 ~ trapped_chest 1 replace {CustomName:"Locked Chest",Lock:"Chest Key 47"}
In 1.8 you cannot rely on arrows items specifically, as no item data is transferred to the entity.
However, the bow will modify the arrow's damage
value depending on the Power enchantment level. You can provide the player with a bow containing a specific Power level and then target arrows that have a particular amount of damage.
damage
will normally be 2.0. If Power exists on the bow, the value is incremented by 0.5 and then for each level of Power, it will increase by another 0.5. For example, a Power 3 bow would result in a damage value of 4.0.
Example bow to provide:
/give @p minecraft:bow 1 0 {ench:[{id:48s,lvl:3s}]}
You can assign a score to arrow entities based on their damage
tag value.
Objective to create:
/scoreboard objectives add BowType dummy
Example commands to run on a clock, assigning scores to specific arrows (Power 3 to Power 5):
/scoreboard players set @e[type=Arrow] BowType 1 {damage:4.0}
/scoreboard players set @e[type=Arrow] BowType 2 {damage:4.5}
/scoreboard players set @e[type=Arrow] BowType 3 {damage:5.0}
And you can target arrows based on their score.
/say Arrows shot from a Power 3 bow: @e[type=Arrow,score_BowType_min=1,score_BowType=1]
Best Answer
It's not that hard.
This summons a skeleton on the command block.
This summons a named skeleton. Optionally, you can use the "CustomNameVisible:" tag, to make the name visible even when you don't hover over the skeleton.
This last command replaces items in both hands with air (nothing) or in other words, clears them.