Hit Detection/Hit Delay Plugin

Status
This thread has been locked.

RowinHere

Banned
Feedback score
10
Posts
276
Reactions
179
Resources
0
Warning: This doesn't only affect pvp. You will also get faster burn/drown damage etc.

The default hit delay is 20 ticks (1000ms) but because of plugins this delay will be higher. You can use this plugin to put the hit delay on 19 ticks (950ms) to get a better hit detection.

https://www.spigotmc.org/resources/simplenohitdelay.33809/

There's no need for async hit detection or custom edited optimized versions :)

FAQ:
Does this work on ...?
It should work with every version.

Can you put it on ... milliseconds?
The hit delay must be in ticks. 1 tick is 50 milliseconds.
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Valicon

Web Developer
Premium
Feedback score
0
Posts
4
Reactions
4
Resources
0
Very interesting, haven't tried it out personally but I can imagine it being very useful!
 

Bienyyy

Feedback score
0
Posts
164
Reactions
69
Resources
0
You might just wanna add a Commander to Change the Hit detection Value instead of making multiple Plugins xD
 

RowinHere

Banned
Feedback score
10
Posts
276
Reactions
179
Resources
0
For everyone who downloaded this, I removed some code because it was unnecessary. I also added a warning.
 
Banned forever. Reason: Leaking user resources (https://prnt.sc/m91daf)

RowinHere

Banned
Feedback score
10
Posts
276
Reactions
179
Resources
0
Code:
package me.rowin.hitdetection;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class HitDetection extends JavaPlugin implements Listener {

    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setMaximumNoDamageTicks(plugin.getConfig().getString("HitDetectionTicks"));
    }
}

Wouldn't that be better? You could just set how many you want it to be in console.

Then you'd use:
Code:
        FileConfiguration config;
        File cfile;
     
        public void onEnable() {
                config = getConfig();
                config.options().copyDefaults(true);
                saveConfig();
                cfile = new File(getDataFolder(), "config.yml");
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
                if (cmd.getName().equalsIgnoreCase("hdreload")) {
                   if(sender.hasPermission("hd.reload") {
                        config = YamlConfiguration.loadConfiguration(cfile);
                        sender.sendMessage(ChatColor.GREEN + "Configuration reloaded!");
                }
                return true;
        }
}

To reload the config so you don't need to restart the server every time.

This plugin is to optimize the hit detection, not to make a nohitdelay server.
 
Banned forever. Reason: Leaking user resources (https://prnt.sc/m91daf)

RowinHere

Banned
Feedback score
10
Posts
276
Reactions
179
Resources
0
I never said it was? But to stop people having to re-code the plugin, you could add in the features I mentioned and then more people would download it be cause it'd be easier to use.

Sure, I'll add it.[DOUBLEPOST=1482839596][/DOUBLEPOST]
I never said it was? But to stop people having to re-code the plugin, you could add in the features I mentioned and then more people would download it be cause it'd be easier to use.
By the way, if the console runs the command /hdreload you'll get errors because the console can't have permissions ;)

Also it should be cmd.getName().equalsIgnoreCase("hdreload") :p
 
Last edited:
Banned forever. Reason: Leaking user resources (https://prnt.sc/m91daf)
Status
This thread has been locked.
Top