#help-development

1 messages · Page 1627 of 1

echo saddle
#

but too lazy to test them

native nexus
#

Location or chunk could be null make sure to check that first.

stone sinew
torn shuttle
native nexus
#

I hate sql so much

torn shuttle
#

well I'm out to go do way too much home renovation work

#

pray 4 my lungs

native nexus
#

Good luck

echo saddle
#

gotta keep the wifie happy

torn shuttle
#

more like gotta make sure my parents don't accidentally kill themselves doing it instead

echo saddle
#

yeh, guess I'll post all these plugin updates later, might go play some games

tardy delta
#

has anyone used the goldencrates plugin?

quaint mantle
#
        livingEntity.getLocation().getChunk().load();
        Bukkit.broadcastMessage(livingEntity.getLocation().getChunk().isLoaded() + ""); // true
        livingEntity.remove();```  here's my code and I died at same world
#

and chunk is loaded

#

hmm

#

bump!

stone sinew
real spear
reef wind
plain oxide
#

Isn't the team scoreboard running out when there are 16 or more people?

quaint mantle
# stone sinew Chunk loading isn't instant... You need to check ChunkLoadEvent or add a delay t...

thanks you, but LivingEntity livingEntity = BossCore.getBoss(player); livingEntity.getLocation().getChunk().load(); Bukkit.broadcastMessage(livingEntity.getLocation().getChunk().isLoaded() + ""); new BukkitRunnable() { public void run() { livingEntity.remove(); Bukkit.broadcastMessage("Remove!"); } }.runTaskLater(totoServerPlugin.getInstance(), 20); code failed, so I tried

    public void chunk(ChunkLoadEvent event) {
        Bukkit.broadcastMessage("event");
        for (Entity entity : event.getChunk().getEntities()) {
            if (entity.getType() == EntityType.ZOMBIE) entity.remove();
        }
    }``` but still not working 😦
hardy swan
stone sinew
stone sinew
#

Debug the entities.

#

Try adding a delay on the load chunk then. That seems odd it wouldn't have entities.

ivory sleet
#

3 isnt possible iirc

#

but 5 is if its a hopper

#

oh

#

yeah 3x3

hardy swan
#

Any known way of making dispenser drop certain items that contain special properties, like certain arrows, armor, potions

noble axle
#

I don't think you need to load the chunk btw

#

.remove() should work anyways

#

are you getting the correct entity?

crude charm
#

InventoryType

#

Hopper is 5x1 and 3x3 is dropper / dispenser

young knoll
hardy swan
#

At least those with custom model data

#

Unless you are saying storing sth in PDC

#

Im trying to prevent a custom horse armor to be equipped through dispenser

young knoll
#

Ah

hardy swan
#

But the worst part is neither BlockDispenseEvent nor BlockDispenseArmorEvent is called

young knoll
#

That would probably qualify as a bug

hardy swan
#

Hmm, think so too

hexed hatch
hexed hatch
#

Oh nice

hardy swan
#

Reported issue. other armor equipment, such as equipping villager with armor, are firing fine. seems to be an overlook

vast sapphire
#
                                p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE);
                                p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed"));
                                loc.add(p.getTargetBlock((Set<Material>) null, 3).getLocation());
                                Generators.getInstance().getConfig().set("Location", loc);
                                Generators.getInstance().saveConfig();``` I tried to make an arraylist for the loc variable so every time I place a new block it adds a loc and when I remove it, it removes the loc variable from the config, this just overwrites every location I place the block down
toxic mesa
#

Can anyone help me with protocollib or give me a good tutorial for it?
My goal:
Listening to the entity position packet and get the delta x, delta y & delta z
Dont rlly know how to get started learning how to use protocollib

vast sapphire
# toxic mesa Can anyone help me with protocollib or give me a good tutorial for it? My goal: ...

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
echo basalt
#

But that guy's discord server has lots of help available

#

And I'm often there to help

echo basalt
crimson scarab
#

ideas on how to implement zeuses bolt into minecraft

tardy delta
#

is there a way why fileconfig.getLocation would not work? or do i need to get the xyz apart

vast sapphire
forest edge
#

Does anyone know if it is possible to change the custom name of an entity based on the player viewing it (basically, a packet that can be sent to change entity name that is per-player?)

regal moat
#

having a problem

#

with databases

#

help

#

imma explain

forest edge
vast sapphire
#

well this is my array list java ArrayList<Location> loc = new ArrayList<Location>();

#

then I add to it on each block placement

forest edge
#

There's your issue. You aren't loading existing locations from the config

regal moat
#

the coin value gets set to null everytime i restart the server

forest edge
#

you are just making a new list every time and setting that in the config

#

It will be a lot easier for people to help if you put your issue in one message

vast sapphire
echo basalt
#

bruh I hate this

#

100% hate this

regal moat
#

thanks

humble heath
#

how do i get the args target name in to a nother class

regal moat
#

saying that i am a beginner at java and spigot

echo basalt
#

1 - Follow naming conventions
2 - Don't name your main class as Main, there are like 20 other Main classes and it can get confusing

#

Initialize your configs onEnable and make a public getter instead of having the configs themselves public

humble heath
echo basalt
#

add a return; after the Player is null message

forest edge
# vast sapphire so how would I save the list?

First off, are you loading your files async during runtime? I'd either recommend doing that or only loading your list in onEnable and saving it onDisable (to prevent loading files on the main thread during runtime).

You are saving the list of locations fine, the problem is you don't seem to be loading the list from the config. Load the list from the config, add the location, then save it.

regal moat
#

Please.

tardy delta
#

is there a way to remove this message?

vast sapphire
#

is this going to spawn an item at my location if the location is valid? ```java
BukkitScheduler scheduler = getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(Generators.getInstance(), new Runnable() {
@Override
public void run() {

                    switch (getWorld("world").getBlockAt(blockLocation).getType()) {
                        case IRON_ORE:
                            getWorld("world").dropItem(blockLocation.add(0, 1, 0), new ItemStack(Material.IRON_INGOT, 1));

                            }
                        }
                    }, 0L, 30L);```
#

I haven't got an item to spawn with this

#

It goes with my blocklocation var when I placew the block down

#

yeah i'm going to add more and I forgot to break out of the loop lol

proud basin
#

@regal moat Connect to your db using async

tardy delta
#

is there a fast way to check if the item in the players mainhand is a sword?

regal moat
vast sapphire
proud basin
#

AsyncPlayerPreLoginEvent

tardy delta
#

yea and not comparing it to every sword?

vast sapphire
#

ah ok

tardy delta
#

i was thinking about Tag.SWORD but there isnt

#

oh yea

#

or i found this
if(EnchantTarget.WEAPON.includes(item))

#

dunno if that includes axes etc

worldly ingot
#

It does iirc

#

Just setup an EnumSet of your own

regal moat
#

and there is no #getPlayer()

#

and im confused

#
main.getServer().getPlayer(e.getUniqueId())
#

what about this

worldly ingot
#
private static final Set<Material> SWORDS = EnumSet.of(
    Material.WOODEN_SWORD,
    Material.STONE_SWORD,
    Material.IRON_SWORD,
    Material.GOLD_SWORD,
    Material.DIAMOND_SWORD,
    Material.NETHERITE_SWORD
);

if (SWORDS.contains(material)) {
    // It's a sword
}```
stone sinew
bright jasper
#

Made some pretty cool formats for my plugin lmao

regal moat
tardy delta
worldly ingot
#

I'd avoid name-based checks

bright jasper
#

add an NBT to the item

worldly ingot
#

The EnumSet is going to be significantly more performant because it's backed by a bit vector

#

contains() operations are O(1)

tardy delta
#

hmm

stone sinew
tardy delta
#

lets use the enumset then

worldly ingot
#

Yeah, you just have to copy/paste that set wherever you need to use it

worldly ingot
#

It's mutable so I'd avoid that

bright jasper
#

Im under the impression btw that getOfflinePlayer stores player info and checks for it in the main world. So for my own plugin i should most likely store player data cached in database if i need that data to not rely on the world?

regal moat
#

So, 😅

stone sinew
regal moat
#

where can i get help for sql?

crimson scarab
#

can somebody give me a guide like a link for custom textures

patent quarry
#

Hey, Is there a way to know if a player is walking by just using the object Player ?

regal moat
#

?paste

undone axleBOT
regal moat
#

It keeps running when the player leaves

patent quarry
chrome beacon
undone axleBOT
hazy igloo
ivory sleet
#

?services @tropic roost

undone axleBOT
echo basalt
#

set a variable on the MoveEvent if the distance is not 0

#

indicating the player is moving

#

and on the next tick, if the player is not moving, set it back

patent quarry
#

Yes i don't want use this event ^^

#

But I think I don't have the choice

quaint mantle
#

how do i get the status of a server in a bungee instance?

#

like whitelist, offline, online

regal moat
#

I fixed the coin null problem but now the coin amount resets evertime I relogin.

#

?paste

undone axleBOT
regal moat
#

no errors

#

i have no idea what i am doing wrong please help me

#

I'm storing the coin amount by the UUID

#

I mean, I hope I am

#

Because that is what I ment to do

#

Yeah I am doing that

#

Well

#

Kinda

#

It all says success

#
[19:36:48] [User Authenticator #1/INFO]: SUCCESS: Successfully connected to database.
[19:36:48] [User Authenticator #1/INFO]: SUCCESS: Successfully prepared statement.
[19:36:48] [User Authenticator #1/INFO]: SUCCESS: Successfully prepared statement.
[19:36:48] [User Authenticator #1/INFO]: UUID of player Splashny is 24cc915a-2997-4397-8d30-e1447d8dd8f2
[19:36:48] [Server thread/INFO]: Splashny[/127.0.0.1:59167] logged in with entity id 214 at ([world]-267.9647924464111, 70.0, 165.30000001192093)
#

Does all that while logging in

#

and sends the action bar when joined

#

and while logged in

hazy igloo
regal moat
#

i use a command called /setcoin

#

wait

#

i know the problem

#

😄

#

i am changing the hashmaps values

#

not the databases

#

lol

#

the thing was about my command

#

all these times

#

omfg i am an idiot

#

lets just save the hashmap to the database on quit

quaint mantle
#

.

#

how to checjk status of a sevrer

granite pilot
#

Is the first time someone connected to a server saved somewhere?

granite pilot
#

Thank you.

tardy delta
#

is there an event that gets fired when the players changes gamemode?

ornate heart
tardy delta
#

aha thankyou

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

halp, i have no idea wot's going on ;-;, I had a command that wasn't working so i went back to my github to copy it from when it did work but now that's not working https://paste.md-5.net/tadayuhuxa.java

#

it used to send a message to the player with all the warp locations but now it doesn't, and instead it just prints
[10:02:44] [Server thread/INFO]: Radiant_Bee issued server command: /listlocations
[10:02:45] [Server thread/INFO]: []
in the console for some reason

regal moat
#

Is there an event for server shutting down?

tardy delta
#

does adding a player to the server's banlist automatically kickes them?

young knoll
quaint mantle
#

try

tardy delta
#

doesnt seems to work

young knoll
#

Then no

tardy delta
#

the list seems to be empty

quaint mantle
#

it shouldn't be i have three coordinate and name pairs in my json file

prisma needle
#

For some reason, when I use player.getLocation().getDirection() it gives me some very strange results. For example:

-1.0, -0.0, 6.123233995736766E-17
-1.2246467991473532E-16, -0.0, -1.0
1.0, -0.0, -1.8369701987210297E-16

It makes no sense as to why the numbers should have values extremely close to 0 not be completely 0. Any reason why this is happening and how I can fix it?

chrome beacon
prisma needle
#

Make a new vector with the rounded values of the incorrect vector?

chrome beacon
#

Yeah you can do that. Why do you need an exact value, might be a better way to do things

prisma needle
#

Im using those values in calculations, so even though the error is very small... after a lot of equations that error gets bigger and messes some stuff up

quaint mantle
#

how to checjk status of a sevrer

chrome beacon
quaint mantle
#

how 2 handshake serever

chrome beacon
#

Do you have NMS in your project

quaint mantle
#

hell naw

chrome beacon
#

Building something standalone?

quaint mantle
#

mhm

#

i want make placeholder for saying online or offline above server npc

chrome beacon
#

Then use Netty or whatever to send the request

#

or you could just send anything and see if there's a response from the server...

quaint mantle
#

to complicated

tardy delta
#

uhh when i start my plugin the config file doesnt include all the lines from the default one

#

like normally i have 70 lines

#

and now 20

#

i dont see errors

chrome beacon
#

Delete the saved one and let it regenerate

tardy delta
#

i already did i guess let me try again

#

it doesnt

#

hmm i think it is a method overwriting something

vast sapphire
#
                        switch (args[0].toLowerCase()) {
                            case "iron":
                                p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE);


                                blockLocation = p.getTargetBlock((Set<Material>) null, 3).getLocation();
                                loc.add(blockLocation);
                                p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed at " + blockLocation.getBlockX() + ", " + blockLocation.getBlockY() + ", " + blockLocation.getBlockZ()));
                                Generators.getInstance().getConfig().set("Location", loc);
                                Generators.getInstance().saveConfig();
                        }``` how do I save an arraylist of locations in the config? this just overwrites it; ArrayList > ```v
ArrayList<Location> loc = new ArrayList<Location>();```
tardy delta
#

how could this break the file?

plugin.getConfig().set("spawn.world", l.getWorld().getName());
        plugin.getConfig().set("spawn.x", l.getX());
        plugin.getConfig().set("spawn.y", l.getY());
        plugin.getConfig().set("spawn.z", l.getZ());
        plugin.getConfig().set("spawn.yaw", l.getYaw());
        plugin.getConfig().set("spawn.pitch", l.getPitch());
        ConfigManager.saveConfig(ConfigManager.FileType.CONFIG);
vast sapphire
tardy delta
#

more

vast sapphire
#

ah

tardy delta
#

yea the filetype..

paper viper
#

You don’t have to read all of that

tardy delta
#

yes i'm sure

paper viper
#

Then why you doing it

tardy delta
#

i'm changing it and forgot that one..

vast sapphire
#

are you just setting one location?

tardy delta
#

yes the spawn location of the world by default

vast sapphire
#

I need help with an array of locations

tardy delta
#

in onEnable atleast

vast sapphire
tardy delta
#

iterate over them and save them to the file

vast sapphire
#

hm ok

tardy delta
#

its broken again

#

when i remove the file and reload the plugin the file is created normal

vast sapphire
#

so I have this much java switch (args[0].toLowerCase()) { case "iron": p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE); blockLocation = p.getTargetBlock((Set<Material>) null, 3).getLocation(); Generators.getInstance().locations.add(blockLocation); p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed at " + blockLocation.getBlockX() + ", " + blockLocation.getBlockY() + ", " + blockLocation.getBlockZ())); Generators.getInstance().getConfig().set("Location", Generators.instance.locations); Generators.getInstance().saveConfig(); } main class: java public List<Location> locations; public void onEnable() { locations = (List<Location>) getConfig().get("locations"); } and location is null

grim ice
#

check if location is not null

#

easy

vast sapphire
#

still overwriting the config

narrow vessel
#

you dont have a license nor a readme

#

set up your github correctly smh

plain oxide
#

thanks

vast sapphire
# vast sapphire so I have this much ```java switch (args[0].toLowerCase(...
                        switch (args[0].toLowerCase()) {
                            case "iron":
                                p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE);
                                blockLocation = p.getTargetBlock((Set<Material>) null, 3).getLocation();
                                if (Generators.getInstance().locations != null)
                                    Generators.getInstance().locations.add(blockLocation);
                                    p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed at " + blockLocation.getBlockX() + ", " + blockLocation.getBlockY() + ", " + blockLocation.getBlockZ()));
                                    Generators.getInstance().getConfig().set("Location", Generators.instance.locations);
                                    Generators.getInstance().saveConfig();

                        }``` notnull check stops the error but the locations are still getting overwritten
vast sapphire
forest edge
tardy delta
#

is a location also deserializable?

ivory sleet
#

yeas

tardy delta
#

my code is doing strange things

forest edge
ivory sleet
#

iirc has to be registered with ConfigurationSerialization but yeah

grim ice
#

too bad

#

idk bout liscenses

narrow vessel
forest edge
gritty urchin
#

Hey, how would I make a custom event that exectutes when a specific condition is met.

ebon siren
#

does anybody know a good way to test plugins (1.16.x) in singleplayer

tardy delta
#

not?

ebon siren
#

oh

tardy delta
#

for some reason this damages my config file
return plugin.getConfig().getLocation("spawn");

#

Spawn.setLocation(getServer().getWorlds().get(0).getSpawnLocation());

proud basin
#

if I is greater than 1 how can I be less than 1 if I is greater than 1

tardy delta
#

what

#

not

#

😳

grim ice
#

just do it urself

#

lazy fuck

#

jk

#

idk

tardy delta
#

:fluh

#

update the plugin when you compile it :/

#

why not when you publish a new version

ivory sleet
#

myeas

#

gradle can do that 😄

regal moat
#

?paste

undone axleBOT
regal moat
#

i need this for a sec

#

Main: https://paste.md-5.net/irudumerew.java
Listener: https://paste.md-5.net/azicewulok.java
So I am trying to save some info to the database when the server is shutting down.
But It ain't workin'.
Giving an out an error at line 60 (new OnJoin(this).prepareStatement("UPDATE usercoin SET COIN = '" + getUserCoin().get(p.getUniqueId().toString()) + "' WHERE UUID = '" + p.getUniqueId().toString() + "'").executeUpdate();)
Error: ```java
[21:38:01] [Server thread/INFO]: [Shaza] Disabling Shaza v1.0-SNAPSHOT
[21:38:01] [Server thread/ERROR]: Error occurred while disabling Shaza v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: null
at sh.aza.OnJoin.prepareStatement(OnJoin.java:111) ~[?:?]
at sh.aza.Shaza.onDisable(Shaza.java:60) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:350) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:437) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:424) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:417) ~[patched_1.12.2.jar:git-Paper-1618]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.disablePlugins(CraftServer.java:363) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.MinecraftServer.stop(MinecraftServer.java:486) ~[patched_1.12.2.jar:git-Paper-1618]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:702) ~[patched_1.12.2.jar:git-Paper-1618]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]

proud basin
#

Why not save when they disconnect?

regal moat
#

well i do that

#

but it doesnt save it when the server shuts down

#

the player does disconnect

proud basin
#

Are you saving whenever they get a new coins or removed?

regal moat
#

I am saving it when the player quits

tardy delta
#

error occurred while disabling

#

smh

regal moat
#

I have no idea what I am doing wrong

#

I am totally new to Java & Spigot

young knoll
#

java.lang.NullPointerException: null
at sh.aza.OnJoin.prepareStatement(OnJoin.java:111) ~[?:?]

regal moat
#

line 111 is ps = conn.prepareStatement(query);

paper viper
#

What is conn and query

regal moat
#

conn is connection

paper viper
#

No

#

Where do you define

#

Them

#

I obviously know what they are lol

regal moat
#

No, no

#

It works fine in the OnJoin file

#

where they are defined

paper viper
#

The only reason that could be throwing a NPE is either from conn being null (which is likely), or the method throws a NPE

#

Nothing else

regal moat
#

Hmm

#

It is player join event...

#

I still have no idea how to fix it

hybrid spoke
#

it will never open the connection so it stays null

#

you are trying to use a connection which doesnt exist

#

you never instantiate it

#

just if a player joins the server which is not the case in onDisable

regal moat
#

No. I am saving all the players info on disable

hybrid spoke
#

yeah

#

but to nowhere

#

since there is no connection

#

and because of that you are receiving a NPE

vale ember
#

hi everyone i have a question
i am making inventory GUI plugin and i have a problem
i set eventhandler on item inside inventory to close inventory
and eventhandler with hight priority with event.setCanceled(true)
but when i click shift+left click on this item inventory close but item
duplicating in player inventory, how i fix it?

proud basin
#

Could we see some code?

vale ember
#

yeah 1 second

maiden briar
#

Java finds that 38%0.4 = 0.3999999999999979 (taken from system out println)
But if I type this in my calculator it sais 32 / 0.4 = 80, that means the rest is 0

vale ember
#

@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick_(InventoryClickEvent event) {
if (event.getInventory().equals(owner) && Objects.equals(event.getCurrentItem(), itemStack)) {
event.setCancelled(cancelMovement);
}
}

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (event.getInventory().equals(owner) && Objects.equals(event.getCurrentItem(), itemStack)) {
        onClick(event);
    }
}

protected void onClick(InventoryClickEvent event) {}
#

gui.addPatternCorrespondence("ds", new ChestGUIClickableItem(diamondSword, gui.getInventory(), true) {
@Override
protected void onClick(InventoryClickEvent event) {
event.getWhoClicked().closeInventory();
}
});

hybrid spoke
#

?paste

undone axleBOT
forest edge
#

Using packets does anyone know if it is possible to hide an entity but still show its custom name?

vale ember
forest edge
#

I'm trying to do this with enderpearls, unfortunately. Using only armorstands for my purpose (player nametags) does not get the right spacing

#

or... maybe it does? going to test some more.

vast sapphire
#

does anyone know how to save more than one location to a config?

ashen apex
#

So for luckperms I put the db file that has the ranks and everything already made , then when I start the server, it overwrites everything and only leaves the default rank. Anyone know a solution to not have it overwrite everything? I can paste the code that’s in the file. It’s like 6k lines though.

digital plinth
#

to multiple configs?

#

a config can have multiple nodes

unkempt ore
#

What are you trying to do

vast sapphire
# unkempt ore What exactly is stopping you from doing this
                        switch (args[0].toLowerCase()) {
                            case "iron":
                                p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE);
                                blockLocation = p.getTargetBlock((Set<Material>) null, 3).getLocation();
                                if (Generators.getInstance().locations != null)
                                    Generators.getInstance().locations.add(blockLocation);
                                    p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed at " + blockLocation.getBlockX() + ", " + blockLocation.getBlockY() + ", " + blockLocation.getBlockZ()));
                                    Generators.getInstance().getConfig().set("locations", Generators.instance.locations);
                                    Generators.getInstance().saveConfig();
                        }```
#
public List<Location> locations;
public void onEnable() {
locations = (List<Location>) getConfig().get("locations");
}``` Main class
#

I need to save multiple blockLocations to the config

#

but every time I create a new iron gen, it overwrites the cfg

regal moat
#

It's something about the connection

#

But I'm also new to databases :p

#

Caused by: java.net.UnknownHostException: null

#

fuck

shy wolf
#

how can i make player fly?

regal moat
#

i think.

shy wolf
#

ty

hybrid spoke
hybrid spoke
regal moat
#

until now

#

😄

regal moat
#

I am horribly, terribly new to databases

paper viper
#

This is a Java thing man

#

Not DB

regal moat
#

I am also new to Java 😅

digital plinth
#

what is the best way to remove all blocks from a world

hybrid spoke
#
    @Override
    public void onDisable() {
        for (Player p: Bukkit.getOnlinePlayers()){
            try {
                new OnJoin(this).prepareStatement("UPDATE usercoin SET COIN = '" + getUserCoin().get(p.getUniqueId().toString()) + "' WHERE UUID = '" + p.getUniqueId().toString() + "'").executeUpdate(); // this will not work, since "conn" in your #prepareStatement method is always null.
            } catch (SQLException throwables) {
                throwables.printStackTrace();
            }
        }
        getLogger().info("Shaza -- Goodbye!");
    }

Now you are asking yourself: "Why is that null? I am instantiating it in my #onLogin method!"

Yes, you do. But since you never register the event and neither a player is logging in on disabling the plugin (most likely, and if they do the plugin won't notice it anymore), your EventHandler will never fire, so conn stays null.

    public PreparedStatement prepareStatement(String query){
        PreparedStatement ps = null;
        try {
            ps = conn.prepareStatement(query); // conn is never being instantiated until here, so it **will** be null
            System.out.println("SUCCESS: Successfully prepared statement.");
        } catch (SQLException x) {
            x.printStackTrace();
            System.out.println("ERROR: Couldn't prepare statement.");
        }
        return ps;
    }
digital plinth
#

set all block to air when a chunk is loaded?

paper viper
#

ChunkLoadEvent

#

And use the Chunk provided

grim ice
#

?paste

undone axleBOT
digital plinth
#

okie thx

regal moat
#

i am pretty sure

#

i registered

#

the event

hybrid spoke
#

yeah another instance of that class

grim ice
hybrid spoke
#

which will act as your listener

grim ice
#

?paste

undone axleBOT
hybrid spoke
#

but not the one you are using since you are creating a new one

#

*new* OnJoin(this).prepare..

grim ice
#

error

#

thanks in advance

digital plinth
#

how do the render distance work. a 8 chunk by 8 chunk area is generated around the player?

#

if the render distance is 8

#

or is it a 17 chunk area

#

8 + 1 + 8

hybrid spoke
grim ice
#

each direction

digital plinth
#

1 is the chunk the player is currently in

grim ice
#

16*8 blocks

grim ice
#

but

digital plinth
grim ice
#

eeeee im lazy kinda of

digital plinth
#

so the chunk the palyer is in counts

grim ice
#

and if someone can please help me understand why did that error occur

digital plinth
#

what error

grim ice
#

oh nvm yes

hybrid spoke
#

probably because your server api and dev api arent the same

paper viper
#

Are you using mismatching spigot versions

#

Yeah

grim ice
#

I'm using a spigot 1.16.5 server

hybrid spoke
#

that you are coding with another api than your server provides

digital plinth
#

my google froze 0 mbps...

grim ice
#

what

paper viper
#

For example, you coded in 1.16, but you ran it on 1.14

#

As an example

#

That’s not allowed

grim ice
#

Oh

#

if i made it in 1.16 and ran it on 1.17.1

#

is that fine

paper viper
#

No (for this case)

hybrid spoke
#

it is allowed but you have to look up which methods arent there anymore in the higher version or even in the lower

grim ice
#

but im using it in 1.16.5

paper viper
#

There is likely a big difference in 1.17

grim ice
#

but

#

my server

#

is

#

1.16.5

paper viper
#

Did you run it on 1.17 OR 1.16.5?

#

You said 1.17 before

grim ice
#

my server is 1.16.5, my plugin is 1.16

grim ice
hybrid spoke
#

then this method was removed in one of these 5 subversions

paper viper
#

Yeah

grim ice
#

w h a t

#

but i tested the plugin before

#

it worked

#

now it doesnt idk why

paper viper
#

Did you switch versions

grim ice
#

no

hybrid spoke
#

and then you added this peace of code NamespacedKey.fromString(Ljava/lang/String;Lorg/bukkit/plugin/Plugin; and it stopped working as you can see

grim ice
#

i dont see smth wrong with it though

paper viper
#

??

hybrid spoke
#

your server don't have that method

mortal hare
#

any ide's that doesnt eat ram like chromium but has good autocompletion suggestions?

hybrid spoke
#

since its running an other api-version

grim ice
#

wtf

#

but its running the same

hybrid spoke
#

its like playing minecraft 1.5.2 on 1.17

grim ice
#

my plugin is 1.16.5 actually not 1.16

#

but in my plugin yml i have it on 1.16

mortal hare
#

currently im on Sublime Text 4 with lsp-jdtls eclipse language server

hybrid spoke
#

your plugin yml just have the api-version to let the server know for what version you are coding

paper viper
#

2Hex, you realize MC Version and API must be carefully chosen and coded to match. If you choose a higher MC version for the server you need to take account methods that may have been moved, modified, removed etc. if you are running a lower MC version you have to take account methods that may have not existed.

paper viper
#

I’m not spoon feeding you bro

mortal hare
grim ice
#

jsut a brief idea

#

not a spoon feed

paper viper
mortal hare
#

it get freezes when i use intellij

hybrid spoke
paper viper
#

I heard it uses less memory

#

But I’d recommend IntelliJ

#

Over it

mortal hare
#

mid-low

paper viper
#

That’s not a potato

grim ice
#

"[21:58:40] [Server thread/INFO]: This server is running CraftBukkit version 2991-Spigot-018b9a0-f3f3094 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
["

hybrid spoke
#

i will take that as a yes

#

but it should be able to handle intellij

paper viper
#

^

mortal hare
#

it has like mini stutters

grim ice
#

btw pulse

mortal hare
#

which i hate

grim ice
#

"[21:58:40] [Server thread/INFO]: This server is running CraftBukkit version 2991-Spigot-018b9a0-f3f3094 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
["

digital plinth
#

lul

mortal hare
#

ram usage is my limit

#

i have 8gb only

paper viper
#

I’m out, going to take a break. Spigot discord is really not my mood right now

hybrid spoke
#

you can lower the ram used by intellij

grim ice
#

o

#

GodCipher you have any reply or something

mortal hare
#

where?

hybrid spoke
grim ice
#

my plugin and the server

#

are the same

#

version

hybrid spoke
#

are you using any build tools?

grim ice
#

uh

grim ice
#

didnt get ur question

hybrid spoke
#

maven

#

gradle

grim ice
#

Yes my plugin uses maven

hybrid spoke
#

is your dependency just the spigot-api?

grim ice
#

yes

hybrid spoke
#

try to change it to spigot

grim ice
#

wait a fucking minute

mortal hare
#

intellij idea literally keeps my CPU usage at 80% on dile

grim ice
#

wh yis it on 1.17

hybrid spoke
#

there we have it

grim ice
#

fuckery fuck intelliJ

#

I hope jetbrains lost all their money

mortal hare
grim ice
#

how in the fuckery fuck did that happen

mortal hare
#

for windows 8.1

#

it rocks

hybrid spoke
mortal hare
#

with aeroglass

grim ice
#

HOW DID THAT HAPPEN

#

IDIDNT WRIETE KIRHWUEIFGWEFWUEOFGWFH

hybrid spoke
#

are you drunk?

grim ice
#

so i do i just change version to 1.16.5

grim ice
#

im on drugs

#

jk

hybrid spoke
mortal hare
#

clear 8.1 theme

#

is great

mortal hare
#

especially with aero glass

#

its a windows 8.1 theme

#

which makes windows 8.1 a bit more modern

grim ice
#

how do i get it

mortal hare
#

from deviantart

grim ice
grim ice
mortal hare
#

it looks great in explorer

#

paired with win 11 icons

hybrid spoke
#

probably release

#

1.17.1-R(elease)0.1

mortal hare
#

i get 300 mb ram usage on win 8.1 at idle

#

that's even lower than xfce

grim ice
grim ice
#

i want a windows 10 theme tbh

mortal hare
#

ew is your hentai on pfp

grim ice
#

but idk if there is any

hybrid spoke
grim ice
#

its not hentai

#

tbh my intelliJ is default i might change it

hybrid spoke
mortal hare
#

that's great in a dark room

grim ice
#

wait the fuck

#

Material UI IS PAID

#

FUCKE

#

FUCK

#

FICK

mortal hare
#

but when you have sun directly at the computer

grim ice
#

FUCK

mortal hare
#

it sucks

hybrid spoke
whole stag
#

||rename that folder entitties||

grim ice
#

IM NOT PAYING FOR CUSTOMIZING INTELLIJ BRUH

hybrid spoke
#

always sitting in a dark room

hybrid spoke
whole stag
mortal hare
#

vscodium ftw

whole stag
#

Nah, I've had too many plugin issues with codium

mortal hare
#

then use ST4

#

it has language servers anyway

grim ice
#

how do i edit material ui plugins

whole stag
#

Or I could just use vscode

mortal hare
#

i can run eclipse autocompletion on st4

hybrid spoke
#

what do you think about this theme?

mortal hare
#

i hate bloo

#

i prefer yellowish or dark gray tone

#

but your choice

hybrid spoke
#

before everything were purple

mortal hare
whole stag
#

Green

mortal hare
#

intellij works for me except when i want to run test client and server for my plugins

#

it halts my system completely

grim ice
#

what is a good font

#

for intelliJ

#

Material UI Lite theme

whole stag
#

Does intellij have docker capabilities?

mortal hare
#

what about netbeans tho

#

if i had more ram to spare...

#

but fucking ram is so expensive these days

#

and you cant mix them

eternal night
#

intellij has docker support (mostly for dockerfiles and running these tho)

hybrid spoke
#

just use notepad++

whole stag
#

You kinda can

mortal hare
#

mixing them is like playing russian roulette

grim ice
#

anyone

#

pls

hybrid spoke
#

what

eternal night
#

use the intellij font ?

grim ice
#

a good font for material ui lite

mortal hare
#

i don't want to spend money on thing which has 50/50 chance to work

grim ice
eternal night
#

jetbrains mono is pretty neat

whole stag
#

Most cases it works, you just need to use the lowest common denominator for timings

hybrid spoke
mortal hare
#

have anyone tried netbeans before?

hybrid spoke
#

is what i am using

mortal hare
#

is it good?

whole stag
#

I'd say 90% chance of working, almost 100% if you do some research about the kits

grim ice
#

o

#

thx

whole stag
grim ice
#

the text font

#

is kinda small

mortal hare
#

define

grim ice
#

the

#

code

#

text

eternal night
#

how is the font size an issue of the font tho 😅

#

just increase your font size, doesn't mean the font is trash

grim ice
#

U cant change it

#

uh

eternal night
#

oh LOL

#

yea you can

grim ice
#

when i change it, it changes the menu siz

#

size

#

not the code size

#

lol

eternal night
#

you need to go to the editor config setting

hybrid spoke
#

i can just hold ctrl and scroll to change it

eternal night
#

Editor > Font

vast sapphire
#

ok now nothing is being written to the config java p.getTargetBlock((Set<Material>) null, 3).setType(Material.IRON_ORE); blockLocation = p.getTargetBlock((Set<Material>) null, 3).getLocation(); if (Generators.getInstance().locations != null) Generators.getInstance().locations.add(blockLocation); p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Generator Placed at " + blockLocation.getBlockX() + ", " + blockLocation.getBlockY() + ", " + blockLocation.getBlockZ())); Generators.getInstance().getConfig().addDefault("locations", Generators.instance.locations); Generators.getInstance().saveConfig();

unkempt ore
whole stag
#

I personally love docker for test servers

digital plinth
#

does chunk.load forceload a chunk

unkempt ore
#

Yeah it's not bad

digital plinth
#

or does it simply load a chunk and will be unloaded later

#

nvm

#

.setForceload...

feral sand
#

I'm working on adding custom recipes for custom items I made. They are based off of Iron Nuggets and use the 3x3 recipes to form a different item. For example; 9 copper -> 1 iron, 9 iron -> 1 gold, etc.

The current problem I'm having is the Recipe Book. I have it registering the recipes, but it doesn't seem to recognize the items in the inventory (but the crafting works). https://i.imgur.com/lG0CRq1.png

Any ideas how to fix?

eternal night
#

you don't

#

I think we had this issue with nathan a few days ago

#

the client basically does not send the exact item to pick but only the material

eternal night
#

the server tho interprets its as an exact item match

#

which means items with NBT will not be selected to fill the recipe

feral sand
eternal night
#

are the ingredients custom ?

feral sand
#

Yes.

eternal night
#

yea, then that is where you are failing

#

due to what I elaborated on earlier

grim ice
vast sapphire
#

maybe this will help from my custom crafting project ```java
public void checkCraft(ItemStack result, CraftingInventory inv, HashMap<Integer, ItemStack> ingredients){
ItemStack[] matrix = inv.getMatrix();
for(int i = 0; i < 9; i++){
if(ingredients.containsKey(i)){
if(matrix[i] == null || !matrix[i].equals(ingredients.get(i))){
return;
}
} else {
if(matrix[i] != null){
return;
}
}
}
inv.setResult(result);

}
feral sand
#

Does that do something for the Recipe Book or just the crafting?

eternal night
#

the recipe book

vast sapphire
#

then I made the recipe using ```java
checkCraft(new ItemStack(ItemManager.invertedApple()),e.getInventory(), new HashMap<Integer, ItemStack>(){{
put(0, ItemManager.compressAmethyst());
put(1, ItemManager.compressAmethyst());
put(2, ItemManager.compressAmethyst());
put(3, ItemManager.compressAmethyst());
put(4, new ItemStack(Material.GOLDEN_APPLE));
put(5, ItemManager.compressAmethyst());
put(6, ItemManager.compressAmethyst());
put(7, ItemManager.compressAmethyst());
put(8, ItemManager.compressAmethyst());

    }});```
#

should work

eternal night
#

why tho xD

vast sapphire
eternal night
#

they could just use custom recipes

vast sapphire
#

you can't use custom itemstacks in a recipe

eternal night
#

you can

#

unless you are stuck in 1.8 land

#

you can

vast sapphire
#

shapeless recipes only accept materials?

dusk flicker
#

they accept ExactRecipes

grim ice
#

make a shapedrecipe with every possibility of an item

#

e z

#

?paste

undone axleBOT
mortal hare
#

guys what's your favorite SQL client? Mine's dbeaver, yours?

#

or phpmyadmin

eternal night
#

why does one need an SQL client xD

grim ice
paper viper
#

Inefficient

#

Too much memory

mortal hare
#

i mean

#

yea

#

you could do queries

eternal night
#

oh like debug

paper viper
#

Basically the same as 9 choose (number of slots recipe takes)

#

Super inefficient

eternal night
#

I just use intellijs integrated one

mortal hare
#

or just download dbeaver on your pc and connect to sql server

grim ice
#

?paste

undone axleBOT
eternal night
#

pretty sweet for fast debug

mortal hare
#

for easy management

eternal night
#

else, I just CLI tbh

grim ice
feral sand
eternal night
#

not really a bug as far as nathan was able to find

#

seems rather intentional

#

one possible workaround is the paper event

feral sand
#

paper event?

eternal night
#

PlayerRecipeBookClickEvent

mortal hare
#

doesnt nms have a method to check recipes?

eternal night
#

on paper

mortal hare
#

recipe book is useless

eternal night
#

which you could basically listen to

grim ice
#

bruh

mortal hare
#

they've should've made something like NEI

#

instead

eternal night
#

and then execute your own logic instead

#

tho naturally that moves you into paper-only API

feral sand
#

Oddly enough NEI/JEI registers the recipes

eternal night
#

so does the recipe book right ?

grim ice
#

someone pls help

eternal night
#

like, everything should be fine

#

just cannot auto place

mortal hare
#

but recipe book works differently from NEI, in order to craft something you need to get the items first while in nei you can see recipe like its in wiki

#

that's more useful

#

especially for people who don't know no recipes

#

i even use a mod to remove that recipe book from my client

#

and oddly enough you can get recipe book in your hands since its namespaced item by using minecraft:recipe_book

regal moat
regal moat
#

and the player join and quit thing works fine

grim ice
#

@paper viper uhh i have a question

#

why when i have a config from my old version of my plugin

#

and my new version changes the config

#

the config does not change

#

it stays as the old version config

paper viper
#

Why do you have to ping

eternal night
#

saving the default config only writes it if no file exists with that name yet

paper viper
#

😤

grim ice
#

im sorry

grim ice
#

i have this in my main

#

saveDefaultConfig();

#

is that perhaps causing the issue

eternal night
#

well not really an "issue"

#

this works as intended

grim ice
#

It is

#

well my whole plugins gets fucked if the config is not as it is

eternal night
#

there isn't a spigot build in method to just overwrite a config if it changed

#

because that makes no sense

grim ice
#

then what do i do

opal juniper
eternal night
#

you come up with a creative solution

#

such as versioning your config

grim ice
grim ice
#

but hwo do i overwrite

#

sorry for being a dumb fuck

opal juniper
#

Save the file with the same name

eternal night
#

you can save a yaml configuration to file

#

yea

#

what jeff said

grim ice
#

o

regal moat
grim ice
#

help pls

#

this thing must have a problem

#

return NamespacedKey.fromString(name().toLowerCase(), RecipesManager.plugin);

#

pls help

#

.

native nexus
#

You are creating a new instance of a namedspacekey but never storing it anywhere

grim ice
#

How?

native nexus
#

Well you are never assigning it to anything

#

So you need to either store it in a map or array

grim ice
#

uh

#

do u know what're u doing? like can i trust u

#

cuz idk this feels kinda weird

opal juniper
#

What

patent quarry
opal juniper
#

He is right afaik

grim ice
#

Can you give me a brief idea of how can I do that

#

like an example or something. if possible

opal juniper
#

Umm

native nexus
#

Yeah so have a recipe manager in another class

#

And have just the enum class for the purpose that it serves (being an enum not a manager)

opal juniper
#

They normally know

native nexus
#

Then within the recipe manager you can store those namedspacedkeys

grim ice
#

uh

#

i still kinda dont know how to do this in action tbh

#

hmm

native nexus
#

Wait a second

#

No you just have the functionality in the wrong place

#

Sec let me show you

grim ice
#

e

hidden torrent
#

Once an entity is already attacking a player, how can I stop the entity from attacking?

native nexus
native nexus
hybrid spoke
hidden torrent
# native nexus Could you explain step by step what is supposed to happen because it is a bit va...

I am currently programming a plugin that allows players to tame entities. I want hostile entities to be able to be tamed without a problem, so I want tamed hostile entities to no longer target players and attack them. As of right now, using the EntityTargetLivingEntityEvent, I am able to cancel initial targeting of players. When a player logs in, their hostile pets will not attack them. However, when hostile entities are initially tamed, they are already targeting the player, so they continue to attack the player. It seems that EntityTargetLivingEntityEvent only handles initial targeting. I've tried to set the target to null for the targeting entity, but the hostile entity continues to attack once tamed.

#

In a sentence, once the entity is tamed while it is already attacking the player, it should stop attacking the player.

hidden torrent
granite burrow
#

how can I make it so that the right click event only runs one time when the player clicks or holds click?

hidden torrent
#

I suspect that once the player is already targeted, then the EntityTargetLivingEntity event doesn't fire. I'm not sure if that's correct, though.

hidden torrent
#

The API version being used is 1.13, but I am currently testing on a 1.17 server.

granite burrow
hybrid spoke
#

also holding rightclick is in minecraft not frequently. its everytime a new click for minecraft.

granite burrow
#

dam so if a player holds the button it just runs the code over and over?

native nexus
#

if(e.getHand() != EquipmentSlot.HAND) return;

hidden torrent
hybrid spoke
#

you could check the latest and current click and compare their ms. if its 199~200 for a few times the player is probably holding rightclick

granite burrow
granite burrow
native nexus
#

Could you show me the event @granite burrow in ?paste

#

You may need to check against which action you want to run.

granite burrow
#

wait would it be because of this?
if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) { because when I click the air it only runs once

hybrid spoke
#

no

#

show us your eventhandler

#

?paste

undone axleBOT
granite burrow
native nexus
#

@hidden torrent What debug values are you getting?

grim ice
#

the amount of people that ask this question is so insane lmao

#

anyway

#

the code runs for each hand

#

check if the hand is the off/main hand

hybrid spoke
#

follow the chat

native nexus
#

Are you trying to break out of the loop because this return statement does nothing.

hybrid spoke
#

before judging people

grim ice
#

didnt judge him tho

#

im not even good myself who am i to judge people :D

#

ye

granite burrow
grim ice
#

check if its right or left instead

#

prob better if u didnt already

granite burrow
native nexus
#

Then you want to use break; not return

hybrid spoke
#

nvm. its not. docs says it can be null my bad

granite burrow
#

yeah I was getting an error for it

#

so that stopped the error

hybrid spoke
#

did you debug until when its fired 2 times? @granite burrow

#

or since when

granite burrow
#

no Ill do that right now

grim ice
#

i just went thru the chat

#

@granite burrow also ru cheacking if the hand is main hand

#

checking*

#

if not do that

hybrid spoke
#

yeah he do

grim ice
#

oh okay good

hybrid spoke
#

because of that i am saying follow the chat

#

because we already said that

grim ice
#

:0

#

poggers

granite burrow
#

the whole event runs twice

hidden torrent
native nexus
#

Could you also debug to see if the target is null in the first instance?

#

Before you set the target to null?

#

Well not check if it is null, but check what the target is?

granite burrow
#

could it be because when I right click I make the player look at a new block? @native nexus

#

because when I look at the ground it works good but a block above it sends double message

#

yeah okay after some testing that seems to be whats happening, is there anyways to prevent this?

native nexus
#

What is inside the lookingAtBlock function?

granite burrow
#
    private boolean lookingAtBlock(Player p) {
        Material targetBlock = p.getTargetBlock(null, 100).getType();

        for (int i = 0; i < openableArray.length; i++) {
            if (targetBlock.equals(openableArray[i])) {
                return false;
            }
        }
        return true;
    }
#

basically check to see if your already looking at the block

last citrus
#

Does anyone know how I would teleport a entity to a player?

#

Or spawn one on the player

native nexus
#

entity.teleport(player); ;-;

last citrus
#

Thanks

granite burrow
native nexus
#

Hmm

granite burrow
#

is there a way to see if the player just teleported using the interact event?

eternal night
#

What interact event causes a teleport 😅

final monolith
#

Hey guys, im having an problem with NMS getDirection().a(), at a certain distance of blocks away, they dont work

digital plinth
#

oh no nms

digital plinth
final monolith
#
((CraftGuardian) guardian).getHandle().getNavigation().a(path, 2)
daring lark
#

how can i set dig speed on custom item? meta.addEnchant(Enchantment.DIG_SPEED , 10 , false); don't work

inner rock
quaint mantle
#

the boolean is for ignoreMaxEncahnt

torn oyster
#

how would i make an armourstand that's name is different for everyone

#

sorta like that

#

how it says "Your stat is = this"

quaint mantle
#

packet

eternal oxide
#

You would have to spawn them using packets

unkempt ore
#

Hey Elgar

unreal quartz
#

completely ignored

#

too popular for you

unkempt ore
#

It was 5 minutes later, I can understand some delay

unreal quartz
#

na

unkempt ore
#

North America?

unreal quartz
#

sure

unkempt ore
#

eu

eternal oxide
#

HI, in the am here and I'm lost down the youtube rabbit hole.

unkempt ore
#

Relatable

#

Just watch some JCS - Criminal Psychology

echo basalt
#

I believe the max distance is like 32

#

either that or 8 not sure

echo basalt
# torn oyster

Creating via packets or modifying the packets before they get sent, both work

digital plinth
#

invisible pfp nice

echo basalt
#

had it for years

digital plinth
#

i did the same thing in google meet

unkempt ore
#

I don't really know first-hand, but just from thinking about it

#

Packets give a ridiculous amount of control, huh

echo basalt
#

I did an entire hologram menu with packets

digital plinth
#

it can do stuff spigotApi cant

unkempt ore
#

How could interception of client -> server packets be useful

echo basalt
#

Um

digital plinth
#

block hax

echo basalt
#

ProtocolLib likes that

#

I used that interception to make client-side blocks

#

You can do some really hacky stuff

unkempt ore
#

Ghost blocks?

echo basalt
#

This menu is purely client-side

echo basalt
#

and you can break them and such

digital plinth
#

its gonna mess the hell out of anti cheats

echo basalt
#

if I'm doing this fancy stuff might aswell make my own anticheat

unkempt ore
#

So what's up with that. If you begin damaging a block that doesn't actually exist to the server, what do you do

#

The server doesn't get mad?

echo basalt
#

Like

#

The client renders it breaking

digital plinth
#

if the server dont sent break packet

unkempt ore
#

Yeah

digital plinth
#

it stays there?

echo basalt
#

Let me explain how this works

digital plinth
echo basalt
#

because I did this exact thing

digital plinth
#

imillusion protocallib expert 👏

unkempt ore
#

Tag me

echo basalt
#

1 - Server sends Block Change (Or multiblockchange or chunk or whatever) packet so that the client renders the block

2 - The player tries to break the block, client renders the block breaking, sends "Block Dig" packet to server and renders the block breaking manually

3 - The client sends a Block Dig packet with the "Finish Dig" state (if the block isn't insta-broken)

#

Every time the player clicks, the server tries to send a Block Change packet with the block type

#

I have to cancel that for the effect to work

#

Now, right clicking is a lot worse

#

There' the Player Block Placement packet

#

But I was an idiot and decided to listen to the Use Item packet

#

Which fires only containing the hand used to click

#

So with a bit of raycasting and vector math I finally obtain the clicked block face and do my checks

unkempt ore
#

Uhuh

#

Cool

echo basalt
#

Then I got my ego up and added worldedit schematic support

vast sapphire
#
                        if (location.getLocations().contains(blockLocation)) {
                                if (p.getLocation().distance(blockLocation) < 2.2)
                                    p.getInventory().addItem(new ItemStack(Material.IRON_INGOT));

                                }``` I need to get the distance of the block location but blockLocation is one variable and I need to access my arraylist of locations and get the distance
echo basalt
#

With some minor optimizations to send 1 packet per chunk section

proud basin
#

how do you set multiple names to a entity?

unkempt ore
#

I didn't really get that part about the "finish dig" state

echo basalt
unkempt ore
#

Is this sent when the block is actually broken from a manual dig?

echo basalt
#

There's an enum with the dig states

unkempt ore
#

So a packet is sent on the start of digging, and on its finish

echo basalt
#

There are like 7 states

unkempt ore
#

Christ

echo basalt
#

But I only listen to Start dig and stop dig

quaint mantle
#

how to kick a player from the proxy

unkempt ore
#

Like, one for each state of breaking texture? Or what are they for

echo basalt
unkempt ore
#

Lemme see

quaint mantle
#

answe dont got all day

unkempt ore
#

Ohhhh

echo basalt
#

The breaking texture is rendered client-side for the player breaking

unkempt ore
#

Cool, that's cool

#

Uhuh

echo basalt
#

And there's a Block Break Animation packet sent to all other players for every state

#

There are either 7 or 9 states I don't remember quite

#

might be 7 too

unkempt ore
#

What's up with that about the location always being 0 0 0 and the face always being -Y?

quaint mantle
#

yk what would have been better

echo basalt
#

Or use the plugin message api

echo basalt
#

It should be like a block cancel and a player can only be breaking 1 block at a time anyways

unkempt ore
#

Aren't there hacks like nuker

#

Or is nuker iterative

echo basalt
#

iterative