diff --git a/docs/developers/modules/combat.mdx b/docs/developers/modules/combat.mdx index 8c86c15b..06e6382c 100644 --- a/docs/developers/modules/combat.mdx +++ b/docs/developers/modules/combat.mdx @@ -1,3 +1,5 @@ +import { Tab, Tabs } from 'nextra-theme-docs' + # Combat Module ## Overview @@ -6,6 +8,57 @@ The combat module allows you to modify certain aspects of combat that are usuall - Adds the ability to disable the miss penalty, on all versions 1.8 and above. +### Sample Code +Explore each integration by cycling through each tab, to find the best fit for your requirements and needs. + + + + + +### Toggle Miss Penalty + +```java +public void setDisableMissPenalty(boolean value) { + this.combatModule.getOptions().set(CombatModule.DISABLE_MISS_PENALTY, value); +} +``` + + + + + +### Toggle Miss Penalty + +```java +public void setDisableMissPenalty(boolean value) { + Map properties = new HashMap<>(); + properties.put("disable-miss-penalty", Value.newBuilder().setBoolValue(value).build()); + + ConfigurableSettings settings = ProtobufPacketUtil.createModuleMessage("combat", properties); + ProtobufPacketUtil.broadcastPacket(settings); +} +``` + + + + + +### Toggle Miss Penalty + +```java +public void setDisableMissPenalty(boolean value) { + Map properties = new HashMap<>(); + properties.put("disable-miss-penalty", value); + + JsonObject message = JsonUtil.createEnableModuleObjectWithType("combat", properties); + JsonPacketUtil.broadcastPacket(message); +} +``` + + + + + ## Available options - __`DISABLE_MISS_PENALTY`__