Does anyone know a way to make custom player drops? I'm trying to make it so that when the player dies, a diamond is dropped instead of his entire inventory. I've seen videos that use the /give command but unfortunately that method doesn't work anymore since it actually gives it to you instead of plopping the item at your feet. Any help would be appreciated.
FOLLOW THESE STEPS EXACTLY
Step 1 type this command... /gamerule keepInventory false This will make it so players dont drop their items on death
Step 2 type this command... /scoreboard objectives add Deaths deathCount
Step 3 Your going to need a /testfor @a command testing for player deaths min 1 max 10 just incase :/
Step 4 In the new snapshot I think it may be possible to use the /execute command to target a player with a certain amount of deaths so that you can execute a command like
/summon Item ~ ~ ~ {PickupDelay:0,Age:1000}
I'm not sure if this is possible but I may need someone to confirm it...
The issue in the latest snapshots is that you cannot target a dead player, so you wouldn't be able to set an item at the player's position. If I can find another way I will let you know.
The way to test if a player has died is with this command: (assuming the objective name is deaths)
/scoreboard players test * deaths 1
but sending an item to their location seems to be a different story...
The issue in the latest snapshots is that you cannot target a dead player, so you wouldn't be able to set an item at the player's position. If I can find another way I will let you know.
The way to test if a player has died is with this command: (assuming the objective name is deaths)
/scoreboard players test * deaths 1
but sending an item to their location seems to be a different story...
Quick notice: you can specifically target dead players using the @a selector in 14w11b. So with the Deaths objective:
/scoreboard players set @e[type=Item] OBJECTIVE 1 {Item:{id:minecraft:redstone}}
And the /execute command:
/execute <player|entity> X Y Z <command>
/execute @e[type=Item,score_OBJECTIVE_min=1] ~ ~ ~ say @e[c=1]
The above will set the "OBJECTIVE" score of all dropped redstone dust items to 1, and the /execute command will force those particular items to say the single nearest entity (being themselves).
/scoreboard players set @e[type=Item] OBJECTIVE 1 {Item:{id:minecraft:redstone}}
And the /execute command:
/execute <player|entity> X Y Z <command>
/execute @e[type=Item,score_OBJECTIVE_min=1] ~ ~ ~ say @e[c=1]
The above will set the "OBJECTIVE" score of all dropped redstone dust items to 1, and the /execute command will force those particular items to say the single nearest entity (being themselves).
So that means that I'd have to spawn a Redstone Dust, give it a score, and then teleport it to the dead player? I suppose that's a sufficient work around. I just hope it wouldn't be game breaking since it's using the @a selector.
No; the execute command does not support NBT's, and skyliner was right. However, the summon command does support nbt's, and it's being executed. Skyliner's post will work perfectly without an overly complicated testfor, summon, tp.
No; the execute command does not support NBT's, and skyliner was right. However, the summon command does support nbt's, and it's being executed. Skyliner's post will work perfectly without an overly complicated testfor, summon, tp.
Solved by this post:
Step 1 type this command... /gamerule keepInventory false This will make it so players dont drop their items on death
Step 2 type this command... /scoreboard objectives add Deaths deathCount
Step 3 Your going to need a /testfor @a command testing for player deaths min 1 max 10 just incase :/
Step 4 In the new snapshot I think it may be possible to use the /execute command to target a player with a certain amount of deaths so that you can execute a command like
/summon Item ~ ~ ~ {PickupDelay:0,Age:1000}
I'm not sure if this is possible but I may need someone to confirm it...
Thanks for replying! I'll await your continuation. I'm pretty sure it's /gamerule keepInventory true that won't make players drop their items.
The way to test if a player has died is with this command: (assuming the objective name is deaths)
/scoreboard players test * deaths 1
but sending an item to their location seems to be a different story...
Quick notice: you can specifically target dead players using the @a selector in 14w11b. So with the Deaths objective:
Followed by:
A hopper clock will be fast enough to cycle through players before they respawn.
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/
/execute commands can support NBTs?
No, but you can use the /scoreboard command to assign scores to entities based on their NBT data. Syntax:
And the /execute command:
The above will set the "OBJECTIVE" score of all dropped redstone dust items to 1, and the /execute command will force those particular items to say the single nearest entity (being themselves).
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/
So that means that I'd have to spawn a Redstone Dust, give it a score, and then teleport it to the dead player? I suppose that's a sufficient work around. I just hope it wouldn't be game breaking since it's using the @a selector.
Oh, wow. So I tried:
And it actually works. Huh...well, thanks.