#help-development

1 messages · Page 1477 of 1

sharp bough
#

for villagers?

#

and like everything "huma2?

#

why would you open an inv for a villager

ivory sleet
#

I think HumanEntity represents a human entity and the player is an entity with a player connection or smtng

#

I believe it might be an nms design which spigot just forwards

sharp bough
#

why does he use != in inv click event
and .equals in inv drag event?

ivory sleet
#

idk

#

I think a reference comparison should be all good 99% of the times

valid vigil
#

Sorry for posting again but I think nobody saw my message:

So I wanna replace the inventory the player's opening when interacting with an ender chest with a custom one.
However when I set the InventoryOpenEvent to cancelled the ender chest block just stays open and is never closed. Is there any way I can force it to close when the player closed the inventory?

sharp bough
#

so you can open it but not close it?

valid vigil
#

no I just cancel the event and that results in the block still looking like it's open

#

and never closing

sharp bough
#

oh its a visual bug?

valid vigil
#

yes just visual

sharp bough
#

sorry no idea how that works

quaint mantle
#

Still need help with that

ivory sleet
valid vigil
#

then how can I get the enderchest to open though?

#

visually

ivory sleet
#

Inventory#open

#

or

#

it

#

might be HumanEntity#openInventory

#

idr

valid vigil
#

I mean I want the ender chest block to open up for as long as the player is in the ender chest inventory, like it usually does

tacit drift
quaint mantle
#

When a player uses a critical hack it is on ground tho?

tacit drift
#
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.k_() && !this.V() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;

                    if (flag && f > 0.0F) {
                        f *= 1.5F;
                    }
#

@quaint mantle

onyx shale
#

think its mostly a packet hack

quaint mantle
#

ok

onyx shale
#

sending that slight above the ground location

stone sinew
#

Been this long and still no boolean for critical though lol

quaint mantle
#

Would be a useful feature

jagged badge
#

I try to increase the speed of the player when he is in the water. I tried to use velocity in a PlayerMoveEvent, but even if I move more with my keyboard, the player keeps moving with velocity (and the event is called continuously)

tribal holly
#

is there a way to paste a schematic of WE without WE ?

tardy delta
#

is event.getInventory().getTitle() removed?

severe folio
#

isnt it InventoryView#getTitle()

#

player.getOpenInventory().getTitle()?

tardy delta
#

so like this?

public void onPlayerInventoryClick(InventoryClickEvent event) {
        if ((event.getView().getTitle().equalsIgnoreCase("Trade")) {
            
        }
severe folio
#

try it

sly storm
#

how do you get the arrow shot from the bow's velocity

severe folio
#

Projectile#getVelocity()

#

ProjectileLaunchEvent im guessing

sly storm
#

how do i store it

#

is it a float value or what

severe folio
#

store an instance of the projectile?

#

ProjectileLaunchEvent#getEntity()

sly storm
#

the velocity

#

rn im doing this

#
public class ShootBow implements Listener
{
    @EventHandler
    public void ShootingBow(EntityShootBowEvent event, ProjectileLaunchEvent event1)
    {
        Player player = (Player) event.getEntity();
        float speed = event.getForce();
        player.sendMessage("You have shot a bow!" + "Velocity: " + speed);
        Arrow arrow1 = player.launchProjectile(Arrow.class);
        Arrow arrow2 = player.launchProjectile(Arrow.class);

        Vector v1 = player.getLocation().getDirection().clone();
        Vector v2 = player.getLocation().getDirection().clone();

        v1.rotateAroundY(0.1);
        v2.rotateAroundY(-0.1);

        arrow1.setVelocity(v1);
        arrow2.setVelocity(v2);
    }
}
#

idk if it will work

lilac dagger
#

guys

severe folio
#

oh if you're using the EntityShootBowEvent you shouldnt need the ProjectileLaunchEvent

lilac dagger
#

oups

sly storm
#

yeah

lilac dagger
#

am i no longer verified? :p

sly storm
#

man i hate java

#

what's the syntax to turn float into string

lilac dagger
#

String.valueOf(float);

severe folio
#

why did it reply to that

#

tf

ivory sleet
sly storm
severe folio
sly storm
#

yeah true

#

im just tryna get the basic code working

#

then ill check for all that stufdf

severe folio
#

String speedStr = String.valueOf(speed);

sly storm
#

c++ > java

#

anyway

severe folio
#

lol

#

im not experienced enough in c++ to be able to say that

sly storm
#

trust me

severe folio
#

I prefer C# anyhow

sly storm
#

it's way better once you learn it

#

c# is meh

vale cradle
sly storm
#

i know

#

it all comes done to what you're doing

#

im just saying i prefer c++

lilac dagger
#

you can be sure i'm the one

vale cradle
sly storm
#

im not

#

thats why i said c++ > java

lilac dagger
sly storm
#

i guess

#

ive done my fair share though

lilac dagger
#

c++ is far from perfect either

sly storm
#

i havent worked in java for over a year

lilac dagger
#

it lacks safety

sly storm
#

how so

lilac dagger
#

java's mistake is that it feature null

#

but c++ has a lot of things like that

#

c++ doesn't feature type safety

#

you can use an int as a boolean

sly storm
#

why would you

vale cradle
#

C++ just lets you to do Unsafe stuff

#

You need to be a good programmer to protect your code about bad practices

lilac dagger
#

^

sly storm
#

ah well

#
{
    @EventHandler
    public void ShootingBow(EntityShootBowEvent event, ProjectileLaunchEvent event1)
    {
        Player player = (Player) event.getEntity();
        
        player.sendMessage("You have shot a bow!");
        Arrow arrow1 = player.launchProjectile(Arrow.class);
        Arrow arrow2 = player.launchProjectile(Arrow.class);

        Vector v1 = player.getLocation().getDirection().clone();
        Vector v2 = player.getLocation().getDirection().clone();

        v1.rotateAroundY(0.1);
        v2.rotateAroundY(-0.1);
        
        arrow1.setVelocity(v1);
        arrow2.setVelocity(v2);
    }
}```
#

i give up

#

somebody tell me how to set the 2 other arrow's speed to the main one

rare hazel
#

this is a default BungeeCord server message right?

*** SERVER IS RUNNING OFFLINE/INSECURE MODE!
The server will make no attempt to authenticate usernames. Beware.
Whilst this makes it possible to use BungeeCord, unless access to your server is properly restricted,
it also opens up the ability for hackers to connect with any username they choose.

ivory sleet
#

It isn’t

lilac dagger
#

it is already a new vector

sly storm
#

alright

#

no more cloning

lilac dagger
#

also

#

java functions use camel case

#

along with the methods

sly storm
#

yeah i heard about that

lilac dagger
#

only clases start with Uppercase

sly storm
#

the documentation for spigot is trash

lilac dagger
#

so you don't confuse them

sly storm
#

i gotchu

lilac dagger
#

well

#

i wish it was better

#

i'll rather have no comment than one that is half the truth of what that method does

sly storm
#

😦

#

i just want to the stupid plugin to work

lilac dagger
#

oh

#

and the biggest thing

#

public void ShootingBow(EntityShootBowEvent event, ProjectileLaunchEvent event1)

#

this won't work

#

it looks only for the mono parameter methods

sly storm
#

bruh

#

well then

lilac dagger
#

so you want to rotate it?

#

@sly storm

#

?

#

if so

#

use the first parameter then

#

and get the projectile via event.

#

then rotate that

sly storm
#

not rotate

#

get the velocity

#

rn i got the force of the arrow

#

from getForce();

#

now i need to set that value

#

to the other arrows

lilac dagger
#

event.getEntity().getVelocity

#

that simple :p

sly storm
#

do i store that in a Vector?

lilac dagger
#

give it to the other arrows

#

if you're using the launchprojectile

#

i think it has a second parameter to where you can give a default velocity

#

if not spawn an entity arrow

#

and give it there

tardy delta
#

is there a faster way to put this? for example i want to put number 17 - 28

quaint mantle
#

Hello, I'm using Lua to make a program, and I want to make a platform appear a dissapear. But it won't work... Can anyone point out a possible mistake, please?

`local platform = script.Parent

local function disappear()
platform.CnaCollide = false
platform.Transparency = 1
end

local function appear()
platform.CanCollide = true
platform.Transparency = 0
end

while true do
wait(3)
disappear()
wait(3)
appear()
end`

sharp bough
#

is it worth it to implement sql or should i just storage info in the config file

#

wich one is better

tardy delta
lilac dagger
#

put it if the slot is empty

#

if that's what you wanna achieve by glass

tardy delta
#

like this its a trade gui

lilac dagger
#

you could use a loop with column and row extemption

tardy delta
#

uhm i dont how to do that

lilac dagger
#

well

#

int slot;
int row = slot % 9;
int column = slot / 9;

#

for (int i = 0; i < inv.size; i++) {
if (row == 0 || row == 1 || row == 5 || column == 0 || column == 4 || column == 8) {
//Do something
}
}

sly storm
# lilac dagger well
        Arrow arrow2 = player.launchProjectile(Arrow.class, event.getEntity().getVelocity());```
#

i tried what you said

lilac dagger
#

does it work?

sly storm
#

nope

#

the arrows have no velocity

lilac dagger
#

it has that parameter?

sly storm
#

that just fall straight down

#

yeah i checked the documentation

lilac dagger
#

ah 🤔

sly storm
#

soo

lilac dagger
#

maybe's PlayerLaunchEvent

lusty cipher
#

If so, that would only be a very low amount of velocity, if any

sly storm
#

yea

#

i tried Vector arrowSpeed = event.getProjectile().getVelocity();

#

its giving the correct speed

#

but now the arrows are being spawned in the same location as the first 1

compact haven
#

also Lua isnt the same as roblox's lua, albeit quite similar, and this channel is for plugin dev :)

vital ridge
#

Yo, could anyone help me understand this code?

public static int rainbow(final int delay) {
        double rainbowState = Math.ceil(System.currentTimeMillis() + delay / 2L);
        rainbowState %= 360.0;
        return Color.getHSBColor((float) (rainbowState / 360.0), 0.2f, 2f).getRGB();
    }
#

I dont understand the logic behind it

#

thats all

#

And Color.getHSBColor is something i dont understand aswell

sly storm
#

anyone know how to add an arrow trail

lilac dagger
#

spam particles behind it every second

severe folio
#

use a runnable to spawn particles behind it periodically

sly storm
#

how

#

i just started yesterday

severe folio
#
new BukkitRunnable() {
  public void run() {
      // your code
  }
}.runTaskTimer(YourPlugin.getInstance(), startDelayInTicks, periodInTicks);
#

or use Bukkit.getScheduler or whatever it is

sly storm
#

how do i do the particle part

severe folio
#

using World#spawnParticle

sly storm
severe folio
#

1 sec

sly storm
#

kk

severe folio
#

doesnt work in what sense

sly storm
#

idk how to use it

severe folio
#

which part of it

sly storm
#

all of it

#

like the parameters

severe folio
#

BukkitRunnable's runTaskTimer: the first parameter is an instance of your plugin, the second is a long, which is the amount of ticks before it starts, third being the delay in ticks before it repeats

sly storm
#

would this work

#

.runTaskTimer(new TripleArrows(), 0, 1);

#

TripleArrows is the name of the plugin

dusk flicker
#

Look at the Javadocs

#

It shows how to do it

sly storm
#

kk

dusk flicker
#

and for the record, no that woulden't work

severe folio
#

^

#

cant create another instance of your plugin class iirc

sly storm
#

how do i reference it

#

thats what i dont understand

dusty herald
#

dependency inject

severe folio
# sly storm thats what i dont understand

I do this but idk if its the best way

private static TripleArrows instance;

public void onEnable() {
    instance = this;
    /* the rest of ur onEnable */
}

public static TripleArrows getInstance() {
    return instance;
}

and use TripleArrows.getInstance()

lilac dagger
#

yup, not the best

severe folio
#

thought as much

lilac dagger
#

you should just expand with constructors

#

create a chart in order to separate and isolate components

#

if you feel like it

severe folio
#

aight

sharp bough
#

is it possible to attach a particle to a player so whenever he moves so does the particle?

#

my idea was add the player uuid and the particle he has to a list, then every 1 second or so spawn all particles under the player

ivory sleet
#

yeah

sharp bough
#

but idk how friendly this is

#

and making the particle follow the player is way better

ivory sleet
#

I mean sure

sharp bough
#

sure what

#

there

queen dragonBOT
severe folio
#

Lmao delayed

sharp bough
#

...

quaint mantle
#

ive done this so many times before it has always worked but for some reason is not working now, if someone could help me spot something that could be causing the program to not output the message to the user using the command /discord
https://paste.md-5.net/arutukifek.java

sharp bough
#

did you register the command in the main class?

quaint mantle
#

im so retarded, thanks

sharp bough
#

Objects.requireNonNull(getCommand("discord")).setExecutor(new excetor());

#

np

dusk flicker
#

No real need to do that

quaint mantle
#

well its not working for some reason anyways

dusk flicker
#

You don't need the requireNotNull

quaint mantle
#

yeah i know

dusk flicker
#

Send your main class if you can

sly storm
# severe folio I do this but idk if its the best way ```java private static TripleArrows insta...

like this? ```
package mc.polarfps.triplearrows;

import org.bukkit.plugin.java.JavaPlugin;

public final class TripleArrows extends JavaPlugin {
private static TripleArrows instance;
@Override
public void onEnable() {
System.out.println("I'm Working!");
instance = this;
getServer().getPluginManager().registerEvents(new ShootBow(), this);
}

public static  TripleArrows getInstance()
{
    return instance;
}

@Override
public void onDisable() {
    // Plugin shutdown logic
}

}

sharp bough
#

also, you are checking if the label is discord, when the command is discord

#

so label is already discord

dusk flicker
#

ignore that last comment that was deleted of mine misread that

sharp bough
#

@quaint mantle

quaint mantle
#

yeah i also just fixed that too i kina pasted it from something else and i mixed it up

dusk flicker
#

While returning true is for the most part good, you need to make sure they know why to return true and when to return false. If you return false it will send the usage message that would be provided in the plugin.yml, It won't send anything if that usage doesn't exist

quaint mantle
#

thank you, we all need a second eye sometimes

sharp bough
#

you should also add something like

player.sendMessage(convert("message here"))

    public String convert(String s){
        return ChatColor.translateAlternateColorCodes('&',s);
    }


dusty herald
#

I mean you could return false if you want to return the usage stated in the plugin.yml

quaint mantle
#

No i just had all that extra stuff there from pasting other code but yeah true

#

thats why you never paste code lmao

#

ok still does not work for soem reason

sharp bough
#

show code

quaint mantle
#

package me.grindinghalt.outputtochat;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

@Override

}
@Override
public void onDisable() {
//shutdown
//reloads
//plugin reloads
}

// /discord <-- discord srvr link
public boolean onCommand0(CommandSender sender, Command cmd, String label, String[] args) {
    if (label.equalsIgnoreCase("discord")) {
        if(sender instanceof Player)return true; {
        //plr    
            Player player = (Player) sender;
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f<&1&l|| &3 &c&l<- click link"));
            return true;
    }


    }
    return true;

}

}

sharp bough
#

what happend to the onEnable()? lmao

quaint mantle
#

wait i deleted it after i tried it

sharp bough
#

if(! <---sender instaceof Player) return true

#

that turns the if condition

#

what you are doing now is

#

if sender is a player then return True

quaint mantle
#

if(!sender instanceof Player)return true; {

sharp bough
#

no remove the {

#

its a 1 line of

#

and do ctrl alt L , ctrl alt O in your code

quaint mantle
#

ah i see

#

if(!(sender instanceof Player))return true;

sharp bough
#

so its clean

quaint mantle
#

just checking this

#

public void onEnable() {
getCommand("discord").setExecutor(new Main());

sharp bough
#

why Main()

quaint mantle
#

would i really need new Main if its in the same class

#

yeah

sharp bough
#

you should make a class DiscordCommand

#

and make that the command excetuor

quaint mantle
#

i just want it to be in one

sharp bough
#

then you can do setExcetuor(this)

#

i believe

quaint mantle
#

this works

#

oh my god its still not workin

#
package me.grindinghalt.outputtochat;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

    @Override
public void onEnable() {
        getCommand("discord").setExecutor(this);
}
    @Override
    public void onDisable() {
        //shutdown
        //reloads
        //plugin reloads
    }
    
    // /discord <-- discord srvr link
    public boolean onCommand0(CommandSender sender, Command cmd, String label, String[] args) {
        if (label.equalsIgnoreCase("discord")) {
            if(!(sender instanceof Player))return true;
            //plr    
                Player player = (Player) sender;
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f<&1&l|| &3ht://discord/FGJGKAQ &c&l<- click link"));
                return true;
        }    
        return true;

    }
}
sharp bough
#

do you get an error

#

?

#

why is it onCommand0

quaint mantle
#

ok ill try again

sharp bough
#

you can simplify if conditions into a single line

#

for example

#

if(!label.equals("discord")) reutrn true;

#

and mix that with the player one

#

so

quaint mantle
#

so like this

#

if (label.equals("discord")) {
if(!(sender instanceof Player))return true;

#

oh i see wait

sharp bough
#

if (!(label.equalsIgnoreCase("discord")) || !(sender instanceof Player)) return true

#

you are missing the @Override

#

on top of the onCommand

quaint mantle
#

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
just on top?

sharp bough
#

theres no need to return true twice

#

you can simply put that at the end

sharp bough
#

like that

#

you should add a desc to your command in the plugin.yml

quaint mantle
#

finnaly it works

sharp bough
#

nice gj

quaint mantle
#

thx man

sharp bough
#

np

opal juniper
#

I am trying to use this really old language detection library however i keep getting this error:
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.cybozu.labs.langdetect.util.messages, locale en_GB

#

I have the code here where they load the resource file:
private static final String BUNDLE_NAME = "com.cybozu.labs.langdetect.util.messages";
However as far as i can see there is a file at that file path:

#

I cannot really change the src files as i have installed them to my maven repo and am just shading them

#

I wondered if anyone knew why the file wasn't being picked up?

ivory sleet
#

Just out of curiosity, shouldn't the resource bundle classes be able to achieve localization

opal juniper
#

Not really sure what that means tbh :-))))

#

Its just been a real pain to try and integrate this into the plugin

indigo iron
#

do mobs in minecraft regenerate hp naturally?

opal juniper
#

afaik, no

kind coral
#

It's only me who heard that protocollib has been compromised and it's update is ratted?

valid totem
#

how do i get playerinteractevent item

#

help

sullen marlin
ivory sleet
#

lol

formal dome
#

anyone know a good place to start for creating my own mods

quartz goblet
#

how do I change player tabs and display names / prefixes to be individual? Basically one player might see everyones name as red and another would see it as blue

ivory sleet
ivory sleet
formal dome
quartz goblet
quartz goblet
#

thank you. Also PlayerChatEvent is deprecated and i cant find the new one>

#

?

ivory sleet
#

AsyncPlayerChatEvent

formal dome
#

Sweet, looks like forge is more im depth, with what i want to do, i may prefer that

#

Unless you think starting with fabric is worth a shot

quaint mantle
#

i managed to make it work, thanks though

sweet oak
#

how do I check if a player opened there inventory

dusty herald
#

can't

#

i mean if they interact sure, but if they just open their inventory there isn't anything called

pulsar zenith
dusty herald
#

it is handled client side

sweet oak
sweet oak
#

how to make some code execute when holding a certain item without clicking?

granite stirrup
#

why are the gamebanana servers so bad

#

its gonna take like 3 hours to install a 200mb file on gamebanana

quaint mantle
#

any idea why cancelling an EntityAirChangeEvent doesn't stop the air from decreasing?

hidden torrent
#

Has anyone here ever implemented placeholder support for one of their plugins?

dusty herald
#

Yes

patent ice
#

Yes

vagrant stratus
#

Yes

patent ice
#

Yes

vagrant stratus
#

you've said yes already! 👀

patent ice
#

Maybe I've done it twice👁️👁️.

tawdry scroll
#

yes

summer scroll
#

idk what's the other best options.

summer scroll
#

that could work too.

coral sparrow
dusty herald
#

Yes

hidden torrent
#

I'm having trouble wrapping my head around what placeholders are and how I can implement support for them in my plugin. I did notice that there was a plugin on SpigotMC called PlaceholderAPI. Is this what I am supposed to use? Any and all help would be appreciated 🙂
https://www.spigotmc.org/resources/placeholderapi.6245/

dusty herald
#

Yes

hidden torrent
coral sparrow
#

btw forgot

#

to define text

#

lmao

dusty herald
#

why did you message that 3 separate times dan

coral sparrow
hidden torrent
hidden torrent
dusty herald
#

bruh wdym

#

I got pinged 3 times

hidden torrent
coral sparrow
#

xD

tribal holly
#

someone know how to cast bukkit chunk to nms chunk ?

sonic bronze
#

Just a quick question regarding Sets.
After removing an element of a set, does set.size() still work and returns 0 or null, after deleting the last element?

opal juniper
tribal holly
#

i try

opal juniper
#

Huh

#

Idrk then, sorry

tribal holly
#

i need an NMS chunk

#

not a craft chunk

quaint mantle
#

why do you want to do this

#

@tribal holly

sage swift
rotund ravine
#

He should be able to

tribal holly
sage swift
#

my genius saves the day once again

quaint mantle
#

i just can't seem to think of any instance where this would be useful

outer pond
#

I have used NMS chunks for asynchronous raytracing before, so there are a few use cases

kind coral
#

here in italy something is happening, people are literally spamming that spigot is ratted with malicious plugins, and that they are injecting stuff into well known plugins

chrome beacon
#

Well you could just decompile and take a look yourself

chrome beacon
#

Optic fusion is also working hard on removing potentially bad plugins

sullen marlin
#

spigot is not

#

some major leaking site was/is though

quiet ice
#

Is there an "easy" and "conventional" way of telling whether an Itemstack has changed? As far as I see I could probably do some really unsafe shit with Server#getItemFactory, but is that a good idea?

sullen marlin
#

wdym changed

quiet ice
#

Changed type or item meta

sullen marlin
#

changed type?

quiet ice
#

I want to cut down on PDC calls

#

Itemstack Material

sullen marlin
#

like you mean you want to see when a plugin calls setType ?

quiet ice
#

yes

#

though setType isn't too much of an issue for me since I can do that myself easily, itemmeta is a bigger concern for me

sullen marlin
#

no and item factory wouldnt help

#

why does your pdc need to change every time the item does?

quiet ice
#

The PDC doesn't need to change but I need to refresh my caches since the cached itemstack would be invalid

sullen marlin
#

just do that when you read from the cache?

#

the item wont be .equals to whatever is in your cache and therefore automatically replaced

#

you shouldnt even need to do anything unless your cache is really broken to begin with

quiet ice
#

isSimilar clones itemmeta, which would be pointless for me

sullen marlin
#

sorry I still dont get your issue

quiet ice
#

from what I'm seeing ItemStack#setItemMeta0 calls this.meta = Bukkit.getItemFactory().asMetaFor(itemMeta, material);, so my thought was that I could simply change the server and relay all calls and intercept getItemFactory#asMetaFor

sullen marlin
#

yeah but I dont see what this has to do with your cache at all

quiet ice
#

I want to do optimisation by cutting down on itemmeta clones by doing caching

sullen marlin
#

if the item is changed it will no longer be in your cache

#

because your cache would be by hashcode/equals which changes when the item is changed

quiet ice
#

So items are immutable?

sullen marlin
#

no, theyre mutable

#

your cache is not an identity cache

quiet ice
#

equals and hashcodes sadly do exactly what I wanted to avoid, at which point I could just drop it alltogether

sullen marlin
#

just use a clone as your cache key

#

(forgot to mention that crucial step)

quiet ice
#

Looking at the ItemStack class I could obtain the meta field via reflection and perform instance comparison to check validity which might be the easiest in both codewise and speed

sullen marlin
#

I dont get why you cannot just use a clone as your cache key

quiet ice
#

hashcode invokes getItemMeta() which invokes this.meta.clone(). My main concern with the whole operation was to cut down on meta.clone() calls, while the rest of the logic is still a bit expensive, meta.clone() is the most expensive part, so I want to reduce this and only call it whenever needed

#

I'm calling these methods like 6 times per player per tick and per event, which is not the best thing to do. I could just use bukkit events to know whether the item changed but those are not the most reliable thing with other plugins that I cannot control

sullen marlin
#

cant you just call getItemMeta once?

quiet ice
#

that is my idea

sullen marlin
#

I mean like why do you call it 6 times now

quiet ice
#

once for every armor slot, offhand and hand

sullen marlin
#

ah

#

have you thought about making .clone faster?

wraith rapids
#

pretty sure hashcode and equals both call meta.clone twice

quiet ice
#

I cannot do that without altering spigot code

wraith rapids
#

once for item damage and a second time for comparing the actual meta

sullen marlin
#

well you could alter spigot code and then open a pull request so everyone can benefit

#

@wraith rapids that'd be a nice thing for you to fix. I assume the durability check is only needed if the item is legacy

wraith rapids
#

myes, it would be a rather easy fix

eternal night
#

I'd dig a NNY spigot contribution

wraith rapids
#

it would also be a rather easy fix to make equals and hashcode use the cached itemmeta instance

#

since mutability isn't an issue there

sullen marlin
#

you should do these things

wraith rapids
#

perhaps

magic raven
#

Has anyone worked with translate components and know if you can use them within Container Titles?

wraith rapids
#

iirc yes

#

at some point you couldn't but I think the client supports them now

#

it should support them just about anywhere where text is involved now

quiet ice
#

I think there are a few exceptions

#

container titles might be one of them, but I cannot say for sure

magic raven
#

What’s the best way to covert the translates into a string so the container can use them?

quiet ice
#

if anything, just try and see

wraith rapids
#

they definitely used to be an exception

#

the server only bundles in the us_en localization

#

so you'll just have to hammer the translatable component into that

tacit drift
#

is spigot 1.17 in the workings? 😳

magic raven
#

TranslateComponent t = new TranslateableCompenent (“offset.-4”, “this is text”)
gui.updateTitle(t.toString)

Just returns the long breakdown? Am I going at it wrong?

quaint mantle
wraith rapids
#

or use paper which has component setters for container titles

#

or search the spigot api for one, it might have one too

#

remember to check under rocks and any spigot() methods you might find

eternal oxide
#

To change Inventory titles with spigot you have to reopen the view

quaint mantle
#

Action.RIGHT_CLICK_AIR does not want to be detected with an empty hand. There is alternative?

wraith rapids
#

the client doesn't send a packet for that iirc

magic raven
#

Anyone able to give me an idea what to look for as I have no clue how to do or work with json

eternal oxide
quaint mantle
#

i'll try

coral sparrow
#

gud

quaint mantle
#

@EventHandler(ignoreCancelled = true) breaks all. With right-clicking on air PlayerInteractEvent won't run.

eternal oxide
#

true is default, set to false

quaint mantle
#

no, it isn't

#

false is default

eternal oxide
#

You do you

quiet ice
#

It shouldn't ignore cancelled by default

#

but let me see

eternal oxide
#

The evetn he's talkign about ignores canceled

quaint mantle
quiet ice
#

boolean ignoreCancelled() default false;

eternal oxide
#

This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.

quaint mantle
#

hm

#

i need to use this event how alternative detecting Right click on air?

quiet ice
#

that should usually work

eternal oxide
#

@EventHandler(ignoreCancelled = false)

quiet ice
#

you can omit the ignore cancelled

quaint mantle
main tangle
#

So how can i create/play custom sounds?

quiet ice
#

If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called.

#

WTF MD

#

This has to be the worst design of all humanity

#

Okay, now that I think of it

#

The name is bad as it is ambigious

eternal oxide
#

People love to argue

main tangle
quiet ice
#

ignore cancelled means ignore cancelled event

quaint mantle
quiet ice
#

Not ignore cancelled state

eternal oxide
#

yes

quiet ice
#

Really ambigious

wraith rapids
#

ignoreCancelled is false by default

coral sparrow
#
public void onInteract1(PlayerInteractEvent event) {
    Action action = event.getAction();
    Player player = event.getPlayer();
            
    if(action.equals(Action.RIGHT_CLICK_AIR)){ teh code}
}```
wraith rapids
#

that is, event handlers, unless you specifically tell them to ignore cancelled events, will not ignore them

quiet ice
wraith rapids
#

iirc the client just doesn't send any packets for rightclicking air without an item in hand

coral sparrow
quiet ice
#

forge is incompatible with bukkit

coral sparrow
#

¯_(ツ)_/¯

#

deleted

coral sparrow
#

by

#

mod

quiet ice
#

forge mods do not help even if you wanted to

#

Resource packs is the way

coral sparrow
#

Idk I even played amogus thing using forge

wraith rapids
#

well yes but that involves running a not-bukkit server

quaint mantle
#

it's very bad, if it is

quaint mantle
torn shuttle
#

is there something that limits how quickly entities can deal damage?

#

like a hard cooldown between damage hits?

#

(non-player entities)

main tangle
quiet ice
#

iirc entities become invulnerable to damage for a short time after getting damaged

main tangle
#

thanks

torn shuttle
#

I have code where an entity damages multiple players in a single tick, but it looks like for whatever reason the code tends to only run for one of the players in range

quiet ice
#

Probably overriding some "useless" sounds, but don't ask

torn shuttle
#

it's confusing because it's a really straightforward piece of code

quaint mantle
#

Hey guys, how can we reset a player's inventory?

#

Is there a method or we need to make a foreach loop ?

quiet ice
#

Inventory#clear()?

quaint mantle
#

Thansk

coral sparrow
#

not exactly this code

quiet ice
#

why tis no compile

quaint mantle
#

Nvm

wraith rapids
#

a String is not a char

coral sparrow
#

retard face

ivory sleet
#

new String(new char[]{'-'}) 🤡

wraith rapids
#

char c = "-".toCharArray()[0]

torn shuttle
#

String char = "-";

#

char is a social construct, wake up sheeple

wraith rapids
#

based and redpilled

coral sparrow
#

yo guys I want to make bedwas plugin how i make 1 plz btw what is string

torn shuttle
#

it's what you put on a guitar

coral sparrow
wraith rapids
#

anybody happen to know a priority queue that's optimized for almost-sorted input

#

i don't think my rolling binary heap impl is going to fly

quaint mantle
#

Hey guys, how can I add an item to a player without making a new stack in its inventory, I mean, if a player has 15 wool, and I give him 1 wool, it's going not going to put it in the same stack as the 15 wool, how can I change that

wraith rapids
#

it should

quaint mantle
#

It doesn't with wool

wraith rapids
#

how are you adding it

coral sparrow
#

lmao

quaint mantle
#

Check material?

#

p.getInventory().addItem(new ItemStack(Material.WOOL, 1));

wraith rapids
#

1.8 plebian detected

quaint mantle
#

yea

wraith rapids
#

@crude hound help your fellow 1.8 plebian

eternal night
#

the infamous NNY list of 1.8 users

coral sparrow
quaint mantle
#

oh

coral sparrow
#

I mean I use it than addItem

quaint mantle
#

I think it's because my first stack of item has a itemmeat

quaint mantle
#

ItemMeta*

wraith rapids
#

MEAT

coral sparrow
#

Cool

wraith rapids
#

yeah, items must return true for isSimilar for them to stack

burnt current
#

Hello! I have just programmed a join listener, which opens a GUI for the new joining player. In this gui I wanted to put a custom head from Minecraft-heads.com. I then took everything I needed from the website. However, when the gui opens, the head is still a Steve Skin ... Does anyone happen to know what I could have done wrong?
I can also send my code

wet breach
#

?paste

queen dragonBOT
coral sparrow
burnt current
#

what do you mean with "IGN" ?

coral sparrow
wraith rapids
#

just note that if the skull owner isn't cached, it will make a blocking network request to mojang to fetch the profile

#

i assume you're using the same texture each time though so that shouldn't be a big issue

#

you can get the player's selected locale with the api btw

#

no need to make a gui of your own for it

coral sparrow
#

Can u show the event method

#

nvm u did

#

my bad

burnt current
wraith rapids
#

fair i suppose

coral sparrow
#

¯_(ツ)_/¯

#

easier

brittle ice
#

Can somewon help me with args can u dm me

wraith rapids
#

no

brittle ice
#

):

coral sparrow
wraith rapids
#

ask your question

#

someone may answer it

#

nobody is going to bother to DM you to ask you to ask your question

eternal night
#

pretty sure that spigot does not fill a skull textures when setting the offline player

brittle ice
#

i have a args

coral sparrow
brittle ice
#

problem

wraith rapids
#

describe your "args problem"

brittle ice
#

i have else by my

#

like

#

{

wraith rapids
#

what

brittle ice
#

i do

brittle ice
#

I CANT send screens

#

why]]\

coral sparrow
#

??

brittle ice
#

i cant make it easylie

wraith rapids
#

upload the image elsewhere and link it

brittle ice
#

I cant send screenshot

coral sparrow
quaint mantle
#

How to use e.setDropItems(false); for spigot 1.8 because there's not this method in 1.8

wraith rapids
#

update

quaint mantle
#

no

coral sparrow
#

funny

wraith rapids
#

the thing with old api is that it's old

#

and doesn't have the new stuff

quaint mantle
#

I know

#

But we can't use this kind of method in 1.8?

wraith rapids
#

backport it to 1.8

coral sparrow
#

1.8. combat is the reason 1.8 is still alive

quaint mantle
#

Yes

#

So I guess I have to set the Material to AIR?

wraith rapids
#

or actually do something useful and backport the new api to 1.8

#

so people can use it

wintry badger
#

hi, im looking for an event triggered when someone trades with a villager.

coral sparrow
#

or InventoryClickEvent

wraith rapids
#

try TradeSelectEvent, not sure if that's what you want

wintry badger
#

but i mean when trade is complete

wraith rapids
#

i didn't see any other trade related events so you might be sol

coral sparrow
#

rip

#

Inventory Close event maybe

#

and check for the inventory name

wintry badger
#

can i somehow detect if something is bought in that event?

coral sparrow
#

or soemthing

coral sparrow
burnt current
wintry badger
#

thank you @coral sparrow

burnt current
coral sparrow
coral sparrow
burnt current
#

i thought i should put the owner on some player?

coral sparrow
feral estuary
#
if (HeldItem.getType().equals(PlacedBlock.getType())) {
            System.out.println("Placed");
        }```
#

it doesnt print anything and im confused

coral sparrow
#

Where are you sending the message

#

to the player right?

wraith rapids
#

it's remarkable how many things you were able to do wrong in just 1 line

coral sparrow
#

event.getPlayer.sendmessage

#

lmao

burnt current
feral estuary
wraith rapids
#

use this or look into how it does stuff

coral sparrow
#

I thought Player xd

#

try this btw

burnt current
feral estuary
#

the code above it is

coral sparrow
#

@feral estuary Could you share the whole code

tawdry plume
#

Morning guys, is it theoretically possible to have all entities (ex chicken, zombie) be aggressive/charge at you like a creeper and then explode? I don't see any of them having the explode method outside of creeper so maybe I can replace that with a TNT?

feral estuary
#
package me.vexvr.actest;

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.*;

public class Scaffold implements Listener {
    @EventHandler
    public void onPlayerPlaceBlock(BlockPlaceEvent event)  {
        Player player = event.getPlayer();
        ItemStack HeldItem = player.getInventory().getItemInMainHand();
        Block PlacedBlock = event.getBlock();
        if (HeldItem.getType().equals(PlacedBlock.getType())) {
            System.out.println("Placed");
        }






    }
}
coral sparrow
#

Uhh Like

#

He places the block and should it detect that he has the item in his hand?

echo ether
#

Is there any way to change Java version of "minecraft-server-1.8.8-SNAPSHOT.jar"? I'm trying to build custom jar for a project but I couldn't use Java 16 due to the jar. Is it because of the Mojang built in Java 8 and there is no source code for that?

austere cove
#

??

wraith rapids
#

1.8 plebian detected

coral sparrow
#

lmao

austere cove
#

just run your server in a more modern java version

#

whats the issue

feral estuary
#

oh yeah its not supposed to be proffessional

#

its just for fun

#

and learning

eternal oxide
#

will a 1.8 jar still run on 16 with the new security changes?

coral sparrow
feral estuary
#

a anticheat for scaffold

austere cove
#

most likely yes

echo ether
eternal oxide
#

oh

#

Unless you are rewriting spigot you can;t use the "new" features

echo ether
austere cove
#

your plugins can use new features just fine as long as the JRE you run your server on supports those features

wraith rapids
#

did I have a stroke

#

or uh

#

did I see this exact discussion the other day

coral sparrow
echo ether
feral estuary
#

when the player places a block

#

if they are holding the same block they placed

#

it prints

#

im gonna do the kick later

coral sparrow
#

ohkay

austere cove
#

then there shouldn't be any issue?

echo ether
#

Since Minecraft 1.8 default server is not support Java 16, I cannot build the jar :/ So I'm asking if there is the way to upgrade default minecraft server jar to Java 16

eternal oxide
#

What error are you getting? @echo ether

feral estuary
#

im not getting any errors

#

it just wont print

#

when i place a block normally

ivory sleet
#

then you presumably did something wrong

coral sparrow
#

try this

echo ether
#

I'm getting error in AttributeBase.

eternal oxide
echo ether
#

So I cannot do anything about it...

feral estuary
ivory sleet
coral sparrow
#

i meant

echo ether
quaint mantle
coral sparrow
#

PlacedBlock.getmeta.getdisplayname.equals

ivory sleet
#

HeldItem.getType() == PlacedBlock.getType() is probably what you want

quaint mantle
#

pain

feral estuary
#

like dis?

ivory sleet
#

yup

feral estuary
#

ok let me test 1 sec

coral sparrow
#

I thought you making an anticheat lmao

feral estuary
#

i am

quaint mantle
#

Good lord

feral estuary
#

im gonna add the kicking part later

#

as the else

coral sparrow
feral estuary
#

it didnt work 0-0

quaint mantle
#

So you're telling me this guy is making an anticheat with 0 experience with spigot

#

let alone java

ivory sleet
#

What are you trying to do?

feral estuary
coral sparrow
#

even if you are trying to make a plugin.. You have to learn java

quaint mantle
#

tell you what, it's not even going to work

feral estuary
#

also why are villager deaths in console so long

#

Villager EntityVillager['Villager'/248, uuid='b5e10a84-fe70-4bae-b8c7-f22417c189f6', l='ServerLevel[paper_1_16_4_1273551]', x=-287.43, y=70.00, z=309.64, cx=-18, cz=19, tl=121638, v=true, d=false] died, message: 'Villager was slain by Zombie'

quaint mantle
#

god this is painful to read

feral estuary
#

i dont feel like im supposed to be here

#

ima just head out

quaint mantle
#

goodbye

ivory sleet
#

cya chad

quaint mantle
ivory sleet
#

oh well then

coral sparrow
#

Learn packets

quaint mantle
#

Guys I have a question, so I'm making a KnockBack FFA Server it's just like we're in a platform and we need to put people off with a stick, but, I created that when someone falls, if its Y position is < 100, he get teleported to the spawn, but before he get into the spawn, how can I get the people who knocked him?

ivory sleet
#

Pretty sure event listening is enough

quaint mantle
#

But he didn't die

coral sparrow
#

yea

quaint mantle
#

He just got teleported

ivory sleet
#

iirc

quaint mantle
#

Have a hashset where you simply store their last attacker

sick portal
#

Is there a way to get the user protocol version from protocol lib in bungeecord ? From the functions i see, getProtocolVersion(player).getVersion() only accepts a "player", which is not defined in bungeecord

eternal oxide
#

Protocol lib is not for Bungee

sick portal
#

Do you know any other simple way to just get the protocol version from bungee ?

#

or the minecraft version

eternal oxide
#

getVersion on the Proxied player gets you the protocol version.

austere cove
#

yea Connection#getVersion() returns the protocol number

quaint mantle
#

Is there something to automatically respawn a player who dies without getting the screen "respawn | back to the menu" for 1.8 without using something like tping him or anything

ivory sleet
#

yeah

quaint mantle
#

on the onPlayerDie event

#

how

ivory sleet
#

set the player health to 20

quaint mantle
#

...

ivory sleet
#

when the player dies that is

#

altho it introduces some side effects it is the only way iirc

eternal oxide
#

You have to check in the damage event as the dies event teh player is already dead

#

You can;t tp a dead player

ivory sleet
#

the death event works fine for that actually

eternal oxide
#

it does?

quaint mantle
#

Thanks conclure

#

And I have another question

#

How to kill a player

#

is there a method or I should set the player health to 0

ivory sleet
#

from what I remember I did rely on pde just fine elgar but yeah using the damage event is definitively less bug prone

quaint mantle
#

If I set the player health to 0 will it trigger PlayerDieEvent*

sick portal
#

@austere cove @eternal oxide sorry to bother, but i might not understood where the function is

austere cove
#

ProxiedPlayer#getPendingConnection() to get the connection

#

iirc

sick portal
#

Thank you!

sick portal
#

I think you can just spawn a PlayerDieEvent if that is your intent

quaint mantle
#

Can we "spawn" a PlayerDieEvent?

eternal oxide
#

no

ivory sleet
#

no dont

eternal oxide
#

Firing a death event yoruself will do nothing to the player

ivory sleet
#

^

quaint mantle
#

So how to kill a player and triggers PlayerDieEvent

austere cove
#

set health to 0

quaint mantle
#

how do people normally deal with return values of file operations? Here is an example:

paper viper
#

conditional

placid quartz
#

Yep

#

check if it returns true

#

else print an error

quaint mantle
#

i just don't see why i should additionally return or throw an runtimeexception

#

its kinda just annoying

paper viper
#

uh you should

placid quartz
#

if(!dataFile.createNewFile()) {
//Print out an error to the console
}

paper viper
#

sometimes you got no permission

#

to create the file

#

and you need to handle that

quaint mantle
#

wouldn't that trow an ioexception

quiet talon
quaint mantle
#

Returns:
true if the named file does not exist and was successfully created; false if the named file already exists

paper viper
#

Or false if the file couldnt be created

#

from some ioexception

#

and it throws

#

but not sure

quaint mantle
#

then it doesn't return? It would throw the exception

paper viper
#

need to check

#

i think it throws the exception actually

#

the boolean only checks if it exists

#

i just read docs

quaint mantle
#

yeah. I hope javadocs don't lie there

paper viper
#

also, imo I prefer Path over File

#

¯_(ツ)_/¯

ivory sleet
quaint mantle
#

ah right i can just print the stacktrace instead of throwing it

#

thanks

ivory sleet
#

but even so it might not be needed to give the user a stacktrace but simply use Logger#warn or smtng

quaint mantle
paper viper
#

for the config file?

quaint mantle
#

yeah and config system itself

ivory sleet
#

it takes a reader

paper viper
#

Yeah

#

i remember its like Files.newInputStream?

#

i forgot

ivory sleet
#

Files.newBufferedReader(path, StandardCharsets.UTF_8) or smtng

paper viper
#

Oh im stupid

#

oops lmao

ivory sleet
#

yeah

paper viper
#

why did i think input stream

#

when its reader

ivory sleet
#

I mix those also sometimes lol

quaint mantle
paper viper
#

String

quaint mantle
#

string...

#

i kinda don't like that for file operations

paper viper
#

also tbh the bukkit configuration do be scufed

#

lol

quaint mantle
#

true lol

ivory sleet
#

or you could technically
do smtng like
Files.newBufferedWriter(path).write(config.saveToString());

quaint mantle
#

hm. Yeah you can do everything with paths instead, but in the end the old school file system is a bit more convenient there?

#

🤷‍♂️

ivory sleet
#

I mean yeah it might be more consistent using File instead

quaint mantle
#

is there any performance wise improvement?

#

There's a decent performance increase in deez nuts

ivory sleet
#

Prior to the Java SE 7 release, the java.io.File class was the mechanism used for file I/O, but it had several drawbacks.

Many methods didn't throw exceptions when they failed, so it was impossible to obtain a useful error message. For example, if a file deletion failed, the program would receive a "delete fail" but wouldn't know if it was because the file didn't exist, the user didn't have permissions, or there was some other problem.
The rename method didn't work consistently across platforms.
There was no real support for symbolic links.
More support for metadata was desired, such as file permissions, file owner, and other security attributes.
Accessing file metadata was inefficient.
Many of the File methods didn't scale. Requesting a large directory listing over a server could result in a hang. Large directories could also cause memory resource problems, resulting in a denial of service.
It was not possible to write reliable code that could recursively walk a file tree and respond appropriately if there were circular symbolic links.

from oracle

quaint mantle
#

hm

#

ig paths is just better then

ivory sleet
#

I mean yeah but File is fine needless to say

quaint mantle
#

easy fix lmao

#

ok imma just use exceptions now then

ivory sleet
#

🤡

paper viper
#

its really not

#

lol

covert bluff
#

what are difference betweeon com and me

quaint mantle
#

different tlds

covert bluff
#

what is tlds

quaint mantle
#

¯_(ツ)_/¯

covert bluff
#

Ok

quaint mantle
#

i recommend using io.github.username if you don't own a domain

paper viper
#

*io

#

no com

quaint mantle
#

oops

covert bluff
#

how to i github domain

paper viper
#

com is not an option

#

anymore for github

covert bluff
#

oh that is make me very sad

eternal oxide
#

why is com not an option?

paper viper
#

github pages made no more redirects for com

#

and also sonatype and the central disallows it now

#

you have to use io

ivory sleet
# paper viper *its really not*

it is fine in the extent how bukkit is used where its most likely not used in anyway where it was lacking (oracles justification for replacing it). Quite frankly a spigot developer only uses it to create a file or a directory in which the File class works more than fine

paper viper
#

as that is the proper extension for pages

ivory sleet
#

yeah its not scalable at all

covert bluff
#

i want to make a plugin that resets a world (e.g. overworld, end, nether) to the latest save a player made by using /save-world command, would this work with unloading the messed up world and loading the saved one?

World w = p.getWorld();
            getServer().unloadWorld(w, false);
            p.getWorld().getWorldFolder().delete();
            WorldCreator wc = new WorldCreator("world");
            wc.copy(w);
            getServer().createWorld(wc);
#

this is just a placeholder btw

#

ignore the fact that wc opies the same world

quaint mantle
covert bluff
#

thank you

#

i will post this everywhere now

quaint mantle
#

np

covert bluff
#

do you own the domain

quaint mantle
#

nope i found it in paper discord

covert bluff
#

i want to buy the domain

quaint mantle
#

lol

lilac dagger
#

it's free for the first year

covert bluff
lilac dagger
#

tho it has a pretty shit infrastructure

covert bluff
#

tthx

lilac dagger
#

and people would not put trust in it

#

due to the free status

#

but for a mc server it's fine

quaint mantle
#

hm. Just invest some money and use namecheap lol

#

domains don't cost that much nowadays

#

except the ones i want to buy

#

😆

#

i swear i have seen domains being sold for way more

#

Anyone knows why when I put player.setHealth(20) in my onPlayerDeath it continues to get the GUI screen "respawn | back to menu"

lilac dagger
#

go for .net

#

or something else

quaint mantle
#

But it'll trigger when someone get damaged?

#

So I guess I got to check their life and if it's 0 then reset it to 20?

#

And in EntityDamageEvent can we get the "killer" with player.getKiller() ?

ivory sleet
#
if (event.getEntity().getHealth() - event.getFinalDamage() >= 0) {
  event.getEntity().setHealth(event.getEntity().getMaxHealth());
}```
#

maybe

#

and yeah check if its a player also

quaint mantle
#

Yeah

#

But is there the "getKiller()" things?

ivory sleet
#

yeah

#

only returns if a player killed it

#

else null iirc

quaint mantle
#

okay thanks

#

I'll try

silk tusk
#

How do I find the maximum durability for an item?

solemn glade
#

How do I get every player on the server that has a specified scoreboard tag?

chrome beacon
quaint mantle
#

?paste

queen dragonBOT
quaint mantle
#

the reset method just tp the player to the spawn

ivory sleet
#

<= instead of >=

#

heh

chrome beacon
#

How do I whitelist paste md5 in Malwarebytes ;/

quaint mantle
#

Same error

chrome beacon
#

nvm did it

quaint mantle
#

I mean thats not an error but it keep spamming <name> died & it shows the GUI

ivory sleet
#

p.getHealth() - e.getFinalDamage() <= 0

quaint mantle
#

Yeahg

#

It's the same

ivory sleet
#

uh thats weird

quaint mantle
#

Ok no

#

your things is working

#

But when you use

#

p.setHealth(0) in another void to kill the players

#

the glitch starts

#

I'll try to be more clear (I'm sorry for my bad English).

I'm making a simple server where people needs to knock in the void other people with a stick. So when someones moves, if his Y position is less than 30, I want him to be killed so I can know who pushed him to the void. If we use p.setHealth(0) it's going to make the glitch. Is there any others option I could use

echo ether
#

Well you shouldn't set player's health to 0. There are a lot of options for that.

quaint mantle
#

How can I do then

#

Please sir

echo ether
#

If you want to keep it basic, you can use HashMap or even metadata(not recommended) to set last attacker.

#

and not set player's health to 0

#

what's the the point?

quaint mantle
#

getKiller is kinda more easy

#

I'm not familiar with HashSet

#

hashMap

silk tusk
quaint mantle
#

Can't i use the /kill command?

echo ether
quaint mantle
#

Ok i'll try to be more clear for other people, how to kill a player without using p.setHealth(0)

ivory sleet
#

an alternative is to deal an magnanimous amount of damage with the damage method

quaint mantle
#

Nvm I found out