I would like to have a diamond called 'TEST', with 'TESTING 1 2 3' as its lore, that gives you super speed when you hold it, and allows you to teleport to different dimensions when you right click it. What command would I need to give myself it? Note: I will be creating a command creation involving this, and I will credit the first user who gives me a good answer.
The Meaning of Life, the Universe, and Everything.
Join Date:
1/26/2018
Posts:
48
Member Details
Right-click detection isn't built in to the game, so that will be a bit harder to do unless you use the classic "invisible villager" trick, but that may be a lot of extra commands.
Instead, you can use sneak detection, so when they hit shift, they'll be teleported to a different dimension. Then just handle the dimension handling with something like:
/execute as @a[holding diamond and sneaking arguments] in the_nether tp @s 0 100 0
And handle the end and the overworld however you like (I think cycling through them would work).
Right-click detection isn't built in to the game, so that will be a bit harder to do unless you use the classic "invisible villager" trick, but that may be a lot of extra commands.
Instead, you can use sneak detection, so when they hit shift, they'll be teleported to a different dimension. Then just handle the dimension handling with something like:
/execute as @a[holding diamond and sneaking arguments] in the_nether tp @s 0 100 0
And handle the end and the overworld however you like (I think cycling through them would work).
Thanks to both of you! You obviously know more abut commands than me.
Quick question: How would I test for holding the diamond while sneaking, and how could I cycle through?
Then have a command block that sets it to 0 at all times, before the command block that updates the score if they are holding the diamond and sneaking.
/scoreboard players set @a sneak 0
Say you have the scoreboard set up for holding that specific diamond (I'd look it up, but there just do a quick google search), and call it holdingDiamond, this is what the command checking for both would look like:
/execute as/at @a[scores{sneak=1..,holdingDiamond=1..}] run (do this command)
You can even test for the NBT data in the selector argument for the selected item, but I'm just getting myself accustomed to the 1.13 syntax, so I don't want to try to provide it here.
For cycling through, it's a bit more complex, and would look something like this (I'm unable to test atm):
/execute in the_nether as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:0}] run tp @s x y z
/execute in the_end as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:-1}] run tp @s x y z
/execute in overworld as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:1}] run tp @s x y z
This will teleport them to the nether if they are in the overworld, the end if they are in the nether, and then the overworld if they are in the end.
Again, can't test atm, but that's what the basic commands will look like.
Then have a command block that sets it to 0 at all times, before the command block that updates the score if they are holding the diamond and sneaking.
/scoreboard players set @a sneak 0
Say you have the scoreboard set up for holding that specific diamond (I'd look it up, but there just do a quick google search), and call it holdingDiamond, this is what the command checking for both would look like:
/execute as/at @a[scores{sneak=1..,holdingDiamond=1..}] run (do this command)
You can even test for the NBT data in the selector argument for the selected item, but I'm just getting myself accustomed to the 1.13 syntax, so I don't want to try to provide it here.
For cycling through, it's a bit more complex, and would look something like this (I'm unable to test atm):
/execute in the_nether as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:0}] run tp @s x y z
/execute in the_end as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:-1}] run tp @s x y z
/execute in overworld as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:1}] run tp @s x y z
This will teleport them to the nether if they are in the overworld, the end if they are in the nether, and then the overworld if they are in the end.
Again, can't test atm, but that's what the basic commands will look like.
This is great! Thanks! I'll be sure to credit you.
I would like to have a diamond called 'TEST', with 'TESTING 1 2 3' as its lore, that gives you super speed when you hold it, and allows you to teleport to different dimensions when you right click it. What command would I need to give myself it? Note: I will be creating a command creation involving this, and I will credit the first user who gives me a good answer.
Bumpity bump bump bump.
in 1.13 names are now json objects.
For the speed, jsut add an attributemodifier
/give @p diamond{display:{Name:"{\"text\":\"hello, name goes here\"}",Lore:["hi, lore goes here"]},AttributeModifiers:[{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:1,Operation:0,UUIDLeast:768983,UUIDMost:30749}]}
To control the speed boost, just change the Amount:1 so something. You can use decimals.
Right-click detection isn't built in to the game, so that will be a bit harder to do unless you use the classic "invisible villager" trick, but that may be a lot of extra commands.
Instead, you can use sneak detection, so when they hit shift, they'll be teleported to a different dimension. Then just handle the dimension handling with something like:
/execute as @a[holding diamond and sneaking arguments] in the_nether tp @s 0 100 0
And handle the end and the overworld however you like (I think cycling through them would work).
Thanks to both of you! You obviously know more abut commands than me.
Quick question: How would I test for holding the diamond while sneaking, and how could I cycle through?
For testing for an item while sneaking, you'll want a scoreboard objective that tracks sneak.
/scoreboard objectives add sneak minecraft.custom:minecraft.crouch_one_cm
Then have a command block that sets it to 0 at all times, before the command block that updates the score if they are holding the diamond and sneaking.
/scoreboard players set @a sneak 0
Say you have the scoreboard set up for holding that specific diamond (I'd look it up, but there just do a quick google search), and call it holdingDiamond, this is what the command checking for both would look like:
/execute as/at @a[scores{sneak=1..,holdingDiamond=1..}] run (do this command)
You can even test for the NBT data in the selector argument for the selected item, but I'm just getting myself accustomed to the 1.13 syntax, so I don't want to try to provide it here.
For cycling through, it's a bit more complex, and would look something like this (I'm unable to test atm):
/execute in the_nether as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:0}] run tp @s x y z
/execute in the_end as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:-1}] run tp @s x y z
/execute in overworld as @a[scores{sneak=1..,holdingDiamond=1..},nbt={Dimension:1}] run tp @s x y z
This will teleport them to the nether if they are in the overworld, the end if they are in the nether, and then the overworld if they are in the end.
Again, can't test atm, but that's what the basic commands will look like.
This is great! Thanks! I'll be sure to credit you.
Instead of using "minecraft.custom:minecraft.crouch_one_cm", use this instead!
"minecraft.custom:minecraft.sneak_time"
^ So you don't have to move while sneaking.
Bob Ross is kool