Constructs new ReachDistanceModifier object and adds it to the global list.
Remember that it must only be created on the client side, so you probably will have to use client packets.
This object contains two values: modifier
and multiplier
.
// Pseudocode of reach distance modifiers application
// 12 or 6 depending on whether the player is in creative mode or not
float result = getReachDistance();
// adding all the modifiers to the result
for(mod : modifiers) {
if(mod.enabled) {
result += mod.modifier;
}
}
// multiplying result by all the multipliers
for(mod : modifiers) {
if(mod.enabled) {
result *= mod.multiplier;
}
}
// done!
return result;
By default the modifier is 0, the multiplier is 1
Disables the following modifier object
reference to itself to be used in sequential calls
Enables the following modifier object
reference to itself to be used in sequential calls
modifier
value of the following object at the moment
multiplier
value of the following object at the moment
whether the following modifier object is enabled at the moment
Sets new modifier
reference to itself to be used in sequential calls
Sets new multiplier
reference to itself to be used in sequential calls
Generated using TypeDoc
The object used to modify player's reach distance (maximum distance from which the player can reach blocks or mobs and interact with them)
3.0