Skip to main content
replaced https://minecraft.gamepedia.com/ with https://minecraft.wiki/w/
Source Link

Outdated: pre-v1.18.30 only

ExpertCoder14’s answer is better for v1.18.30 and up.

You can use /clear/clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

Outdated: pre-v1.18.30 only

ExpertCoder14’s answer is better for v1.18.30 and up.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

Outdated: pre-v1.18.30 only

ExpertCoder14’s answer is better for v1.18.30 and up.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

add outdated notice
Source Link
cherryblossom
  • 3k
  • 5
  • 20
  • 59

Outdated: pre-v1.18.30 only

ExpertCoder14’s answer is better for v1.18.30 and up.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

Outdated: pre-v1.18.30 only

ExpertCoder14’s answer is better for v1.18.30 and up.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

Swords do have data (damage) values; that's the # durability expended.
Source Link
aytimothy
  • 17.9k
  • 17
  • 83
  • 140

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values*values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

* I'm not sure if a sword has any data values (e.g. for durability) so just match all data values instead of 0 just in case.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values* and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

* I'm not sure if a sword has any data values (e.g. for durability) so just match all data values instead of 0 just in case.

You can use /clear<player> netherite_sword -1 0. The -1 matches all data values and the 0 specifies the maximum number of items to clear (so none will be cleared). If the player has at least 1 netherite sword in their inventory, the command will output a success.

The success can be detected using a chain command block. Put the /clear any command block facing a conditional, always active, chain command block with the command that you want to execute if the player has a netherite sword.

Source Link
cherryblossom
  • 3k
  • 5
  • 20
  • 59
Loading