#anti x-ray

1 messages · Page 1 of 1 (latest)

old lava
#

I want to make a script that detect when a player find a diamond and then the script will send a message at all the staff

#

Pls help

ancient valve
#

It’s not very easy. My best guess is that’ll you need to save every ore the player has mined in a certain time frame and how fast the player gets to the next ore they mine. But it would be hard to figure out since caves would be an issue. Theres probably different approaches but that’s how I would do it

still vortex
#
world.afterEvents.playerBreakBlock.subscribe(({ player, block }) => {
  if (block.typeId.includes('diamond_ore')) world.getPlayers({ tags: [ 'admin' ] }).forEach(p => p.sendMessage(`${player.name} found a diamond`));
});
ancient valve
#

That would work too😭 my idea is for it to be more automated I guess

still vortex
#

I get what you mean, but they just asked for it to notify when the player finds a diamond

ancient valve
#

Yea I just read anti x ray and spoke my mind out

still vortex
#

Actually I was about to say "not possible" before reading the message

ancient valve
# still vortex Actually I was about to say "not possible" before reading the message

Definitely possible with your way but a lot of people aren’t bothered by just watching the logs for who mined what and at what time for a long time lol. I guess your method can be improved by testing if the player has mined for example more than 12 diamonds within 5 minutes it will notify an admin instead of just watching it constantly

old lava
#

no wait

#

if someone collect diamonds and then get them with luck?

lucid zodiac
#

you must remember the ores placed by players so as not to apply the xray verification on these ores

stiff geode
#

Just get an texture pack and force it

old lava
#

and for this " 12 diamonds within 5 minutes i"

#

?

ancient valve
# old lava and for this " 12 diamonds within 5 minutes i"

Put every broken block by the player into an array with a timestamp using date.now and just clear it every 5 minutes. Check if the player has mined and collected more than 12 and if so send a message to an admin or something. You’ll also need to scale that number depending if the item that broke the block has fortune or not

vestal hedge
rotund saddle
#

I made something like that and it's really helpful.

old lava
#

If you want

vestal hedge