#help-development

1 messages · Page 2062 of 1

hasty prawn
#

Well, then check that min/max locations. When you add/subtract 4 to both x and z then you're gonna have a diagonal.

desert musk
#

is there a method like this for doing that using a circular radius? or no

vocal cloud
#

You'd have to make your own

desert musk
#

alright

#

thanks

#

but it should just be a continual task then?

#

that wouldnt ruin my tps right?

sage dragon
hasty prawn
#

Ah yeah that'll do it PepeLaugh

tender shard
#

looks funny lol

glossy venture
#

is there any way to download all minecraft assets?

#

packaged in a zip

#

or something

#

no java classes

#

from a mojang api or something like that

tender shard
glossy venture
#

yeah

tender shard
#

i don't think so

glossy venture
#

i need to merge the generated item models with the defaults

#

bruuuh\

hasty prawn
#

Isn't most of it just in the JAR?

tender shard
hasty prawn
#

So go steal it out of that KEKW

glossy venture
#

i mean i could download the jar and only extract the assets

#

thanks

#

ill look into it

hasty prawn
#

You already have it downloaded

#

%appdata%/.minecraft/versions/1.18.2/jar

tender shard
glossy venture
#

but i need everyone that runs the server to have it

tender shard
#

maybe he only codes plugins and never tried them

hasty prawn
#

my mistake

glossy venture
#

i cant rely on the host computer to have all the jars

hasty prawn
#

Huh

glossy venture
#

also its easy

#

the link is stored in the version.json file in appdata

#

i believe

hasty prawn
#

Yeah...

#

I have no idea what you're trying to do but you do you 🤷‍♂️

wooden fable
#
            if(!(section.contains(key + ".title") &&
                    section.contains(key + ".world") &&
                    section.contains(key + ".min.x") &&
                    section.contains(key + ".min.y") &&
                    section.contains(key + ".min.z") &&
                    section.contains(key + ".max.x") &&
                    section.contains(key + ".max.y") &&
                    section.contains(key + ".max.z"))) continue;

Is this the best way to write such an if statement?

quiet ice
#

oh god no

wooden fable
#

xD

quiet ice
#

What the hell is section and key and are you really sure that you cannot just get rid of the (implicitly) uncached string builder?

vocal cloud
#

If it has key x you can assume it has y and z as well

wooden fable
#

It's for ittering through a ConfigurationSection:

    private ArrayList<Koth> getKoths() {
        final ArrayList<Koth> koths = new ArrayList<>();
        final ConfigurationSection section = DataConfig.get().getConfigurationSection("koths");

        for (final String key : section.getKeys(false)) {
            if(!(section.contains(key + ".title") &&
                    section.contains(key + ".world") &&
                    section.contains(key + ".min.x") &&
                    section.contains(key + ".min.y") &&
                    section.contains(key + ".min.z") &&
                    section.contains(key + ".max.x") &&
                    section.contains(key + ".max.y") &&
                    section.contains(key + ".max.z"))) continue;


            final String title = section.getString(key + ".title");

            final String worldName = section.getString(key + ".world");
            final World world = Bukkit.getWorld(worldName);
            if(world == null) continue;

            final int minX = section.getInt(key + ".min.x");
            final int minY = section.getInt(key + ".min.y");
            final int minZ = section.getInt(key + ".min.z");
            final Location min = new Location(world, minX, minY, minZ);

            final int maxX = section.getInt(key + ".max.x");
            final int maxY = section.getInt(key + ".max.y");
            final int maxZ = section.getInt(key + ".max.z");
            final Location max = new Location(world, maxX, maxY, maxZ);

            final CuboidSelection sel = new CuboidSelection(world, min, max);

            koths.add(new Koth(sel, title, this));
        }

        return koths;
    }
vocal cloud
#

My point still stands

quiet ice
#

I do not see the need for the if statement...

vocal cloud
#

One should assume that where there is a title all the other values will follow

quiet ice
#

I think you can assume that all keys are present considering this does not look like something that is configurable

hasty prawn
#

Just tell them no touchy

vocal cloud
#

Or store it internally

quiet ice
#

If I was to write the software I'd use my favourite class (DataOutputStream) instead of configurations - far faster that way and people will not be going to try to edit the values

wooden fable
#

It is saved via command, but I also wanted to make it so that the player can edit it in the config. If a key is missing, it breaks.

quiet ice
#

at best - log an warning message that a key is missing

wooden fable
#

Okay, thanks for helping everyone

vocal cloud
#

The command shouldn't be screwing up a save so there is no reason to check key existence

grim ice
#

any front end dev?

shut solar
#

any idea how do i set nbt data to an entity in 1.18.2?

grim ice
#

how do i make an aside tag stick to the right

#

using right property in css makes it unresponsive

#

float:right; doesnt work

viscid wharf
#

I'm trying to serialize a ItemStack by Gson, but it throws
java.lang.IllegalArgumentException: class org.bukkit.craftbukkit.v1_18_R2.inventory.CraftMetaEnchantedBook declares multiple JSON fields named enchantments.
Actually it's caused by CraftMetaEnchantedBook. I noticed ItemMeta has a serialize method, but there's no deserialize method?

tardy delta
errant narwhal
#

hey

#

how to check if player in world nether?

tardy delta
#

Bukkit.getWords().get(1) is the nether world

#

you can probably just do .equals on it but comparing the names would work too

grim ice
#

i miss java

#

gib ideas

tardy delta
#

make me a storage design

glossy venture
#

any idea why all of my zip entries have size -1

#

probably meaning that couldnt be read

pliant oyster
#

I need help putting a hashmap into a yml file

wet breach
pliant oyster
#

I crated the yml file already but idk how to add the hashmap stuff in

hasty prawn
#

config.set(key, map.get(key))

errant narwhal
wet breach
#

an extension of map that uses hashes

quaint mantle
#

Hey guys im making a plugin that interacts with pearls. Is there a way to get the pearl entity in the playerteleport event? (like in projectilelaunch event)
basically i need to get the ender pearl entity here```java
public class ListenerPearl implements Listener {
@EventHandler
public void onPearl(org.bukkit.event.player.PlayerTeleportEvent e) {
if (e.getCause() == org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.ENDER_PEARL) {
e.getentity here

glossy venture
#

shit

#

i wanted to disable pign

#

sorry

hasty prawn
#

You're good, glad it works

chrome beacon
#

If you're unsure use equals

#

I'd expect == to work though but you might have to do some testing

pliant oyster
hasty prawn
#

No

#

You iterate through the keySet and set them individually.

pliant oyster
#

oh

#

so use for()?

hasty prawn
#

Yes

pliant oyster
#

for (String keys : economyManager.playerEconomy.keySet())

#

like that?

hasty prawn
#

Yes

pliant oyster
#

oh ok

#
        for (String keys : economyManager.playerEconomy.keySet()){

            economyConfig.set(keys, economyManager.playerEconomy.values());

        }
#

like that?

hasty prawn
#

No, you need to get the value at that key too.

#

Not just all the values.

pliant oyster
#

hmm

#

how do I do that

hasty prawn
#

get

pliant oyster
#

ohh

#

economyConfig.set(keys, economyManager.playerEconomy.get(keys));

#

like this?

hasty prawn
#

yes

pliant oyster
#

I see

#

thanks

quaint mantle
#

how would you teleport a player using specific coordinates in spigot?

wet breach
#

by using the teleport method

grim ice
#

alr

#

i made a website

#

to store any image and view it online

#

i think ill make an app now

#

that captures ur screen

tardy delta
#

lol

grim ice
#

and uses ftp to put it in the server

#

so i can screenshot and give people the image without the file being on my pc

#

:D

#

but i have a problem

#

my website description

tardy delta
#

top secret ok but i have to hover my mouse over every elem to read it ;-;

grim ice
#

is getting removed when i use its domain

young knoll
grim ice
#

oh right that lets u copy stuff

#

anyways

tardy delta
#

ayy this is a filter which i can remove

grim ice
#

my domain is removing my website's (which im cloak forwarding to) description

#

how do i stop it

#

from doing that

#

and btw

#

if my website has smth like

#

url/page.html

#

and im having a domain cloak forwarding to url

#

domain/page.html doesnt work

#

so if i have
qwe.rty.uio/abc.html
and a domain cloak forwarding to that url (asd.fgh)
asd.fgh/abc.html does not work

quaint mantle
grim ice
#

and <meta description....> of qwe.rty.uio doesnt work with asd.fgh (doesnt move to it)

wet breach
quaint mantle
#

no shit sherlock, i asked how to store x y and z values in a location object, may you please tell me how to do that or ill be on my merry way

grim ice
wet breach
#

then you probably should learn java

#

?learnjava

undone axleBOT
quaint mantle
#

oh my goodness i asked how do i store xyz values in a location object e.g. `Location example = //how do i use xyz values here

grim ice
#

yes

#

learn java

#

?learnjava if the previous one wasnt enough

undone axleBOT
wet breach
#
Location location = new Location(world,x,y,z);
#

not sure what is hard about that unless you don't know java

quaint mantle
#

you guys are assholes

wet breach
#

so please go learn java basics before asking basic questions

grim ice
#

LMAO

#

THIS IS SEIROUSLY

#

FUNNY

#

lemme take a screenshot

wet breach
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

quaint mantle
#

i asked a simple question because i didnt know what to do, least you can do is not be an asshole about it

undone axleBOT
quaint mantle
#

🗿

#

yea ya can stop spamming the learnjava command, idiotic children

#

🗿 😳

tardy delta
#

children where

grim ice
#

lmao

tardy delta
#

what

grim ice
#

awesome

#

free meme

river oracle
#

Now let's be nice guys he can also try learning kotlin

#

There are plenty of other jvm languages

grim ice
#

no he should learn scala

grim ice
#

only 3

#

actually

#

more

river oracle
#

Really? I thought there were more

grim ice
#

Java
Scala
Kotlin
Groovy
Clojure

river oracle
#

Yeye what is Scalas thing that makes it great

grim ice
#

Jython

#

JRuby

grim ice
river oracle
#

Lol

wet breach
#

a nice example you are 🙂

thin shore
#

I wanna make a cube is there a more efficient way than this?

for(int x = minX; x<maxX;x++){
  for(int y = minY; y<maxY;y++){
    for(int z = minZ; z<maxZ;z++){
       
      Location loc = new Location(world, x,y,z);
      loc.getBlock().setType(Material)
      
    }  
  }
}
tender shard
#

how does bukkit about the "double annotations" javadoc bug?

#

I use the exact same javadoc plugin version as bukkit :<

river oracle
tender shard
#

erm

#

I mean how did they fix it

#

annotations show up twice in the javadocs

#

but bukkit somehow doesn't have this problem in their docs

wet breach
#

do you add documentation?

#

if you don't add documentation stuff to methods, then the javadoc will just use what is in the method instead

tender shard
#

it's definitely bugged

#
    /**
     * Creates a DataType holding a {@link Hashtable} of the given DataTypes
     * @param keyType The existing DataType for the map's keys
     * @param valueType The existing DataType for the map's values
     */
    static <K, V> MapDataType<Hashtable<K,V>,K,V> asHashtable(final @NonNull PersistentDataType<?, K> keyType,
                                                              final @NonNull PersistentDataType<?, V> valueType) {
        return asGenericMap(Hashtable::new, keyType, valueType);
    }
#

it anyway adds @ NonNull twice EVERYWHERE

#

:<

#

they appear correctly in the summary table

solar sable
#

guys what does this mean

#
java.lang.RuntimeException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
    at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:610) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1212) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-266]
    at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
    at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[?:?]
    at sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:68) ~[?:?]
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:132) ~[?:?]
    at sun.nio.ch.IOUtil.write(IOUtil.java:76) ~[?:?]
    at sun.nio.ch.IOUtil.write(IOUtil.java:67) ~[?:?]
    at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:285) ~[?:?]
    at net.minecraft.util.SessionLock.a(SessionLock.java:40) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.world.level.storage.Convertable$ConversionSession.<init>(Convertable.java:338) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.world.level.storage.Convertable.c(Convertable.java:308) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:608) ~[patched_1.17.1.jar:git-Paper-266]
    ... 4 more
#

i cant start my server

pliant oyster
#

The process cannot access the file because another process has locked a portion of the file

#

Exactly what the log says, what do you think is causing this?

solar sable
#

idk

tough crane
#

someone have idea for why getBlockData of CMI doesn"t work ?

limpid bronze
#

@tender shard Hey you helped me with a problem with BuildTools and remapped jar but after I compiled BuildTools.jar with the --remapped parameter there is the same error :

  • What went wrong:
    Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find spigot-1.18.1-R0.1-SNAPSHOT-remapped-mojang.jar (org.spigotmcspigot1.18.1-R0.1-SNAPSHOT:20211220.014539-2).
Searched in the following locations:
https://repo.dmulloy2.net/nexus/repository/public/org/spigotmc/spigot/1.18.1-R0.1-SNAPSHOT/spigot-1.18.1-R0.1-20211220.014539-2-remapped-mojang.jar

spare violet
#

hi

#
 private OfflinePlayer getOfflinePlayer(String name) {
        OfflinePlayer[] players = plugin.getServer().getOfflinePlayers();

        for (OfflinePlayer op : players) {
            if (name != null && name.equals(op.getName())) {
                return op;
            }
        }

        return null;
    }
#

this or OfflinePlayer#hasPlayedBefore

#

which is better

true star
#

I am trying to make a plugin to change your name with packets, but i get lost y sending packets to everyone except the player that issues te command. Can anyone help me with this?

visual tide
tender shard
visual tide
limpid bronze
visual tide
limpid bronze
visual tide
#

hm

#

weird

frigid rock
#

ayo boys how can i get if a player is breaking a tree?

true star
#

Try playerbreakingevent?

#

Does somebody know how i can modify a collection?

frigid rock
true star
#

Try to get if it is a log?

frigid rock
#

but i need a tree

#

it runs even when i break a normal log

true star
#

Can see if the log is connected to a leaf

kind hatch
frigid rock
kind hatch
# frigid rock it runs even when i break a normal log

You are going to have to write your own detection method for detecting trees. You can use TreeFeller plugins as a good starting reference, but you also have to define the scope. What constitutes a tree? Should you just check for default trees? What about player made trees? Etc etc

true star
#

@kind hatch Do you know how to send packets to ervryone except one player?

kind hatch
true star
#

I know but how?

#

How can i not loop that one player

#

Collection<? extends Player> online = Bukkit.getServer().getOnlinePlayers();, i cant just remove a player out of this collection

kind hatch
#

Make a copy of the online players array and remove the player. Or you could add a check to see if it’s a specific player.

true star
#

I have tried to make a copy but i still can't edit it

spare violet
#

if it not exists then i will not execute

kind hatch
true star
#

Collection<? extends Player> players = new ArrayList<>(online);

true star
#

Or do i need to use addAll?

tender shard
#

RIP I just released this in an update

            int statistic = player.getStatistic(Statistic.PICKUP,item.getType());
            player.setStatistic(Statistic.PICKUP,item.getType(),statistic + pickedUpAmount);

5 minutes later I see that player.incrementStatistic exists >.<

grim ice
#

cuz if u use hasPlayedBefore

#

u will have to Bukkit.getOfflinePlayer()

#

which if the player hasnt joined before itll send a request to mojang servers

#

a blocking request btw

#

looping through players that have joined before is better than that

#

since ur not gonna use the offlineplayer except if he played before therefore u will avoid pointless blocking requests

spare violet
#

hmmmm

#

thanks

kind hatch
grim ice
#

yeah but dont

#

instead

#

Set<Player> onlinePlayers = Sets.newHashSet(Bukkit.getServer().getOnlinePlayers());

kind hatch
#

Why would that make a difference?

tender shard
grim ice
#

ur using arraylist which doesnt make sense for it to be ordered

kind hatch
#

Who said it had to be ordered?

grim ice
#

You

tender shard
#

I would use an arraylist too

#

because there is no need to use a set

kind hatch
grim ice
tender shard
#

you use a set when you want to assure that stuff cant be added twice

#

a hashset is sorted too

kind hatch
#

Yea and I don’t think there can be duplicate players

grim ice
#

ordered

#

not sorted

tender shard
#

that's what i meant

grim ice
#

hashset isnt ordered

ivory sleet
#

it is

tender shard
#

tbh it doesn't matter at all which one you use

grim ice
#

what

ivory sleet
#

but it isnt sorted

grim ice
#

"HashSet does not maintain any order"

#

??

#

google says the opposite

ivory sleet
#

yes but it has an order

tender shard
#

yeah it says that but I never experienced a situation where it actually changed the order

ivory sleet
#

just not a useful one

tender shard
#

anyway, who cares, use a list, or set, whatever, it makes no difference

grim ice
#

its not ordered in a way you can access an element from an index

#

a set is more appropriate

tender shard
#

a set is to ensure that there are no duplicate elements

grim ice
#
  1. you do not need it being ordered so you dont need arraylist feature
  2. there wont be duplicate players so you dont need arraylist feature
tender shard
#

there won't be any duplicate players so you can use any collection you like

grim ice
#

I would use arraylist if there would be duplicates

#

otherwise Set

#

just makes sense to me

kind hatch
tender shard
#

the set checks on every add() whether it already exists this thing

grim ice
true star
grim ice
#

and

kind hatch
ivory sleet
#

tho idm I mean, both ways you guys provided would just return a defensive copy

kind hatch
#

IT DOESTN

ivory sleet
#

not like you instantiated a view

kind hatch
true star
#

And how do i do that?

kind hatch
#

for every player in online
Send packets

true star
#

I use this to send packets ```for(Player all : online) {

sterile token
#

Hi i have discovered a bug or something similar with maven modules, because when im creating a multi module maven project. And i create a new module that its not a parent module its doesnt resolve any dependencie

kind hatch
grim ice
#

Btw @tender shard

true star
#

i use:

 
for(Player all : online) {
    PlayerConnection connection = ((CraftPlayer) player).getHandle().b;
    connection.sendPacket(new PacketPlayOutEntityDestroy(ep.getId()));
    connection.sendPacket(new PacketPlayOutNamedEntitySpawn(ep));
}
        ```
grim ice
#

Why would you not use Set

#

I have a reason to not use ArrayList

sterile token
grim ice
#
  1. You dont need its feature that allows duplicates
  2. You dont need its feature that allows maintaining insertion order
  3. You can use HashSet and benefit of the hashing feature as well
kind hatch
grim ice
sterile token
grim ice
#

Your code should always go under good practice, even in small projects

solid cedar
#

Please help!
I tried to make a plugin that changes the player's name, not on the tab, but above it (version 1.16.5) and there are no bugs, but the plugin doesn't work.

sterile token
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

grim ice
#

?notwork

#

?nowork

#

?work

#

ew

sterile token
#

The command doesnt work

grim ice
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

grim ice
#

finally

solid cedar
chrome beacon
#

You need the main scoreboard

grim ice
#

generating a new scoreboard each execution?

solid cedar
grim ice
#

wow.

chrome beacon
#

getMainScoreboard

sterile token
#

wow.

#

I dont have words to describe this

grim ice
sterile token
true star
#

The code i use =

public class Nick implements CommandExecutor{

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String args[]) {
        if(!(sender instanceof Player)) {
            sender.sendMessage(ChatColor.RED + "You need to be a player for this command!");
            return false;
        }
        if(cmd.getName().equalsIgnoreCase("nick")) {
            Player player = (Player) sender;
            EntityPlayer ep = ((CraftPlayer) player).getHandle();
            for(Player all : Bukkit.getOnlinePlayers()) {
                PlayerConnection connection = ((CraftPlayer) player).getHandle().b;
                connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.b, ep));
            }
            try {
                GameProfile playerProfile = ((CraftPlayer) player).getHandle().getProfile();
                Field ff = playerProfile.getClass().getDeclaredField("name");
                ff.setAccessible(true);
                ff.set(playerProfile, args[0]);
                player.sendMessage(args[0]);
            } catch (Exception e) {
                e.printStackTrace();
            }
            for(Player all : Bukkit.getOnlinePlayers()) {
               PlayerConnection connection = ((CraftPlayer) player).getHandle().b;
               connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.a, ep));
               
            }
            Player p = Bukkit.getServer().getPlayer(player.getName());
            List<Player> online = new ArrayList<>(Bukkit.getServer().getOnlinePlayers()); 
            online.remove(p);
            for(Player all : online) {
                PlayerConnection connection = ((CraftPlayer) player).getHandle().b;
                connection.sendPacket(new PacketPlayOutEntityDestroy(ep.getId()));
                connection.sendPacket(new PacketPlayOutNamedEntitySpawn(ep));
            }
        }
        return false;
    }
    
    
}
undone axleBOT
sterile token
#

Please use that

#

Longs code should be pasted there

true star
#

Done

chrome beacon
#

Why 3 for loops 👀

sterile token
grim ice
#

setAccessible

true star
#

I need to sebd some packets first

true star
grim ice
#

u should make it false after you finish I think

sterile token
#

Done just 1 loop and do all stuff inside the loop?

grim ice
#

Field ff = playerProfile.getClass().getDeclaredField("name");

#

mmm

#

This is a field as far as i can see

sterile token
#

Do you understand the code?

#

Or just copy-pasted?

#

🤔

grim ice
#

man sending new packets ech loop

#

create one packet

#

send in the for loop

true star
#

I don't understand the packet sending

#

But the rest i know

grim ice
#

also dont create an arraylist for that

true star
#

I need to send two packets to everyone

grim ice
#

just check if the all equals p

#

if so then continue;

#

I know.

true star
#

and two to everyone except the player that issued the command

grim ice
#

use the array bukkit provides

#

no need to addAll

#

to remove on element

true star
#

How, i don't know a thing about packets

crisp steeple
#

you're creating a new packet every iteration

grim ice
#

this is a mess

grim ice
crisp steeple
#

It already should trigger if you've registered it properly

sterile token
true star
grim ice
#

btw verano

#

ur a fullstack dev right

sterile token
crisp steeple
#

^

true star
#

So i can use unnick later

tender shard
grim ice
#

Uh

#

what

tender shard
grim ice
#

hashset performance is better than arraylist eitherway

solid cedar
#
        ScoreboardManager sm = Bukkit.getScoreboardManager();
        Scoreboard scoreboard = sm.getNewScoreboard();
        sm.getMainScoreboard();
        Team team = scoreboard.getTeam("inc");
        if (team == null) {
            team = scoreboard.registerNewTeam("inc");
        }
        team.setPrefix("§c[IC] ");
        team.addEntry(s.getName());
        return;
    }
}``` it still does not work
grim ice
#

afaik

tender shard
#

depends on the size and when you only iterate, it won't be faster

limber patio
#

Hi, I'm writing my first plugin and I have a problem with config, I can't make some lines in the mysql line and I still have an error there

tender shard
#

but as I already said, noone cares whether it's a set or a list

grim ice
#

I would still use Set

tender shard
grim ice
#

premature optimization

#

e

tender shard
#

getConfig() is a method

grim ice
#

i wouldnt use a class that has 2 features i dont ever need

#

just cuz it MIGHT have better performance

tender shard
#

yes and for me the "unneeded feature" you are talking about is the contains() check

grim ice
#

and a very small chance i assume

#

1 feature vs 2 features

tender shard
#

but I said it 10 times already, noone cares whether to use a set or list

limber patio
true star
#

But how can i send packets to all players except one?

tender shard
grim ice
#

u need to do that on ur main class lol

tender shard
#

getConfig() is a method defined in Plugin. You can't just randomly use it everywhere

grim ice
#

dayum

#

@solid cedar @true star we told u what to do

grim ice
#

also @tender shard i have a question if u dont mind

#

about web dev

true star
limpid bronze
true star
#

Or do you know a cursus to learn java?

sterile token
sterile token
#

?learnjava

undone axleBOT
true star
modern vigil
#

Course is cursus in het Engels @true star

sterile token
#

Olivo i have discovered something that looks as a bug. This happens when using Maven multimodule project. Let say i have a main proejct (as pom packaging) and then inside i have more modules. If the modules doesnt contain parent their doesnt resolve any dependencies i dont know. why

west oxide
#

hey i was following a customYaml files tutorial and i got this error

12:58:38 [SEVERE]     at java.io.UnixFileSystem.createFileExclusively(Native Method)
12:58:38 [SEVERE]     at java.io.File.createNewFile(File.java:1023)
12:58:38 [SEVERE]     at online.shakiz.networkcore.files.CustomFile.<init>(CustomFile.java:28)
12:58:38 [SEVERE]     at online.shakiz.networkcore.files.FilesManager.createFile(FilesManager.java:28)
12:58:38 [SEVERE]     at online.shakiz.networkcore.files.FilesManager.<init>(FilesManager.java:19)
12:58:38 [SEVERE]     at online.shakiz.networkcore.BCore.onEnable(BCore.java:34)
12:58:38 [SEVERE]     at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:265)
12:58:38 [SEVERE]     at net.md_5.bungee.BungeeCord.start(BungeeCord.java:285)
12:58:38 [SEVERE]     at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
12:58:38 [SEVERE]     at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)      ```

this is the code where the error is
 
https://paste.md-5.net/joyecipaci.cpp

am using bungee and it wouldnt work :(
undone axleBOT
sterile token
#

Please paste the code there

west oxide
modern vigil
#

Create the dirs of the parent files/folders

sterile token
chrome beacon
#

Could you put your project on github so I can take a look

modern vigil
#

File#parent#mkdirs

chrome beacon
# west oxide what

That's the method you need to use. You need to make the folders before creating the file

chrome beacon
#

Verano

west oxide
#

am confused

#

it returns boolean

#

nvm i found it

sterile token
grim ice
#

my domain is removing my website's (which im cloak forwarding to) description how do i stop it from doing that and btw if my website has smth like url/page.html and im having a domain cloak forwarding to url domain/page.html doesnt work so if i have qwe.rty.uio/abc.html and a domain cloak forwarding to that url (asd.fgh) asd.fgh/abc.html does not work

west oxide
tender shard
#

ughm what do you mean with "cloak"?`never heard that word before 😄

west oxide
#

fixed the thing tho

sterile token
#

What means cloak?

grim ice
#

so for example u have a website

#

bbb.aaa.ccc

eternal oxide
#

ht access rewite is my guess

sterile token
grim ice
#

u cloak forward ur new domain bcc.a to it

#

no

grim ice
tender shard
#

why don't you just add the new domain to your vhost config?

sterile token
tender shard
#

one sec

grim ice
#

e.g

sterile token
#

That the format for sub domains and domains

grim ice
#

and my domain

#

is

tender shard
#

I just do this

grim ice
tender shard
#

but normally you should not do that

#

google hates you for duplicate content

sterile token
tender shard
#

the proper way is to do a 301 redirect

sterile token
#

Isnt that the way?

grim ice
#

eh nah i dont care about google hating me

tender shard
#

then just use ServerName and ServerAlias

grim ice
#

how doe i dont get it

tender shard
#

nginx has the same option, it just has a different name

#

are you using apache or nginx

grim ice
#

apache

tender shard
#

you have a vhost config in /etc/apache2/sites-enabled/

night torrent
#

how would I get a player from a task?

tender shard
tender shard
night torrent
#

one sec

night torrent
#

from this

sterile token
night torrent
#

how would I get all online players

sterile token
#

In your case just plugin#getOnlinePlayers()

night torrent
#

but can you cast that into a player?

chrome beacon
#

Bukkit#getOnlinePlayers

#

And no you don't cast multiple players to one

sterile token
chrome beacon
#

Well yeah

sterile token
#

You should loop the collection to get each player

limpid bronze
#

@tender shard Good news! in fact I can use NMS but Github returns me Could not find spigot-1.18.1-R0.1-SNAPSHOT-remapped-mojang.jar even if I can use NMS

tender shard
tender shard
night torrent
#

So I would make a list and a for loop?

sterile token
limpid bronze
sterile token
#

You can learn java and then try to use the spigot api. Because not many people here like helping people that atleast doesnt know the basics of java

tender shard
night torrent
#

I thought I could skip at least a bit of java learning coming from C#, guess I was wrong 😦

tender shard
#

java and c# are pretty similar

chrome beacon
#

Casting a list to a single object won't work in C# either

tender shard
#

which player to you want to get anyway?

limpid bronze
night torrent
tender shard
#

Bukkit.getOnlinePlayers()

#

returns a Collection<Player>

night torrent
#

thanks

sterile token
night torrent
#

for(int i = 0; i < Bukkit.getOnlinePlayers(); i++)

#

something like that?

limpid bronze
night torrent
tender shard
# night torrent for(int i = 0; i < Bukkit.getOnlinePlayers(); i++)
        Collection<? extends Player> allPlayers = Bukkit.getOnlinePlayers();
        System.out.println("There are " + allPlayers.size() + " online:");
        for(Player player : allPlayers) {
            System.out.println("Player " + player.getName() + " is in world " + player.getWorld().getName());
        }
#

you can just do for(Player player : Bukkit.getOnlinePlayers())

kind hatch
#

for (Player player : Bukkit.getOnlinePlayers()) {}

tender shard
#

that's an enhanced for loop, so you don't have to iterate yourself

night torrent
#

thank you guys so much!

kind hatch
#

To be clear, you could do it manually, but it’s so much easier using the foreach

tender shard
hexed hatch
#

can the totem animation be triggered but render a different item?

tender shard
#

yes and no

#

it can only show totems

#

but you can use any custom model data you like

kind hatch
hexed hatch
#

So if I were to give a totem a custom texture with custom model data, the used totem would display that model?

tender shard
# hexed hatch So if I were to give a totem a custom texture with custom model data, the used t...
GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/AnimationUtils.java at 7582789ebcd0a2a60c2ae8863b3d1de97b218573 · JEFF-Media-GbR/JeffLib

hexed hatch
#

that's so fucking weird

sterile token
hexed hatch
#

so it does render an itemstack, but there's no way to make it render a different one?

#

that's some bullshit

kind hatch
tender shard
hexed hatch
#

Did you dig through nms and packets to see if this could be handled in a more direct way to just play the animation and supply it item data?

#

If not, I know what I'm going to be doing today

hexed hatch
#

Yes

#

Precisely

tender shard
#

yes that requires a custom modeldata for the totem, there's no other way

#

so resource pack is required

lavish hemlock
#

I FEEL

#

the Kevin MacLeod

#

coursing through my bones

tender shard
#

kevin macwhat?

hexed hatch
#

does anyone have that link to the protocol wiki thing

lavish hemlock
hexed hatch
#

I can never remember that url

#

thanks baby

lavish hemlock
#

Either way

#

All royalty-free music sounds the same

tender shard
#

it was builtin to windows movie maker lol

tender shard
# hexed hatch does anyone have that link to the protocol wiki thing

just do it with NMS, it never changes in remapped 😛

    @Override
    public void playTotemAnimation(final @NonNull org.bukkit.entity.Player player) {
        final ServerPlayer entityPlayer = ((CraftPlayer) player).getHandle();
        final Packet<?> packet = new ClientboundEntityEventPacket(entityPlayer, (byte) 35);
        final Connection playerConnection = entityPlayer.connection.connection;
        playerConnection.send(packet);
    }
lavish hemlock
#

It'd be cool if Bukkit had a proper packet API

tender shard
#

protocollib is cringe

#

setByte(0,35)

#

ugh

grim ice
#

@tender shard love u i fixed my problem

hexed hatch
#

genuinely annoyed that totems render actual itemstacks with meta but you can't choose what item to send

tender shard
hexed hatch
#

Admittedly it's a small thing to get annoyed about but still, the capability is right there just locked away

lavish hemlock
#

When I eventually make my own framework, Limestone, I'll just have all code mapped to Yarn or smthn

tender shard
#

instead of main hand if it's a totem or generic totem if it isn't

low temple
#

Is there any way to make a custom item texture for an item without regard to its durability?

tender shard
#

requires a resource pack, of course

low temple
#

gotcha, been doing some research on custom textures and all the tutorials out there need you to set the item to unbreakable and stuff

tender shard
#

yeah in ancient versions, people used durability

#

e.g. a stick with a damage of 69

#

but that's not needed anymore since 1.9 or so

#

my intellij always gets angry when I don't make everything final lol

grim ice
#

ok now another thing

#

how do i restrict access to a directory

#

in my website

tender shard
#

with a Location block

grim ice
#

so people cant do url/directory/ to see content

rough drift
#

who hurt you

tender shard
#
<Directory /var/www/DangerousDirectory/>
   Order Deny,allow
   Deny from all
</Directory>
grim ice
#

where do i write that

tender shard
#

in your vhost config

#

/etc/apache2/sites-enabled/mydomain.com.conf

#

e.g. like this

#

only that you add Deny from all instead of what I have inside

night torrent
#

I accidentally selected 1.18 on maven for my project version, but it's supposed to be for 1.16.5. Do I have to recreate the whole project to change that?

rough drift
#

no

tender shard
#

just replace 1.18 with 1.16.5 in your pom.xml

rough drift
#

and java ver

night torrent
#

whew, thanks!

tender shard
#

yes you should set the target and source to java 8 for 1.16

rough drift
#

what to post, no clue

#

but i should

tender shard
#

shower thoughts

rough drift
#

you... don't wanna know my shower thoughts

tender shard
#

i want to

rough drift
#

yeah no you'll start questioning existance

grim ice
#

i just used

#

<?php header("Location: http://" . $_SERVER['HTTP_HOST']); ?>

night torrent
#

so should i change this snip bit to 8?

low temple
#

Or are there limitations to different types of item e.g. tools

tender shard
fervent gate
#

How come player.getPersistentDataContainer() isn't recognized? I imported org.bukkit.entity.Player;

tender shard
grim ice
#

thats exactly what i needed

rough drift
#

entities don't have PDC

tender shard
#

entities do have PDC

rough drift
#

they do?!

#

WHEN

dusk flicker
#

always?

fervent gate
#

I've always used that

tender shard
rough drift
#

bruh

#

no

tender shard
rough drift
#

I've been lied to

fervent gate
#

I'm on 1.8 apparently wtf

dusk flicker
#

lol

tender shard
#

this has PDC:
1.14.1+: Entities, TileEntities, ItemMeta
1.16.3+: Chunks
1.18.1+: Worlds

rough drift
#

omg thats so useful

tender shard
#

it is, why do you think I have so many PDC libs lol

night torrent
fervent gate
#

nvm, I'm on 1.18

rough drift
#

NO

#

you don't

ornate patio
#

why does this return a map?

tender shard
rough drift
#

it will change to what you set bove

ornate patio
#

shouldn't it be PluginCommand

rough drift
#

no they don't

night torrent
#

???

fervent gate
#

@tender shard

rough drift
tender shard
dusk flicker
#

thats not the api you use tho

rough drift
#

you don't need to

tender shard
rough drift
#

maven automatically does it

fervent gate
#

yes

tender shard
rough drift
#

when why tell them to change it

night torrent
tender shard
#

either add 8 into source and target, or change the property in <properties>

#

makes no difference

rough drift
#

they did

tender shard
#

it does the same thing

tender shard
#

what version of spigot-api do you have in your <dependencies>?

#

probably not 1.18.x

night torrent
#

should i have to change this to switch from 1.18 to 1.16?

tender shard
#

you should however also set your dependency of spigot-api to 1.16.5 or whatever

night torrent
#

alright

#

i changed this

#

but when I run /plugins it says 0

tender shard
#

then look into your server log

night torrent
#

interesting

#

01.04 19:03:12 [Server] Server thread/ERROR Could not load 'plugins/original-PoisonWasteland-1.0-SNAPSHOT.jar' in folder 'plugins'

tender shard
#

it would be helpful if you'd show the full error message instead of just this

night torrent
#

this isn't it but it might be the root of the problem

#

01.04 19:06:26 [Server] INFO org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.18

tender shard
#

you have set "api-version" to 1.18 in your plugin.yml

#

you must obviously use "1.16" or lower to make it work with 1.16

#

I always use "1.13" since that works with ALL versions

night torrent
#

oh ok

#

should I just set it to 1.13

tender shard
#

if you don't care about supporting 1.15 and older, go for 1.16

night torrent
#

is there a difference between 1.13 and 1.16?

tender shard
#

in "api-version"? no

#

the only important thing is that you have set it to a valid value at all

night torrent
tender shard
#

you can use 1.13, as I said

eternal oxide
#

api features which are only in newer versions

tender shard
#

they will still work fine

#

I ALWAYS use api-version 1.13

#

that doesn't mean you can't use features that were added in 1.18.2

eternal oxide
#

not if they don;t exist in older versions

tender shard
#

trust me, it works

#

if you want proof: world.getMinHeight was added in 1.16.4

eternal oxide
#

if your server is 1.13 you can't use features which only exist in 1.16

night torrent
#

ohhhh

tender shard
#

we were talking about the fact that even if you set "api-version" to 1.13 in plugin.yml, it doesn't prevent you to use newer features

eternal oxide
#

if you set your api version to 1.13, that plugin will attempt to run on 1.13 if they try it

tender shard
#

no...

tender shard
#

and now look at this:

eternal oxide
#

as in if they put it on a 1.13 server

tender shard
night torrent
#

01.04 19:10:09 [Server] Server thread/WARN Task #3 for PoisonWasteland v1.0-SNAPSHOT generated an exception
01.04 19:10:09 [Server] INFO java.lang.NullPointerException: null
01.04 19:10:09 [Server] INFO at me.thebreadperson.poisonwasteland.tasks.Poison.run(Poison.java:30) ~[?:?]

#

not quite sure why I'm getting null exception

tender shard
#

what is line 30?

#

inventory().getHelmet() is probably null

night torrent
#

the if(player)

night torrent
tender shard
#

because they don't wear a helmet

night torrent
#

ohhh

#

so how would I run this if they don't have a helmet?

tender shard
#

check if inventory.getHelmet() == null

#

if yes, don't call getType() on it

night torrent
#

ok got it

#

one last thing though

#

just tried re-packaging after a change, now I'm getting this

tender shard
#

seems like you are running java 7 or older

night torrent
#

I just changed the duration for a potion effect

tender shard
#

file -> project structure -> project

#

what value do you have for "SDK"?

#

It should be 8 or higher

night torrent
tender shard
#

wait

#

show your pom.xml

#

you set it to 8}

#

it must be 8

#

not 8}

night torrent
#

im dumb

worldly ingot
#

May even have to be 1.8 unless Maven made exceptions

night torrent
#

works now!

worldly ingot
#

It was 1.1 -> 1.8 iirc, then they changed the release naming scheme to 9+

tender shard
worldly ingot
#

They must have made exception then

tender shard
tender shard
night torrent
#

back to step one

#

plugins = 0 when i run the command

#

wtf

tender shard
#

send your log

night torrent
#

no errors

sage dragon
#

Still, send us the log, please

tender shard
#

then you didnt put it in the plugins/ folder

night torrent
#

i did though

tender shard
#

then there's an error

night torrent
#

one sec

tender shard
#

?paste

undone axleBOT
night torrent
#

wait

#

I have errors now

night torrent
tender shard
#

you paste your stuff, then click on the save button, then send the link

night torrent
tender shard
#

the api version must be "1.16" and not "1.16.5"

night torrent
#

ohhhh thanks

#

it works!

tender shard
#

np 🙂

fervent gate
tender shard
#

?paste

undone axleBOT
fervent gate
#

line 89 I think

tender shard
#

if you try to compile it, what's the error message?

fervent gate
#

cannot find symbol

tender shard
#

send the full compiler log pls

#

to get the full log, click on the uppermost entry here

#

then copy everything from the output on the right

fervent gate
#

this?

tender shard
#

hm

#

send your full pom.xml pls

sage dragon
#

What Java version are you using?

fervent gate
#

8

#

I think

sage dragon
#

Well, you need 17 for 1.18

night torrent
#

is there anyway to increase fog in spigot?

fervent gate
#

1.8

#

yea nah, I'm using 1.18

tender shard
fervent gate
#

lemme send POM

tender shard
#

bukkit is compiled against java 8

#

there'd be other error messages anway if this WOULD be the problem

fervent gate
tender shard
#

hm this is weird, I have no idea

#

what did you click to compile? mvn package?

fervent gate
#

yea

tender shard
#

very very weird

worldly ingot
#

Run mvn package with -X flag

#

Send full build log

sage dragon
tender shard
worldly ingot
#

yeah, if depending on the API, should be fine to compile with 8

tender shard
#

and even if it would the problem, it'd say stuff like "bad major minor version" or "cannot stat org.bukkit...."

fervent gate
tender shard
#

instead of just not finding a certain method

sage dragon
#

Okay, weird I guess 🤷

worldly ingot
#

Though if your minimum target is 1.18, you really might as well jump to 17 lol

tender shard
#

click this

worldly ingot
#

There might be an option in your IDE, bram. Either there's a checkbox that says "debug" or you can specify the args yourself

tender shard
#

then enter this

worldly ingot
#

Ye

tender shard
#

mvn clean package -U -X

onyx fjord
#

Is it possible to mix variables and text in java like in js? (i mean something like is: `text, ${variable}`

worldly ingot
#

Not quite to the same degree but there is format methods

#

"My name is %s".formatted("2008Choco");

fervent gate
onyx fjord
worldly ingot
#

Then add more %s'

#

That .formatted() method takes varargs

worldly ingot
# fervent gate this is the full build thing

[ERROR] /F:/IdleClicker/src/main/java/me/cosmic/commands/WipePlayer.java:[30,59] cannot find symbol
[ERROR] symbol: method getPersistentDataContainer()
[ERROR] location: variable target of type org.bukkit.entity.Player
Are you sure you're compiling against Spigot 1.18?

#

Because it can't find that method which was added in 1.14

fervent gate
#

this is the plugin.yml

worldly ingot
#

Dependency is what matters, not the plugin.yml

#

The pom.xml, what's the version set for spigot-api?

worldly ingot
fervent gate
#
<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot-api</artifactId>
  <version>1.18.1-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
worldly ingot
#

Got anything else you're depending on?

tender shard
#

just for fun, run buildtools with --rev 1.18.1

#

or change 1.18.1 to 1.18.2

#

maybe you have somehow miraculously installed some other version to your local maven repo or sth

#

that's the only thing I can imagine lol

worldly ingot
#

Nah, I'd just imagine there's another transient Bukkit dependency

fervent gate
#
<dependency>
            <groupId>com.jeff_media</groupId>
            <artifactId>CustomBlockData</artifactId>
            <version>1.0.5</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

all dependencys

worldly ingot
#

Oh what a funny looking dependency you've got there

#

cc @ alex

fervent gate
#

Ofcourse

#

🙂

#

it works on another plugin, I can just compile rn with the exact same code

worldly ingot
#

Nothing obvious that stands out there, though you should put the spigot-api at the top. I believe ordering matters

fervent gate
#

but there is a lot more code in there so I wanted to create a cleaner version

fervent gate
#

that

#

worked

#

damn

worldly ingot
#

Yeah, I think Vault compiles against a much earlier version of Bukkit (because it really doesn't need anything beyond when services were added)

#

It was taking priority over your dependency

tender shard
#

oh

eternal night
#

Just exclude Bukkit from vault

#

?

tender shard
#

fuck vault

worldly ingot
#

Sure, but it's still good practice to put it at the top

#

That way you don't have to exclude

fervent gate
onyx fjord
fervent gate
#

or create ur own?

eternal night
#

I mean declarative exclude > order

worldly ingot
#

Vault is fine, it's standard lol

#

Just not async is all

tender shard
fervent gate
#

ah ok

tender shard
#

isn't it possible to maven to show the whole dependency tree?

fervent gate
#

saw it somewhere earlier today someone saying that "vault is a joke"

worldly ingot
#

Or something like that. I always forget it. StringFormatter has documentation on how it works iirc

#

It's %2$s

tender shard
onyx fjord
#

js approach is more than good enough

#

and clean

worldly ingot
#

C# formatting is relatively similar, though JS' in-built expression evaluation is nice

tender shard
#

if you enter "asdasdasd${asd}" I expect it to print exactly that

worldly ingot
#

Well, it does

tender shard
#

if you want ${asd} to be replaced with something, you must a method for that

tender shard
onyx fjord
#

it only prints variable if its defined

worldly ingot
#

You have to use ` for it to insert lol

onyx fjord
#

oh yea lmao

worldly ingot
#

String literals

#

"asdasdasd${asd}" will print exactly that, whereas `asdasdasd${asd}` will fail to compile

#

Stupid backticks

#

UGH lol

onyx fjord
#
  • you always know what is what cuz u can do ${name} instead of %s nobody has fucking idea what that is until checks later code
tender shard
#

backticks are ugly yes

#

lol

worldly ingot
#

Nah it's just that asd doesn't evaluate to anything

tender shard
worldly ingot
#

`Hello ${name}` will insert the name variable

onyx fjord
#

cough: public static void main(String [args])

onyx fjord
vocal cloud
tender shard
onyx fjord
tender shard
#

mkdirs also creates missing parent directories

#

e.g. if you do "C:\SomethingNonExistent\Something" . mkdir

#

it will fail

#

because C:\SomethingnonExistent doesnt exist

#

np 🙂

onyx fjord
#

how do you get player name from msg.getSender()?

eternal night
#

instanceOf the sender

#

Check if it's a player

#

Tho idk what msg even is

onyx fjord
#

its message from asyncplayerchatevent

eternal night
#

Message is a strong

#

What kind of .getSender are you calling ?

#

And yea, what morice said

onyx fjord
#

spinning block on players head?

#

you would have to attach armorstand

limber patio
#

How can I give people the ability to enter data into mysql in config, I've tried every tutorial and I don't know something is not working

crisp steeple
#

i would advise against letting players directly insert into a database

tender shard
#
  1. getConfig is not a field
#
  1. to access the METHOD getConfig() from another class, you need a reference to your instance of the class that extends java plugin
#

and I also sent you a link on how to do that

ancient plank
#

java is too hard

#

pls teach me personally

tender shard
#

ok

#

I will

#

on 24th feb 2038

ancient plank
#

hytale???

tender shard
#

lol

tender shard
shrewd solstice
#

how do i increase the power of a fireball spigot?

vocal cloud
#

When it hits you just set the damage to whatever you like

tender shard
#

set it to Double.NaN and see what happens

shrewd solstice
#

ok but... how?

vocal cloud
#

Double.MAX_VALUE

tender shard
#

EntityDamageByEntityEvent I guess

vocal cloud
#

By listening for the event and then setting it

#

?jd-s

undone axleBOT
vocal cloud
#

Yeah probably that event

#

you can either cancel the event and subtract health to deal guaranteed true damage or just up the number in the event

tender shard
#
    public static void main(String... args) {
        double nan = 0.0d / 0.0;
        System.out.println("0.0d / 0.0: " + nan);
        System.out.println("as int: " + (int) nan);
    }
0.0d / 0.0: NaN
as int: 0
#

NaN is weird

vocal cloud
#

I imagine it counts as sorta null and since numbers can't be null it defaults to 0?

tender shard
#

it's a normal number value though

#

A constant holding a Not-a-Number (NaN) value of type double. It is equivalent to the value returned by Double.longBitsToDouble(0x7ff8000000000000L).

vocal cloud
tender shard
#

also and this is the weirdest thing:

#

Double.NaN == Double.NaN returns FALSE

#

nan == nan: false
(int) nan == (int) nan: true

#

casting it to float will make it false again

vocal cloud
#

At least it isn't something that will come up often

undone axleBOT
tranquil viper
#

Anyone know how to fix this? Let me know if you need to see any other files. Also, when I compiled/exported the .jar it didn’t seem to take the yaml files with it.

spring minnow
#

is there a way to enchant player heads?

#

they don't get enchanted but every other thing yes

#

why is minecraft cursed

chrome beacon
#

Mojank as we like to call it

quaint mantle
#

or what u want 2 give them?

spring minnow
#

it can only have that?

quaint mantle
#

dunno

spring minnow
#

idk just a random enchant to get the visual effect

#

its not important what enchant

#

but i can't add curse of binding...

quaint mantle
#

version?^^

spring minnow
#

what does curse of vanish do? (don't remembe rxD)