All right, got it working. I put everything on top of a fill clock.
This block gives all players the objective always.
/scoreboard players add @a visited 0
This block produces the title.
/title @a[x=-153,y=69,z=309,r=10,score_visited=1] title {text:"Place",bold:true}
This block adds points to visited for anyone within a radius of 10.
/scoreboard players add @a[x=-153,y=69,z=309,r=10,score_visited=1] visited 1
This block takes away points so that the title can be reshown to anyone reentering the area.
/scoreboard players remove @a[x=-153,y=69,z=309,rm=10,score_visited_min=1] visited 1
Things to note:
- I made everything originate from one place, so the XYZ values are hard coded.
- Visited is intended to add up to 2 with these precise commands. These command blocks are largely dependent on where the command blocks are placed on the fill clock relative to each other. On 1, the title is shown, then the player is meant to sit at 2 until they leave the area, where it should drop back to 0.
The coordinates can be added as target selector arguments, i.e. inside the @e[...]
, using the x
, y
, and z
arguments, combined with r
to set a maximum radius. Note that Tilde notation is not allowed for this, you need the absolute coordinates.
Placing an enchanted item in an Item Frame has to be done all at once, since the entitydata is running on the Item Frame, not on the item that is in it. This is done by setting the Item
tag of the item frame to a valid compound NBT structure for an item, such as
{id:"minecraft:stone_sword",tag:{ench:[{id:16,lvl:1}]}}
for a Sharpness I Stone Sword.
Overall, the command you want to be running might look like:
entitydata @e[type=ItemFrame,x=1,y=2,z=3,r=2] {Item:{id:"minecraft:stone_sword",tag:{ench:[{id:16,lvl:1}]}}}
Be careful regarding the closing parentheses.
Best Answer
This answer is for 1.12 or before. Refer to this answer by pppery for 1.13 and later.
You can set up some simple commands with command blocks, and let players click the button of each command block so that they receive the enchanted items.
You can use the following command to give players enchanted items (in this example, 1 diamond sword with Smite 2 and Knockback 30)
This is the general command:
You put all enchantment tags between
[ ]
, each with bothid
andlvl
tags wrapped together by curly braces{ }
.You can also add in the clear inventory command to ensure they don't get kits twice.
Remember the highest level for the enchantment is level 32767. You can stack enchants as many times as you want such as:
After setting up the command blocks, put buttons and the players can choose by clicking them.
You can also put enchantments onto things that normally cannot be enchanted or have that specific enchantment. For example, you can do the command stated above to give you enchanted blocks. But, enchantments will NOT affect how the thing works normally. For example, enchanting Thorns on a dirt block will not hurt players when they come into contact with the enchanted block.