Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/developers/modules/combat.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Tab, Tabs } from 'nextra-theme-docs'

# Combat Module

## Overview
Expand All @@ -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.

<Tabs items={['Apollo API', 'apollo-protos library', 'Manual JSON Object Construction']}>

<Tab>

### Toggle Miss Penalty

```java
public void setDisableMissPenalty(boolean value) {
this.combatModule.getOptions().set(CombatModule.DISABLE_MISS_PENALTY, value);
}
```

</Tab>

<Tab>

### Toggle Miss Penalty

```java
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);
}
```

</Tab>

<Tab>

### Toggle Miss Penalty

```java
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);
}
```

</Tab>

</Tabs>

## Available options

- __`DISABLE_MISS_PENALTY`__
Expand Down