#Looking for ideas to prevent Silk Touch from dropping a block

1 messages · Page 1 of 1 (latest)

slender ferry
#

I've had this issue for a while now, I need to not drop a block when a player has Silk Touch. My old method when I was only using Jason was to spawn an entity that would kill any blocks with that tag in a radius of it and then instant despawn it.

Thanks

whole geyser
#

You can detect enchants, so you could just remove silk touch from all items

#

If it’s for a specific block, then just use on block break and check the player for silk touch, then remove the dropped item the same way as before, but by using the exact name.

slender ferry
#

not trying to remove silk touch from the game lol

#

so it seems like I just have to do the same thing

whole geyser
little dust
#

BlockBreak,
getItem
Get enchants
Enxhant hasEnchantment silk
item kill

slender ferry
#

guess not exactly easier, but more refined

#

so I can actually grab the item that the block drops instead of just killing any item with the same name in that location

thick valley
#

then just .kill() it

slender ferry
#

Don't think it's possible to specifically get the item dropped in a block break event

thick valley
#

why exactly do u want to disable silk touch?

slender ferry
#

only trying to disable it for specific blocks

#

I have blocks that players need a certain scoreboard value or higher to mine

#

If a player has silk touch it completely bypasses the entire system

thick valley
#

so silk touch can still be used?

#

for other blocks

slender ferry
#

yeop

#

I'm not trying to remove Silk Touch from the game, just stop players from being able to use it on the blocks I need it to be on

#

I already have everything set up to do that, I'm just asking if anyone knows of a better method to destroy the items

#

tahn just a runCommandAsync to kill all in the same location

visual tusk
#

There isn't a better way

thick valley
#

u can use entity spawn

#

and get item stack

#

well

#

no

#

does entity hit work when mining?

slender ferry
#

entityHitBlock

#

mm... if I could store the location of the block being hit, then test location of entitySpawn and Id

#

would be way messier than just killing the item though

thick valley
#

would probably be more accurate though

slender ferry
#

not so sure about that, only thing it does is avoids having to use a runCommandAsync