shadow_legend884

do that players can't be able equip elytra in chestplate section while in vision combat

and cant be able to fly with that

why players can use elytra in vision combat they fly like creative fight

Kodari AI
KodariJan 5 at 6:31 pm 9,355 (v2)

I’ll prevent players from equipping elytra and flying with it during vision combat.

Plan:

  • Block elytra equipping in armor slot during combat

  • Cancel elytra gliding when in combat

  • Add elytra to disabled items by default

Done! Players can no longer:

  • Equip elytra in the chestplate slot during vision combat

  • Fly with elytra during vision combat (gliding is cancelled)

  • ELYTRA added to disabled items list by default

shadow_legend884

do that while in vision log combat players cant switch or equip elytra to chestplate or chestplate to elytra full restriction

Kodari AI
KodariJan 5 at 6:32 pm 8,035 (v2)

I’ll add elytra/chestplate swap restriction for players in combat.

I’ll add comprehensive elytra/chestplate swap restriction for combat-tagged players.

Complete elytra/chestplate swap restriction implemented. Combat-tagged players cannot:

  • Right-click elytra to equip

  • Click/shift-click elytra or chestplates in inventory slot 38

  • Shift-click elytra/chestplates from inventory to armor slot

  • Swap elytra/chestplates using F key

  • Toggle elytra gliding

shadow_legend884

change to jar name 1.0.5

Kodari AI
KodariJan 5 at 6:33 pm 3,878 (v2)

Updated version to 1.0.5 in build.gradle.

shadow_legend884

make the default config like this

vision-check-interval: 10 detection-range: 20.0 combat-time: 15

per-world: enabled: true mode: whitelist worlds: - world - world_nether - world_the_end - koth

worldguard: enabled: true mode: blacklist regions: - spawn - safezone

combat-logger: enabled: true kill-on-logout: false drop-inventory: false broadcast-message: true

penalties: slowness-duration: 15 slowness-amplifier: 5 poison-duration: 15 poison-amplifier: 1 weakness-duration: 20 weakness-amplifier: 1

command-blocking: enabled: true blocked-commands: - tp - teleport - homes - spawn - warp - tpa - tpaccept - home - rtp - rtpq - rtpqueue - tpahere - home - team

disabled-items: enabled: true items: - ELYTRA

action-bar: enabled: true

Kodari AI
KodariJan 5 at 6:48 pm 4,294 (v2)

I’ll update the config.yml with your specified structure.

Updated config.yml with your specifications:

  • Per-world enabled by default with koth added

  • Combat logger now doesn’t kill/drop on logout

  • Increased penalty durations and amplifiers

  • Expanded blocked commands list

  • Disabled items reduced to only ELYTRA

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
25 1,764
src/main/java/com/atheron/visionlog/AtheronVisionLog.java
package com.atheron.visionlog;

import com.atheron.visionlog.combat.CombatManager;
import com.atheron.visionlog.commands.VTrustCommand;
import com.atheron.visionlog.commands.VUntrustCommand;
import com.atheron.visionlog.config.ConfigManager;
import com.atheron.visionlog.hooks.WorldGuardHook;
import com.atheron.visionlog.listeners.CombatListener;
import com.atheron.visionlog.listeners.CommandBlockListener;
import com.atheron.visionlog.listeners.ItemUseListener;
import com.atheron.visionlog.listeners.PlayerConnectionListener;
import com.atheron.visionlog.listeners.VisionListener;
import com.atheron.visionlog.tasks.ActionBarTask;
import com.atheron.visionlog.tasks.VisionCheckTask;
import com.atheron.visionlog.trust.TrustManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AtheronVisionLog extends JavaPlugin {
    
    private CombatManager combatManager;
    private TrustManager trustManager;
    private WorldGuardHook worldGuardHook;
    private VisionCheckTask visionCheckTask;
    private ActionBarTask actionBarTask;
    private ConfigManager configManager;
    private ItemUseListener itemUseListener;
    
    @Override
    public void onLoad() {
        if (getServer().getPluginManager().getPlugin("WorldGuard") != null) {
            this.worldGuardHook = new WorldGuardHook(this);
        }
    }
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.combatManager = new CombatManager(this);
        this.trustManager = new TrustManager(this);
        
        this.itemUseListener = new ItemUseListener(this);
        
        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerConnectionListener(this), this);
        getServer().getPluginManager().registerEvents(new VisionListener(this), this);
        getServer().getPluginManager().registerEvents(new CommandBlockListener(this), this);
        getServer().getPluginManager().registerEvents(itemUseListener, this);
        
        getCommand("visionlog").setExecutor(new com.atheron.visionlog.commands.VisionLogCommand(this));
        getCommand("vtrust").setExecutor(new VTrustCommand(this));
        getCommand("vuntrust").setExecutor(new VUntrustCommand(this));
        
        this.visionCheckTask = new VisionCheckTask(this);
        this.visionCheckTask.runTaskTimer(this, 0L, getConfig().getLong("vision-check-interval", 10L));
        
        this.actionBarTask = new ActionBarTask(this);
        this.actionBarTask.runTaskTimer(this, 0L, 20L);
        
        getLogger().info("AtheronVisionLog has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (visionCheckTask != null) {
            visionCheckTask.cancel();
        }
        if (actionBarTask != null) {
            actionBarTask.cancel();
        }
        
        getLogger().info("AtheronVisionLog has been disabled!");
    }
    
    public void reload() {
        configManager.reloadConfigs();
        combatManager.clearAll();
        
        if (itemUseListener != null) {
            itemUseListener.loadDisabledItems();
        }
        
        if (visionCheckTask != null) {
            visionCheckTask.cancel();
        }
        if (actionBarTask != null) {
            actionBarTask.cancel();
        }
        
        this.visionCheckTask = new VisionCheckTask(this);
        this.visionCheckTask.runTaskTimer(this, 0L, getConfig().getLong("vision-check-interval", 10L));
        
        this.actionBarTask = new ActionBarTask(this);
        this.actionBarTask.runTaskTimer(this, 0L, 20L);
    }
}