Better hit detection plugin/skript

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
I'm able to make this for pretty cheap!

Add me on discord: kammy#1337
 

QuantumHawk

вυѕιɴeѕѕ мoɴĸey // yoυтυвer
Premium
Feedback score
6
Posts
126
Reactions
15
Resources
0
Hey There!
Here at Sintyx we can provide you with one of our plugin developers to get the job done that matches your idea and budget! Once you have joined just type ''-new'' in the chat to create you a ticket and one of our staff members will help you out. If you need help or you would find it easier you can always DM me through discord.

My Discord: QuantumHawk_ ✌#5932
Sintyx Services: https://discord.gg/CasBz2H
 

kojoti

www.xurver.com
Supreme
Feedback score
17
Posts
1,100
Reactions
375
Resources
0
Code:
    public void onEnable() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.setMaximumNoDamageTicks(19);
        }
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setMaximumNoDamageTicks(19);
    }
 

kojoti

www.xurver.com
Supreme
Feedback score
17
Posts
1,100
Reactions
375
Resources
0
Why onEnable?

Server is just loading the plugin without any players being online what?
Good point, does not really stand up but it does work

kampai Why funny rating? I am a beginner in coding, And I want to help people
 

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
Code:
    public void onEnable() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.setMaximumNoDamageTicks(19);
        }
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setMaximumNoDamageTicks(19);
    }
He’s asking how to improve hit detection not hit delay
 

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
Read what you just said. Slowly.
I did and it still makes sense? Hit detection is when the server detects a hit which he wants to improve. Hit delay is the delay between hits. What’s so confusioning about it
 

Ally

gσ∂∂єѕѕ σƒ мαтнѕ αη∂ мєℓσηѕ χσ
Supreme
Feedback score
37
Posts
2,043
Reactions
2,194
Resources
0
Why onEnable?

Server is just loading the plugin without any players being online what?
Wrong, onEnabled can be called at any time the plugin is enabled. PlugMan is a good plugin to demonstrate this, as well as force reloading a plugin (which, needless to say, is bad practice)
 

Ally

gσ∂∂єѕѕ σƒ мαтнѕ αη∂ мєℓσηѕ χσ
Supreme
Feedback score
37
Posts
2,043
Reactions
2,194
Resources
0
Still useless.
You cannot say it is enabled any time as it is not.
It is called only first time while enabling which could first be called onLoad.
And still that should not be in the onEnable LOL.
It shouldn't be in there, correct. But onEnable is called per the plugin, not the server.
 

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
Still useless.
You cannot say it is enabled any time as it is not.
It is called only first time while enabling which could first be called onLoad.
And still that should not be in the onEnable LOL.
If you reload a server with players online it will reset this. And when the plugin relods through the command /reload the server didn’t shut down hence there are players still online
 

Nerm

Deactivated
Feedback score
21
Posts
851
Reactions
714
Resources
0
Code:
    public void onEnable() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.setMaximumNoDamageTicks(19);
        }
    }

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setMaximumNoDamageTicks(19);
    }
That code would be executed when a Player Joins as well as when the plugin enabled as if the server's reloaded. You might also want to change it to 18.35 - 18.85 if you want the best accuracy.
 

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
That code would be executed when a Player Joins as well as when the plugin enabled as if the server's reloaded. You might also want to change it to 18.35 - 18.85 if you want the best accuracy.
What? Unless something new happened I’m pretty sure ticks can’t be a decimal
 
Status
This thread has been locked.
Top