Custom Death Message not working
I'm making a custom map for Minecraft. In it, all players die by going into water. This is the command I have:
/execute at @a[distance=..100] if block ~ ~ ~ water run tellraw @a {"text":"","color":"white","extra":[{"selector":"@p"},{"text":" died by touching the water"}]}
But when I touch the water the command just spams the chat, and if I make it impulse the command won't run if I touch the water.
Thanks in advance for any help.
minecraft minecraft-commands technical-issues
New contributor
add a comment |
I'm making a custom map for Minecraft. In it, all players die by going into water. This is the command I have:
/execute at @a[distance=..100] if block ~ ~ ~ water run tellraw @a {"text":"","color":"white","extra":[{"selector":"@p"},{"text":" died by touching the water"}]}
But when I touch the water the command just spams the chat, and if I make it impulse the command won't run if I touch the water.
Thanks in advance for any help.
minecraft minecraft-commands technical-issues
New contributor
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday
add a comment |
I'm making a custom map for Minecraft. In it, all players die by going into water. This is the command I have:
/execute at @a[distance=..100] if block ~ ~ ~ water run tellraw @a {"text":"","color":"white","extra":[{"selector":"@p"},{"text":" died by touching the water"}]}
But when I touch the water the command just spams the chat, and if I make it impulse the command won't run if I touch the water.
Thanks in advance for any help.
minecraft minecraft-commands technical-issues
New contributor
I'm making a custom map for Minecraft. In it, all players die by going into water. This is the command I have:
/execute at @a[distance=..100] if block ~ ~ ~ water run tellraw @a {"text":"","color":"white","extra":[{"selector":"@p"},{"text":" died by touching the water"}]}
But when I touch the water the command just spams the chat, and if I make it impulse the command won't run if I touch the water.
Thanks in advance for any help.
minecraft minecraft-commands technical-issues
minecraft minecraft-commands technical-issues
New contributor
New contributor
edited 10 mins ago
SpiceWeasel
7431514
7431514
New contributor
asked yesterday
AaronKanaronAaronKanaron
1
1
New contributor
New contributor
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday
add a comment |
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday
add a comment |
1 Answer
1
active
oldest
votes
You could tag the player that touched the water, which clarifies who touched the water and indicates they have already had the text displayed. Then the repeating command block should point at a conditional chain command block with a tellraw that checks for that tag. The next trick will be removing the tag after they're not in the water anymore, which could be roughly the same command, except checking if they have the tag and they're in air. You can add it as its own repeating command or an unconditional chain command.
Here's the code I came up with. I checked it with 1 player, but I don't have another player handy to check for more. Notice the selector in the tellraw includes an argument checking for the tag.
execute at @a as @a[distance=..100,tag=!water] anchored feet if block ~ ~ ~ water run tag @s add water
tellraw @a {"text":"","color":"white","extra":[{"selector":"@p[tag=water]"},{"text":" died by touching the water"}]}
execute at @a as @a[distance=..100,tag=water] anchored feet if block ~ ~ ~ air run tag @s remove water
UPDATE: Revised code to include "anchored" to prevent pointing at the wrong place... but still haven't been able to test with multiple players.
New contributor
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "41"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
AaronKanaron is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f347527%2fcustom-death-message-not-working%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could tag the player that touched the water, which clarifies who touched the water and indicates they have already had the text displayed. Then the repeating command block should point at a conditional chain command block with a tellraw that checks for that tag. The next trick will be removing the tag after they're not in the water anymore, which could be roughly the same command, except checking if they have the tag and they're in air. You can add it as its own repeating command or an unconditional chain command.
Here's the code I came up with. I checked it with 1 player, but I don't have another player handy to check for more. Notice the selector in the tellraw includes an argument checking for the tag.
execute at @a as @a[distance=..100,tag=!water] anchored feet if block ~ ~ ~ water run tag @s add water
tellraw @a {"text":"","color":"white","extra":[{"selector":"@p[tag=water]"},{"text":" died by touching the water"}]}
execute at @a as @a[distance=..100,tag=water] anchored feet if block ~ ~ ~ air run tag @s remove water
UPDATE: Revised code to include "anchored" to prevent pointing at the wrong place... but still haven't been able to test with multiple players.
New contributor
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
add a comment |
You could tag the player that touched the water, which clarifies who touched the water and indicates they have already had the text displayed. Then the repeating command block should point at a conditional chain command block with a tellraw that checks for that tag. The next trick will be removing the tag after they're not in the water anymore, which could be roughly the same command, except checking if they have the tag and they're in air. You can add it as its own repeating command or an unconditional chain command.
Here's the code I came up with. I checked it with 1 player, but I don't have another player handy to check for more. Notice the selector in the tellraw includes an argument checking for the tag.
execute at @a as @a[distance=..100,tag=!water] anchored feet if block ~ ~ ~ water run tag @s add water
tellraw @a {"text":"","color":"white","extra":[{"selector":"@p[tag=water]"},{"text":" died by touching the water"}]}
execute at @a as @a[distance=..100,tag=water] anchored feet if block ~ ~ ~ air run tag @s remove water
UPDATE: Revised code to include "anchored" to prevent pointing at the wrong place... but still haven't been able to test with multiple players.
New contributor
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
add a comment |
You could tag the player that touched the water, which clarifies who touched the water and indicates they have already had the text displayed. Then the repeating command block should point at a conditional chain command block with a tellraw that checks for that tag. The next trick will be removing the tag after they're not in the water anymore, which could be roughly the same command, except checking if they have the tag and they're in air. You can add it as its own repeating command or an unconditional chain command.
Here's the code I came up with. I checked it with 1 player, but I don't have another player handy to check for more. Notice the selector in the tellraw includes an argument checking for the tag.
execute at @a as @a[distance=..100,tag=!water] anchored feet if block ~ ~ ~ water run tag @s add water
tellraw @a {"text":"","color":"white","extra":[{"selector":"@p[tag=water]"},{"text":" died by touching the water"}]}
execute at @a as @a[distance=..100,tag=water] anchored feet if block ~ ~ ~ air run tag @s remove water
UPDATE: Revised code to include "anchored" to prevent pointing at the wrong place... but still haven't been able to test with multiple players.
New contributor
You could tag the player that touched the water, which clarifies who touched the water and indicates they have already had the text displayed. Then the repeating command block should point at a conditional chain command block with a tellraw that checks for that tag. The next trick will be removing the tag after they're not in the water anymore, which could be roughly the same command, except checking if they have the tag and they're in air. You can add it as its own repeating command or an unconditional chain command.
Here's the code I came up with. I checked it with 1 player, but I don't have another player handy to check for more. Notice the selector in the tellraw includes an argument checking for the tag.
execute at @a as @a[distance=..100,tag=!water] anchored feet if block ~ ~ ~ water run tag @s add water
tellraw @a {"text":"","color":"white","extra":[{"selector":"@p[tag=water]"},{"text":" died by touching the water"}]}
execute at @a as @a[distance=..100,tag=water] anchored feet if block ~ ~ ~ air run tag @s remove water
UPDATE: Revised code to include "anchored" to prevent pointing at the wrong place... but still haven't been able to test with multiple players.
New contributor
edited 14 hours ago
New contributor
answered yesterday
Lewis StrasburgLewis Strasburg
12
12
New contributor
New contributor
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
add a comment |
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
It didn't really work, the player who got execute was the one that was the nearest to the command block. Do you get any other solutions?
– AaronKanaron
20 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Did the tag get assigned correctly? That seems like the likeliest place for that setup to come apart. The "@s" doesn't seem to work the way I expect it to. Try putting in another @a[distance..100,tag=!water] instead. Maybe @a[tag=water] in place of the @p[tag=water] too.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Never mind the "@a" stuff. It won't work. The trouble we're having is that the check for the block is still coming from the command block. Even if we're telling it to look where the player is, we're not getting the player to run the command, which would let the @s work. I'm looking for another way now.
– Lewis Strasburg
15 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
Fun little quirk... you have to use the "anchored" parameter to specify eyes or feet or the command will revert to a previous caller.... I still don't have multiple players to test with, but I will revise the code above. Let me know if it's working any better.
– Lewis Strasburg
14 hours ago
add a comment |
AaronKanaron is a new contributor. Be nice, and check out our Code of Conduct.
AaronKanaron is a new contributor. Be nice, and check out our Code of Conduct.
AaronKanaron is a new contributor. Be nice, and check out our Code of Conduct.
AaronKanaron is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Arqade!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f347527%2fcustom-death-message-not-working%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
minecraft.gamepedia.com/Commands/tag
– Fabian Röling
yesterday