Started by
Hygerian
on
Topic category: Help with Minecraft modding (Java Edition)
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?
Topic category: Help with Minecraft modding (Java Edition)
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?
In what context would you like to test this?
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?
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)
Ohh so its not possible to only make it in Mcreator?