import { Callout, Tab, Tabs } from 'nextra-theme-docs'
The combat module allows you to modify certain aspects of combat that are usually handled client-sided.
- Adds the ability to disable the miss penalty, on all versions 1.8 and above.
- Adds the ability to disable the miss penalty when targeting a block, on all versions 1.8 and above.
- Adds the ability to dig and use an item at the same time, like in 1.7, on all versions 1.8 and above.
Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.
<Tabs items={['Apollo API', 'apollo-protos library', 'Manual JSON Object Construction']}>
**Apollo API examples.** See [General](/apollo/developers/general) for common patterns and helpers.public void setDisableMissPenalty(boolean value) {
this.combatModule.getOptions().set(CombatModule.DISABLE_MISS_PENALTY, value);
}public void setDisableBlockMissPenalty(boolean value) {
this.combatModule.getOptions().set(CombatModule.DISABLE_BLOCK_MISS_PENALTY, value);
}public void setAllowDigAndUse(boolean value) {
this.combatModule.getOptions().set(CombatModule.ALLOW_DIG_AND_USE, value);
}Toggle Miss Penalty
public void setDisableMissPenalty(boolean value) {
Map<String, Value> properties = new HashMap<>();
properties.put("disable-miss-penalty", Value.newBuilder().setBoolValue(value).build());
ConfigurableSettings settings = ProtobufPacketUtil.createModuleMessage("combat", properties);
ProtobufPacketUtil.broadcastPacket(settings);
}Toggle Block Miss Penalty
public void setDisableBlockMissPenalty(boolean value) {
Map<String, Value> properties = new HashMap<>();
properties.put("disable-block-miss-penalty", Value.newBuilder().setBoolValue(value).build());
ConfigurableSettings settings = ProtobufPacketUtil.createModuleMessage("combat", properties);
ProtobufPacketUtil.broadcastPacket(settings);
}Toggle Dig and Use
public void setAllowDigAndUse(boolean value) {
Map<String, Value> properties = new HashMap<>();
properties.put("allow-dig-and-use", Value.newBuilder().setBoolValue(value).build());
ConfigurableSettings settings = ProtobufPacketUtil.createModuleMessage("combat", properties);
ProtobufPacketUtil.broadcastPacket(settings);
}Toggle Miss Penalty
public void setDisableMissPenalty(boolean value) {
Map<String, Object> properties = new HashMap<>();
properties.put("disable-miss-penalty", value);
JsonObject message = JsonUtil.createEnableModuleObjectWithType("combat", properties);
JsonPacketUtil.broadcastPacket(message);
}Toggle Block Miss Penalty
public void setDisableBlockMissPenalty(boolean value) {
Map<String, Object> properties = new HashMap<>();
properties.put("disable-block-miss-penalty", value);
JsonObject message = JsonUtil.createEnableModuleObjectWithType("combat", properties);
JsonPacketUtil.broadcastPacket(message);
}Toggle Dig and Use
public void setAllowDigAndUse(boolean value) {
Map<String, Object> properties = new HashMap<>();
properties.put("allow-dig-and-use", value);
JsonObject message = JsonUtil.createEnableModuleObjectWithType("combat", properties);
JsonPacketUtil.broadcastPacket(message);
}DISABLE_MISS_PENALTY- Whether the player gets a hit delay for a missed hit. Enabling this option may cause compatibility issues with anti-cheats.
- Values
- Type:
Boolean - Default:
false
- Type:
DISABLE_BLOCK_MISS_PENALTY- Whether the player gets a hit delay for a missed hit while targeting a block. Applies to all versions 1.8 and above. Enabling this option may cause compatibility issues with anti-cheats.
- Values
- Type:
Boolean - Default:
false
- Type:
ALLOW_DIG_AND_USE- Whether the player can dig and use an item at the same time, like in 1.7. Applies to all versions 1.8 and above. Enabling this option may cause compatibility issues with anti-cheats.
- Values
- Type:
Boolean - Default:
false
- Type: