Block Player Detection

Started by Hygerian on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Block Player Detection

Is there a way to detect if 2 or more players are breaking the same block at the same time which results in something to happen?

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In what context would you…
Mon, 10/07/2024 - 17:44

In what context would you like to test this?

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In a way that detects how…
Tue, 10/08/2024 - 04:20

In a way that detects how many players are breaking the same block, which for example breaks the block faster depending on how many players are breaking it at the same time. (2 players = 2 times faster | 5 players = 5 times faster | ...)

Lets say we have 2 players that are trying to break an obsidian block, it should test if both of them have the requirements (diamond pickaxe) to break the block faster. If they do they break it faster. If they dont and only 1 has the pickaxe, the obsidian will break as fast as if it was only 1 player breaking it. If both of them dont have the requirements, they just dont break it faster.

Was that understandable or should I rewrite it?

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you'll have to tweak…
Tue, 10/08/2024 - 16:26

I think you'll have to tweak the code to be able to do something like this, because you need to be able to modify the code for picks, for example, and access the “when player destroy a block” event, then create a variable that rises when this event is activated and falls when “when player stop destroy a block”, as well as one to store the coordinates of this block, when several players mine different blocks at the same time. You can then create a function that increases or reduces the mining speed of those who are currently mining a given block, and then reduces it when they stop mining.

Translated with DeepL.com (free version)

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ohh so its not possible to…
Tue, 10/08/2024 - 19:16

Ohh so its not possible to only make it in Mcreator?