#Check player

1 messages · Page 1 of 1 (latest)

stray tinsel
#

Can I check whether someone has a special item in their inventory and if so, with which command?

pine lilyBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1722348245:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

valid vapor
#

If you're in 1.20.5+ you can use execute if items

stray tinsel
#

no i am 1.21

#

Are there any scoreboard commands?

valid vapor
stray tinsel
#

oh

#

for a pick axe must i take entity or block?

valid vapor
#

entity, you're checking a player which is an entity

#

block is for checking stuff like chests

stray tinsel
#

i have a custom pick with id p:10

#

but i cant write this

valid vapor
#

So it's iron_pickaxe[custom_data={p:10}] or something?

stray tinsel
#

run execute if items entity iron_pickaxe[custom_data={p:10}] so?

valid vapor
#

Not quite

#

It would be execute if items entity @s container.* iron_pickaxe[...]

stray tinsel
#

Do you know, as I do, that if a player mines with a custom pickaxe, he gets twice the amount of stones?

valid vapor
#

I'm not quite sure what you're asking

stray tinsel
#

this command doesn't work

#

execute if score @s Level matches 10000.. run execute if items entity @s container.* iron_pickaxe[custom_data={p:10}] run experience add @s -10000 levels

execute if score @s Level matches 10000.. run execute if items entity @s container.* iron_pickaxe[custom_data={p:10}] run give @p diamond_pickaxe[custom_name='"Zerbrecherer"',unbreakable={},rarity="rare",custom_data={p:11},enchantments={levels:{"minecraft:fortune":1}},enchantment_glint_override=false,attribute_modifiers={modifiers:[{id:"block_break_speed",type:"player.block_break_speed",amount:5,operation:"add_value",slot:"mainhand"}],show_in_tooltip:false}] 1

execute if score @s Level matches 10000.. run clear @p iron_pickaxe[custom_name='{"color":"gold","text":"Zerbrecher"}',unbreakable={},custom_data={p:10},enchantment_glint_override=false,attribute_modifiers={modifiers:[{id:"block_break_speed",type:"player.block_break_speed",amount:4,operation:"add_value",slot:"mainhand"}],show_in_tooltip:true}] 1

valid vapor
#

What command are you using to get the item in the first place?

stray tinsel
#

trade from villager

valid vapor
#

And it's an iron pickaxe with custom data of {p:10}?

stray tinsel
#

found the error

#

Can I somehow change the number of stones that drop when you mine them with a special pickaxe?

valid vapor
#

Yes

#

You will need to overwrite the stone loot table

stray tinsel
#

How I can make this?

valid vapor
#

They have all the vanilla files under presets, so you can start from the stone one and make whatever changes you want

stray tinsel
#

how can I change the loot table there with a specific tool?

valid vapor
#

You need a "match tool" predicate, I think it's called

stray tinsel
#

and where is predicate?

#

If I mine with other pickaxes I still get 2 stone

valid vapor
#

Can you send your loot table file?

stray tinsel
#

{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:stone",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": "minecraft:diamond_pickaxe",
"count": 2,
"components": {
"minecraft:custom_data": "p:11"
}
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:cobblestone"
}
]
},
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"name": "minecraft:stone",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:cobblestone",
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
]
}
],
"random_sequence": "minecraft:blocks/stone"
}

#

this is the custom item give @p diamond_pickaxe[custom_name='"Zerbrecherer"',unbreakable={},rarity="rare",custom_data={p:11},enchantments={levels:{"minecraft:fortune":1}},enchantment_glint_override=false,attribute_modifiers={modifiers:[{id:"block_break_speed",type:"player.block_break_speed",amount:5,operation:"add_value",slot:"mainhand"}],show_in_tooltip:false}] 1

valid vapor
#

Yeah well you're giving two cobblestone always, but an extra stone if they have the special pickaxe

#

Also, you're checking for two of the pickaxe, which is not going to happen

stray tinsel
#

how i make this correct

valid vapor
#

Well, you probably want to check for the tool when giving the second cobblestone

#

And remove "count": 2

stray tinsel
#

do you know why this is red

valid vapor
#

You need quotes around p

stray tinsel
#

p:11 is my custom tag from the dia pick axe

valid vapor
#

Yes I know

stray tinsel
#

waht mean with quotes?

valid vapor
#

"p": 11

stray tinsel
valid vapor
#

No, you still need the braces

#

{"p":11}

stray tinsel
#

when i break a stone with my pick axe it trops stone and coblestone

valid vapor
#

Yeah, because you're dropping an extra stone if you mine it with the pickaxe

#

Also instead of checking for custom data, you're setting custom data on the stone item, which again is not what you want

pine lilyBOT
# pine lily <@&1201956957406109788>
Question Closed

Your question, #1267837621401423904 (Check player), was resolved!

Original Message

#1267837621401423904 message

Duration open

1d1h26m