#help-development

1 messages · Page 1939 of 1

wet breach
lethal coral
terse ore
#

ty guys it worked

sterile token
#

In confuse you can use this for developing plugins? Or you need jdk?

#

I ask because im helping a friend to setup intellij idea

wide coyote
#

jdk is java development kit

sterile token
#

Oh im an idiot

wide coyote
#

and he already has that

sterile token
#

I was the name that confused me

#

Becuase i name as JDK-version

sterile token
wide coyote
#

np

quaint mantle
#

no

sullen marlin
#

define multithreading

young knoll
#

It uses multiple threads

sullen marlin
#

then yes

#

always has

young knoll
#

Chat is a thread, there’s the main thread, and several worldgen worker threads

#

Probably more

short raptor
#

How come people shit on it for being single threaded? Or is that not true anymore

young knoll
#

Probably because a lot of stuff is still on that main thread

worldly ingot
#

or people they're misinformed and believe everything they read on the internet as fact ;p

young knoll
#

Are you saying it’s not all fact

terse ore
#

How can I push a player backwards

eternal night
#

backwards relative to what

terse ore
#

to player

eternal night
#

Well, basically grab the vector from player B to A and scale it

#

if you want A to be knocked away from B

ionic dagger
#

could someone help me out here? im trying to manually set world spawn with a /spawnset command, but the coordinates dont save whenever i try to /goToSpawn

#
            plugin.getConfig().set("spawn.world", location.getWorld().getName());
            plugin.getConfig().set("spawn.x", location.getX());
            plugin.getConfig().set("spawn.y", location.getY());
            plugin.getConfig().set("spawn.z", location.getZ());
            plugin.getConfig().set("spawn.pitch", location.getPitch());
            plugin.getConfig().set("spawn.yaw", location.getYaw());
#

this is my config.yml vv

  ==: org.bukkit.Location
  world:
  x:
  y:
  z:
  pitch:
  yaw:
young knoll
#

You can just save the location directly

sullen marlin
#

set("spawn", location);

young knoll
#

Also did you call saveConfig

ionic dagger
#

yes coll

#

and i did that md

sullen marlin
ionic dagger
#

but im tryna figure it out the other way

#

i wanna set them all manually

#

would that be a lot more work than i think it is

#

lmao

young knoll
#

Not really

#

But why

crimson verge
#

why would you set them manually lmfao

ionic dagger
#

cause im tryna make a home command aswell

crimson verge
#

... not understanding why that would change things lol

ionic dagger
#

wait does it not

#

uh

#

2 minutes team

fallow storm
#

Is there a way to refresh the command tab list that the client sees? When I change a player's permissions it doesn't update that list until the player relogs or the /reload command is used (which obviously I won't use, but it proves that the list can be updated without relogging). Specifically this list
https://i.imgur.com/L3ymJuz.png

#

I've tried permissible.recalculatePermissions() but that doesn't update it

fallow storm
#

Thanks

tranquil viper
#

how should I go about speeding up spawn rates of a single spawner

#

I don’t want to change the spawn delay because it limits the amount of spawners that can be stacked at once

terse ore
#

How can I make a block object an itemstack?

tranquil viper
#

the count of what

#

mobs that spawn?

ionic dagger
#

so

#

i thought setting them manually would let me define them in the config.yml

#

im new to all this so idk much about it lmao

#

could you help me figure out how to save the location to the config?

#

or anyone really

young knoll
ionic dagger
#
String homeName = args[0];
plugin.getConfig().set(homeName, location);

player.sendMessage(ChatColor.GREEN + "Home: " + ChatColor.YELLOW + homeName + ChatColor.GREEN + " has been set.");```
tranquil viper
# young knoll Yes

How would I do that? Listen to the spawn event and then spawn x amount of entities?

young knoll
#

It’s a property of the spawner

#

But you can do that too

tranquil viper
#

How would I edit the property

young knoll
#

Does the javadocs have jt

tranquil viper
#

ion maybe

#

I'll check ig

#

thought I saw a thread though and it said you couldn't actually edit the property

ionic dagger
#

could i save a new location into the config by doing set("location", location);

young knoll
#

Yes

tranquil viper
#

oh cool

#

ty

ionic dagger
young knoll
#

Did ya save it

ionic dagger
#

😄

#

im gonna kms

#

thanks

sterile token
#

Its possible to iterate over a Stream, replace some text and them return the replaced text string (in-line function)?

young knoll
#

Is it a stream of strings

sterile token
#

The stream is from a map

paper viper
#

or smthing

#

and then map

#

wait

#

no

young knoll
#

Can’t you just do stream.map.collect

paper viper
#

im braindead rn

#

i have to go to sleep

#

but yeah thats what i thought, could you turn it into a data struct

#

and iterate over that

#

and then modify and replace as needed

sterile token
#

Would work with this Map<String, String>

#

and then a String replace(String text) { return}

#

Cuz its telling me that its a void

sterile token
young knoll
#

Probably not

#

Because the entryset stream won’t be a string

#

It’ll be Map.Entry<String, String>

sterile token
#

But i want to do it in-line

young knoll
#

On the key or the value

#

Or both

sterile token
worldly ingot
#

You're probably not going to get that in-line

sterile token
#

Take at look a this

#
public String toString(String input) {
        return this.placeholders.entrySet().stream().reduce(input, (text, entry) -> input.replace(entry.getKey(), entry.getValue()), (s1, s2) -> input);
}```
#

What do you think?

worldly ingot
#

Some things really just don't need to be streams lol

sterile token
#

If it really easy as everyone said why no one give an in line example?

#

Hum

worldly ingot
#

Why are you so hell-bent on making it single-lined?

#

Less lines != better

sterile token
#

But would work or not?

worldly ingot
#

Probably not because strings are immutable so I doubt that would work at all

#

but I've never used reduce so I don't know if that is a BiFunction or a BiConsumer

drowsy helm
#

just use a for loop man

worldly ingot
#

^

#

Skip the streams entirely

drowsy helm
#

streams are pretty inefficient aswell

sterile token
lavish hemlock
#

Yeah the idea behind streams is to make your life as a dev easier

#

If you spend more time worrying about how to use them

#

instead of using them

#

then you defeat the purpose of using them

sterile token
young knoll
#

I believe it was Sun Tzu who said “lmao streams are wack”

sterile token
#

Omg if you see my history, you will get tired of seeing stackoverflow links

#

I went through all stackoverflow and did not find a garbage

worldly ingot
#

I don't recall Sun Tzu saying that. Very wise of him. Very ahead of his time

lavish hemlock
sterile token
#

I cannot develop without using lamda

kind hatch
#

How do you think people did it before streams existed? .-.

#

I need that meme format. When were java streams added? (March 2014), People before March 2014, Idk wtf I'm doing.

drowsy helm
#

image circa March 2014

young knoll
#

I think I started java back then

#

It was literally unusable

#

I couldn’t even make a hello world program

waxen plinth
#

This is about the slowest way you could possibly implement something like that

sterile token
#

So what i can do?

waxen plinth
#

How performance critical is it?

sterile token
#

I dont understand your questions

waxen plinth
#

How important is it that this code is fast

#

How often will it be run

sterile token
#

Its for a plugin

waxen plinth
#

...

#

That doesn't answer anything I asked

sterile token
#

Im trying to make a String replacer based on map key-value, for text message

waxen plinth
#

I understand that

young knoll
#

So like papi

waxen plinth
#

You still did not answer either of my questions

sterile token
waxen plinth
#

OP?

#

I am just asking how often the code will be run

#

I feel like that's not a hard question to answer

sterile token
#

I dont know

#

Cuz it for a library i will publish free on gth

waxen plinth
#

Then assume it is very performance critical

#

Do the placeholders have a pattern, like are they surrounded in %% or {} or something?

#

Or are they just plain strings in any format?

waxen plinth
#

Then you should use a regex for matching

sterile token
#

I have literally this:

public Map<String, String> placeholders = new HashMap<>();

public String toString(String text) {
// I cannot figure how to return the replaced all in-line
}

waxen plinth
#

Yeah the simplest way to make it fast is to use a regex to match the placeholders

#

That way you're not just blindly calling replace for every possible placeholder

#

Imagine if there are hundreds, or thousands, of placeholders registered

#

It would be iterating over thousands of placeholders and trying to string replace every one of them, that could be extremely slow

#

So you can find the placeholders in the string, then get them in the map and only replace the ones that are actually in the string

#

You can take it a step further using a StringBuilder if you want to

sterile token
waxen plinth
#

You want the simplest way to do it?

#

Fine

young knoll
#

So that’s how papi does it

#

Why didn’t I think of that

waxen plinth
#
for (Entry<String, String> placeholder : placeholders.entrySet()) {
  text = text.replace(placeholder.getKey(), placeholder.getValue());
}
return text;```
ebon arrow
#

Is there a way, either with maven or with java, to automatically increase the version number every time you export the project?

waxen plinth
#

This is the most obvious way to implement it but it is going to be very slow

young knoll
#

I’m somewhat curious

lavish hemlock
#

I'd personally implement the placeholder parsing myself.

buoyant viper
lavish hemlock
#

It's not too hard.

waxen plinth
#

I would as well

#

The optimal way to do it is with a prefix tree

sterile token
#

I do this: String stoString(String text) { return this.placeholders.forEach((key, value) -> text.replace(key, value)); } But its a void so i cannot return it

sterile token
young knoll
waxen plinth
sterile token
ebon arrow
#

@young knoll can i pm you quick?

waxen plinth
#

Very sus

#

"TheGamingJew" wants to pm you

young knoll
#

Sure why not

ebon arrow
#

I mean, I could ask to pm you too if you want, but I dont know you that well...

young knoll
#

I always wondered how papi maintained performance with 1k placeholders

waxen plinth
#

I don't know if papi uses a prefix tree

#

But I'm pretty sure it is the optimal solution for a multi replace

young knoll
#

My brain didn’t even think of the regex method

sterile token
#

I would take a look

waxen plinth
#

I literally gave you a solution

sterile token
waxen plinth
#

A bad one, but still better than what you're trying to do

waxen plinth
sterile token
#

Oh lol?

waxen plinth
#

Because this is not a good use case for lambdas and streams

young knoll
#

Everything must be a lambda

waxen plinth
#

The solution I gave you is already really slow

#

And your way of implementing it will be even slower

lavish hemlock
#

Lambdas can also increase code complexity and class file size! :)

#

They are a great tool in moderation, however.

young knoll
#

Arrays.asList(“Hello World”).forEach(System.out::println)

waxen plinth
#

I personally really love lambdas but there are cases where you don't use them

waxen plinth
hasty prawn
#

Lambdas are great PeepoHappy

lavish hemlock
#

Lambda everything

young knoll
#

Exactly

sterile token
lavish hemlock
#

Actually I think we just discovered Lisp

young knoll
#

EssentialsXLambda fork coming soon

hasty prawn
lavish hemlock
#

No we like lambdas you're just using them poorly

young knoll
#

I like lambs

hasty prawn
#

thats nice coll

sterile token
waxen plinth
#

With the level of competence you've shown I'll steer clear of it

young knoll
#

Imma switch to it

#

Heck redlib, it doesn’t have enough streams

sterile token
waxen plinth
young knoll
#

That too

lavish hemlock
hasty prawn
#

RedLib? DansChamp
VeranoLib? NODDERS

lavish hemlock
#

MaowLib is actually good though

young knoll
#

Fuckin redlib isn’t even red

waxen plinth
#

What's it got

lavish hemlock
#

See, I code stuff that's on par with the stdlib

lavish hemlock
waxen plinth
#

lol

sterile token
waxen plinth
#

huh

young knoll
#

An item builder!

#

Very original idea

waxen plinth
#

yes that's my github

sterile token
#

Allright i will check your stream implementation

waxen plinth
#

What stream implementation

lavish hemlock
sterile token
#

I dont wanna be 30 years and dont have no more brains cuz of java

young knoll
#

We reimplementing streams now?

lavish hemlock
#

I can do that 🖐️

waxen plinth
#

I'm too lazy

hasty prawn
lavish hemlock
#

shush

waxen plinth
#

Rust fan behold

young knoll
#

Don’t let your fan get rusty

hasty prawn
#

Hey Redempt

minor otter
#

Probably a no brainer but I want to ask anyway, is a world populater the best way to generate ores

waxen plinth
#

hi

hasty prawn
#

Has anyone ever told you that you're a nerd hmm

#

Very smart, still a nerd hmm

waxen plinth
#

if I had a nickel for every time I had been called a nerd I would probably have well over $10

young knoll
#

Nerd

hasty prawn
#

I'm glad I just made you $0.05

waxen plinth
#

umm actually it was hypothetical

#

you calling me a nerd does not net me any additional income

young knoll
#

Not anymore

#

Check under your pillow in the morning

waxen plinth
#

😱

#

the nerd fairy??

young knoll
#

Exactly

lavish hemlock
#

I am inside your home.

hasty prawn
#

You'll have exactly 1 dime in the morning

kind hatch
waxen plinth
#

(we are gay)

lavish hemlock
#

I am raiding your pantry for caffeine and Doritos.

waxen plinth
#

you will find it barren

lavish hemlock
#

Terrible.

#

I am displeased by your lack of offering.

waxen plinth
#

I have other offerings

#

Have you any interest in a lecture about parsers?

young knoll
waxen plinth
#

😳

young knoll
#

(Not clickbait)

lavish hemlock
tall nova
#

kkk

lavish hemlock
young knoll
#

Exactly

#

It’s redempt

lavish hemlock
#

No

#

My Redempt-ion arc hasn't come yet.

young knoll
#

🥁

lavish hemlock
#

I-

#

I was just about to do that

young knoll
#

You may be inside my house

sterile token
#

So there is no lambda expression for executing a void and returning a string?

young knoll
#

But I’m inside your brain

lavish hemlock
#

Oh dear

#

The table turns have turned

kind hatch
sterile token
#

Allright thanks

#

I will keep it

ebon arrow
#

@waxen plinth Now its your turn haha, do you use maven?

waxen plinth
#

gradle

ebon arrow
#

oof

#

ugg

#

lol

twilit nexus
#

Would anyone be able to tell me what I am doing wrong here?

#
if (p.getUniqueId().toString() == "8d129761-4315-4c33-904d-19df65eb1d43") {
            event.joinMessage(Component.text("Test"));
        }
waxen plinth
#

== on a string

#

Gotta do .equals

twilit nexus
#

Ohhhhhh

#

That makes sense now XD

kind hatch
twilit nexus
#

I gotchu

#

I'm still new to messing around with UUIDs

eternal night
#

that will also not work

#

== compares instances

#

which clearly, these two are two different instances

twilit nexus
#

I found that this works which is what redempt suggested

if (Objects.equals(p.getUniqueId().toString(), "8d129761-4315-4c33-904d-19df65eb1d43")) {
            event.joinMessage(Component.text("Test"));
        }
wet breach
eternal night
#

Yes

#

instance comparison

#

identity comparison

kind hatch
eternal night
#

okay ?

#

that is the entire point

#

comparing objects using == will not compare their contents

#

and then return true

#

it returns if the identify of the two objects are the same, e.g. they are the same instance (in the case of objects)

#

the reason you can use == on primitives is because they don't have the concept of identity beyond value

wet breach
#

UUID.compareTo() wold probably work

eternal night
#

just .equals

#

compareTo computes ascending/descending order

kind hatch
neon minnow
#

Hi guys I’m just wondering is the Minecraft old hurt sound still exist in the client / server or not anymore ? (The old before mc 1.2) when you fall and things like that — can the server send that packet sound or does it need a resource pack: thank you.

ancient jackal
#

adding enchantment to an item with addUnsafeEnchantment(ench, n) does not work using this little bit of code I whipped up in 20 minutes java for(Enchantment enchantment : Enchantment.values()) { item.addUnsafeEnchantment(enchantment, 255); event.getEnchanter().sendMessage(enchantment + " " + itemMeta.getEnchantLevel(enchantment) + " added to " + item.getType().name()); }

#

it does say the enchantment is added but with level 0

#

I did add the enchant to the itemMeta before but it would only add a max level of 255, this doesn't even add that

#

I tried to add the level 32767 of every ench

#

nevermind I was setting the item meta still like an idiot after the for loop

#

still adds enchantment level 255 though, nothing more

sharp flare
#

what

ancient jackal
#
        for(Enchantment enchantment : Enchantment.values()) {
            int level = 32767;
            item.addUnsafeEnchantment(enchantment, level);
            event.getEnchanter().sendMessage(enchantment + " " + item.getItemMeta().getEnchantLevel(enchantment) + " added to " + item.getType().name());
        }```
This says the item has an enchantment level of 32767 but hovering over the item says 255
sharp flare
#

its because minecraft changed it

#

its now limited to 255 by default

ancient jackal
#

well minecraft is dumb for that then

#

what is it, a short short?

sharp flare
#

you check the amount of level inside the item by dumping it ig

sullen dome
#

Wasn’t the enchantment cap at 10?

sharp flare
#

for unsafe enchantment its not

sullen dome
#

Ah I see

sharp flare
#

but if you're talking about vanilla enchants, the max supported is 10 ig

#

in terms of mechanics

sullen dome
#

Yea didn’t know spigot has an own cap

sullen marlin
#

it doesnt

#

the value is a byte

#

which means max of 255

sharp flare
#

idk why they (mc) changed it to byte

#

but it make sense ig when anarchy servers try to use unsafe enchantments in their lores

drifting vault
#

i somewhat managed to do what i wanted using NBTAPI. i still need to learn how to modify NBTContainers so that the entity doesnt respawn at the spot he was snatched

#

same goes for the unique id being the same, using the get command with a restored mob outputs no entity found message

midnight shore
short raptor
#

Does anyone know if it's the same with the normal online Player ? (when using Player.setStatistic())

tardy delta
#

No

ancient jackal
#

if enchantments are saved as bytes why does adding an unsafe enchantment with any level above 255 still have that level you added in the meta? does the enchantment still behave as powerful as a level 32767?

sharp flare
sullen marlin
#

I never understand the obsession with stupid enchantments

#

sharpness 500 countered with protection 500 may as well be sharpness 1 countered with protection 1

#

but big numbers shiny I guess

sullen marlin
# ancient jackal if enchantments are saved as bytes why does adding an unsafe enchantment with an...

Impossible in 1.18 at least. MC wiki disagrees with you too https://minecraft.fandom.com/wiki/Enchanting

Minecraft Wiki

The glint animation applied to an enchanted iron pickaxe.
Enchanting is a mechanic that augments armor, tools, weapons, and books with one or more of a variety of "enchantments" that improve an item's existing abilities or imbue them with additional abilities and uses. A special "glint" animation appears on items that are enchanted.

#

'When enchanted with the /give command, the maximum enchantment level is 255‌[Java Edition only].'

drifting vault
# blazing scarab What do you want to do?

Store entity data in a file and load it in another world, basically a way to transfer your pets between worlds without the hassle of admin commands such as world edit

ancient jackal
sullen marlin
#

from the wiki

#

' lvl: The level of the enchantment, where 1 is level 1. Values are clamped between 0 and 255 when reading.'

#
        return MathHelper.clamp(nbttagcompound.getInt("lvl"), (int) 0, (int) 255);
    }```
#

client will have the same code, it can't be overriden

ancient jackal
#

I see, wonder why that change was made

sullen marlin
#

because stupid enchants are stupid

#

sharpness 500 countered with protection 500 may as well be sharpness 1 countered with protection 1

ancient jackal
#

stupid enchants are stupidly fun as well

sullen marlin
#

and there's no meaningful difference between say sharpness 500 and sharpness 5000

#

both are instant kill

ancient jackal
#

you know what they say, the bigger the better

sullen marlin
#

looks like limit was added in 1.15

ancient jackal
#

huh, so even when it said 32k in the tool tip it was really only behaving like 255 for a while then

#

oh well, you're right about 255 being enough anyways

sinful kelp
#

anyone got a GUI Library/Resource with Action mapping to Items. About to create my own unless someone has one.

tardy delta
#

That's how i did it

quaint mantle
#

im not very good with inventories, is there any event for changing an item in inventories ?

#

dragging them in the inventory to seperate their stacks & etc ...

#

i want players to be able to only move items in an openned gui

#

and not place the items in their own inventory

#

i want it to be only moveable in this open gui and not player's inventory

#

this is what i tried and failed

minor otter
#

May be a lil much to ask but does anyone have a working example of a block populator on 1.18?

sharp flare
#

just cancel them if their trying to move items against the GUI, from checking the view and holder

quaint mantle
#

thanks, it worked

#

i also fixed something with drag

sharp flare
#

great

dull whale
#

how do I make a falling block's texture another block?

daring lark
#

I have that error message but i don't know what is wrong with my code.

[10:01:17 ERROR]: Error occurred while enabling BetterFishing v1.0 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.player.PlayerEvent. Static getHandlerList method required!
at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:724) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:661) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at com.placek.betterfishing.BetterFishing.onEnable(BetterFishing.java:16) ~[Lowiarka.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564) ~[paper-1.18.1.jar:git-Paper-186]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478) ~[paper-1.18.1.jar:git-Paper-186]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727) ~[paper-1.18.1.jar:git-Paper-186]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503) ~[paper-1.18.1.jar:git-Paper-186]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[paper-1.18.1.jar:git-Paper-186]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-186]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-186]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

#

here is my code:

package com.placek.betterfishing.Events;

import com.placek.betterfishing.CustomItems.CustomArmors;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public class PlayerEvent implements Listener {

@EventHandler
public static void playerEvent(org.bukkit.event.player.PlayerEvent e) {
    Player p = e.getPlayer();
    if(p.getInventory().getBoots().getItemMeta().getDisplayName().equalsIgnoreCase(CustomArmors.createJumpBoots().getItemMeta().getDisplayName())) {
        PotionEffect potionEffect = new PotionEffect(PotionEffectType.JUMP, 160, 1);
        p.addPotionEffect(potionEffect);
    }
    else if(p.getInventory().getBoots().getItemMeta().getDisplayName().equalsIgnoreCase(CustomArmors.createSpeedBoots().getItemMeta().getDisplayName())) {
        PotionEffect potionEffect = new PotionEffect(PotionEffectType.SPEED, 160, 1);
        p.addPotionEffect(potionEffect);
    }
}

}

hybrid spoke
#

Unable to find handler list for event org.bukkit.event.player.PlayerEvent. Static getHandlerList method required!

hybrid spoke
#

use the right event

daring lark
#

Do you know which event?

hybrid spoke
#

whats your goal?

sharp flare
#

are u making ur own event?

daring lark
#

to check if player has speed boots and if true then give him speed 2

daring lark
hybrid spoke
sharp flare
#

Aight

hybrid spoke
daring lark
#

i'll try

sharp flare
#

PlayerMoveEvent, it gets triggered many times, optimize ur code for it

clever solar
#

Hello, I have a small question, I am developing a logging plugin for my server, so I use apache poi which allows you to create excel files to make the reading easier to understand.

The problem is that when I build my plugins it can't use the apache poi classes, I have tried different ways but without result, does anyone have a solution for me?

drowsy helm
#

have you shaded it?

hardy swan
#

is there a way to specify a primary key that consists of all the columns without writing all the columns

#

when writing a create table statement?

drowsy helm
#

are you talking about sql?

hardy swan
#

yes

drowsy helm
#

could you elaborate on what you mean by "consists of all the columns" not sure what you mean by that

vocal obsidian
#

A Panel Making Plugin with subcategories I need a GUI for custom recipes
someone know that Plugin

#

?

hardy swan
drowsy helm
#

oh a composite primary key

clever solar
#

In my build.gradle I put in implementation.

hardy swan
#

is there a keyword or sorts to signify that the primary key consists of all columns

drowsy helm
#

no, not that im aware of

clever solar
#
implementation group: 'org.apache.poi', name:'poi', version: '5.2.0'
drowsy helm
#

i've got no clue about gradle sorry

raw ibex
#

How would I make a custom villager GUI? Is that possible with spigot?

#

Such as hypixel bedwars shop

drowsy helm
#

theres a few apis out there for that

raw ibex
#

What would I search for/

drowsy helm
#

check out villagergui api

raw ibex
#

OK

drowsy helm
#

like you have to hide the villager with trickery or use workarounds

raw ibex
#

OH

#

what do you mean hide?

drowsy helm
#

just hide the villager from the player

#

if you just want a pure gui

raw ibex
#

its not just a gui

#

its bedwars shop

chrome beacon
#

Just open a normal chest GUI then

raw ibex
#

ok

#

i basicaly want custom villager trade

#

like bedwars shop

cold field
#

Guys quick question. Is there an event like PlayerDropItem but that returns the item dropped location?

#

If I get the item and then I use getLocation it returns the player location -.-

#

Hum, I see. Does it exists an event for that or do I need to wait some ticks before checking location?

quaint mantle
cold field
#

I'm doing a runnable that runs after 5 ticks the player has dropped the item. If it meets certain conditions the item is teleported back to the player

analog hinge
#

Hi just came to the server :)
I needed an answer that I couldn't find on google
I noticed in the Material enum that there was quite a few materials with the LEGACY prefix.
My question was why when iterating over the materials is it NOT selecting them when using the enum method .contains(String str) ?
Here a bit more context, I had a ArrayList<Material> sourceMaterials list that I was using to select materials with LOG in them using a for loop and if statements.

for (Material material : Material.values())
{
  String matName = material.name(); // convenience variable

  if (matName.contains("LOG"))                                        // FILTER: log types
    sourceMaterials.add(material);
  else if (matName.contains("STEM"))
    if (matName.contains("WARPED") || matName.contains("CRIMSON"))    // FILTER: stem types
      sourceMaterials.add(material);
}

I got concerned when I saw all those LEGACY materials that I'd have the rework my selection code but it turns out the for loop doesn't even detect the LEGACY materials and on my IDE they appear as dashed over?? here's a screenshot: https://prnt.sc/26q3l8f
Can someone explain this to me?
I only started java about 4 days ago and spigot yesterday so I'm a bit confused there

worldly ingot
#

It's a weird hacky workaround with a library called ASM. So long as your plugin declares api-version in the plugin.yml, those constants don't even exist at runtime for your plugin

#

You can disregard them, really

#

It's so that plugins from pre-1.13 can work with the new 1.13 Material names (because a large chunk of them were renamed), but Bukkit tries its best to keep forwards compatibility

analog hinge
#

alright thanks for the clear answer
if I understand correctly those LEGACY values basically aren't even in the enum when the plugin runs at startup?

worldly ingot
#

Pretty much, yeah. A plugin compiled against 1.12... for example referring to Material.WATCH, would then be ASM'd to refer to LEGACY_WATCH on a 1.13 server and mapped to CLOCK

analog hinge
#

for 1.18

worldly ingot
#

Though for 1.13+ callers, they're not included in things like values(), valueOf(), or matchMaterial()

#

Don't refer to these constants at all in source either. Really, just pretend they don't exist ;p

worldly ingot
#

It's a library that allows bytecode manipulation at runtime

analog hinge
#

oh is that similar as bit manipulation stuff for c++

#

because I still haven't really touched that subject yet

#

I still have a lot to learn

worldly ingot
#

Probably not quite the same. Java is compiled down to bytecode which is understood by the JVM. It's how things run

drowsy helm
#

bytecode manipulation is very complex and in most cases you won't ever use it

worldly ingot
#

^

analog hinge
#

alright

worldly ingot
#

In my 8 years, I've never used it

analog hinge
#

anyway thanks for the help, nice to see the community is active

worldly ingot
#

o/

mossy lintel
#

Hello does anyone know this kind of plugin ?

#

Oh

#

i cannot send

#

It's related to enchant thingy

drowsy helm
#

that doesnt help lol

#

verify your acc and you can send pics

mossy lintel
#

oh

#

here

#

The line thingy

#

can someone help me ?

#

also the enchants what's the name

drowsy helm
#

are you asking how to do that or what plugin?

mossy lintel
#

What plugin the lien thingy

#

on the side

#

Where the yellow line is

drowsy helm
#

idk what the plugin is but its just a custom lore for the item

mossy lintel
#

Eh

#

If you can help me idk how to do that

drowsy helm
#

like how to code it?

mossy lintel
#

Yep

#

or config it

drowsy helm
#

you just get the item meta and set the lore

mossy lintel
#

it's not a lore i think

drowsy helm
#

it is

analog hinge
mossy lintel
#

i'

night patrol
#

.

#

Hi

#

How to create itemstack of custom color concrete powder?

#

Can someone help pls

tardy delta
#

?google

undone axleBOT
tardy delta
#

You could probably find it there

night patrol
#

Oh

dark arrow
#

is there is any event associated with killing mobs

hardy swan
mortal hare
mossy lintel
mortal hare
#

Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of the screen and portraying drop shadows. Its block name in Unicode 1.0 was Blocks.

mortal hare
mossy lintel
#

Can u tel me?

#

What kind of plugin?

mortal hare
#

that involves lore manipulation

#

i don't know which plugin does this

mossy lintel
#

Oh thanks

#

You can dm me if you know thank u for the help also

mortal hare
#

np

dark arrow
dull whale
#

I want to move a group of blocks simultaneously as if they have velocity
I imagine having an entity for each would cause lag is it posibble to do this with resource packs or soemthing

tender shard
#

uninstall the minecraft plugin

#

then everything will work fine

tender shard
#

uninstall the minecraft plugin

#

then it'll work

earnest wigeon
#

How i generate 50 chunk around player

dull whale
tender shard
earnest wigeon
#

ahh thank

tender shard
#

this stupid plugin is totally broken. whenever you have intellij problems, just uninstall it and now everything will work automagically lol

tender shard
#

I don't see any other way then to summon falling blocks or similar things

dull whale
#

makes sense

#

thanks

halcyon sage
#

Hi, how can I get the player entity using a varable?

tender shard
#

which player?

halcyon sage
#

I am making a tpbow plugin

#
@EventHandler
    public void onBowShoot(EntityShootBowEvent event) {
    

    }
tender shard
#

use event.getEntity()

dull whale
#

check if the entity is player then cast it to player

tender shard
#

then check if that entity is instanceof Player

#

and then cast it

halcyon sage
#

ok thanks

#

tyyyy

#

How can I make the player teleport to the point where the arrow falls?

tender shard
#

then just get the arrow's location and TP the player there

halcyon sage
#

okay thanks

#

but how can I have the player entity and have access to player.sendMessage?

tender shard
#

for example:

#

oh wait, doesn't Arrow have a method like getShooter?

halcyon sage
#

ProjectileHitEvent

tender shard
#

you realize that getEntity returns the arrow?

halcyon sage
#

it works

tender shard
#

Projectile.getShooter() returns a projectilesource. Check if that is instanceof Player, then cast it. Now you have the shooting player

tender shard
#

it will throw a ClassCastException because you are trying to cast a Projectile to a player

halcyon sage
#

I've done this for now:

    public void onBowShoot(EntityShootBowEvent event) {

        if(event.getEntity() instanceof Player) {
            Player player = (Player) event.getEntity();
            
        }

    }
#

but I got stuck for a while because I don't know how to continue ahaha

#

?

#

ok

#

done

tardy delta
#

yes

halcyon sage
#

what I wanted to do was: "when the player shoots the arrow, teleport him to the point where it falls".

tardy delta
#

the entity is the shooter

halcyon sage
#

how can i do that

tender shard
#

in EntityShoowBotEvent yes, in ProjectileHitEvent, no

glossy venture
#

isnt there a projectile hit event

tender shard
#

yes. something like this. but of course don't blindly cast to player in the first line - check if it's actually a player beforehand

glossy venture
#

yeah you had BowShootEvent first bro

halcyon sage
#

Location location = event.getEntity().getLocation(); dont work

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.

halcyon sage
#

cannot resolve simbol "location"

glossy venture
#

import it?

halcyon sage
#

LOL

#

sorry hahaha

glossy venture
#

and make sure its uppercase Location

halcyon sage
glossy venture
#

ah ok then it should work now right

halcyon sage
#

.getShooter(); no

#

EntityShootBowEvent

#

right

tender shard
#

do yuo people remember my awesome ?notworking command?

#

?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.

tender shard
#

people keep laughing about the "Does not working" sentence

#

but that's actually what most people write, see here lol

#

"no working" is also common

#

yes

#

I'm a maven maven

#

lmao

#

("maven" means expert)

#

show your pom.xml pls

#

?paste

undone axleBOT
hardy swan
#

I am not working

tender shard
#

which .jar is imported locally?

#

locally = <scope>system</scope> ?

#

please

  1. paste your pom.xml
  2. dm me the api .jar
#

and 3. tell me which package it can't find

quaint mantle
#

Mrnalex

#

Its not working

#

Help me

tender shard
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

**__Trivia:__**

trivia Start trivia session on the specified category.

tender shard
#

here's help

#

enjoy 🙂

quaint mantle
#

I would love to

#

But its not working

tender shard
#

oh

#

shit

#

have you tried

#

turning it off and on again?

#

"made in britain"

quaint mantle
#

It just wont work

errant narwhal
#

hi

#

someone help please

quaint mantle
#

?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!

pine island
#

what is the event name for projectiles being fired also how do i know what kind of projectile it is?

#

making custom projectile trails

#

so i would need to summon ittems and clear them need help with that too\

errant narwhal
#

hmm i want to make a new itemstack is dust by bukkit coding but i want to when i place and break it it will drop an item stack how to do this

pine island
#

check for the block to be broken and placed in x amount of time then summon a item stack

#

or give it to the player

quaint mantle
#

?pdc

errant narwhal
#

i only want for this block ;-;

tender shard
#

to know what kind of projectile it is: instanceof Arrow, instanceof Trident, etc

tender shard
pine island
#

what if i want eggs

tender shard
pine island
#

entity shoot event?

tender shard
pine island
#

lmao

tender shard
pine island
#

alr tysm

tender shard
#

np & np 🙂

pine island
#

is ther a way to make a class for event handlers

errant narwhal
pine island
#

just to make the code clean

tender shard
grim ice
#

Asynchronous tasks should never access any API in Bukkit. Great care should be taken to assure the thread-safety of asynchronous tasks.

#

is there a workaround for this

grim ice
#

not really good with multithreading

tender shard
pine island
#

like the way u can create commands in a diff class can u do the same with events?

grim ice
#

i dont wanna lag main thread

pine island
#

hmm

tender shard
errant narwhal
# tender shard yes

and at this
PersistentDataContainer customBlockData = new CustomBlockData(block, plugin);
is the block is itemstack?

pine island
#

im lazy ill do it in my next prject my main class is so ugly

grim ice
#

im looping through every player, and doing other stuff every 20 ticks

tender shard
grim ice
#

im looking to do this without affecting performance

tender shard
grim ice
#

idk

#

i wanna make it optimized tho

tender shard
#

you can loop over all players hundred times per tick without any problem

grim ice
#

o

tender shard
#

the server itself loops over EVERY ENTITY EVERY TICK

grim ice
#

ok fine then

tender shard
#

and it also does way more other things every tick

pine island
#

alr

#

tysm

errant narwhal
rough drift
#

so um, i need to check if a text is a command (any command), since I have a configuration section for commands to execute and if a command that is inserted isn't a valid command it sends Unknown command. Type "/help" for help. in console, and I'd like to avoid that

tender shard
#

then cancel it if it's one of your commands

rough drift
#

wdym

tender shard
#

and do your stuff

tender shard
rough drift
#

I don't need to check my commands

#

i need to check if its a non valid command

#

such as passing "hello world" as a command in the configuration

errant narwhal
rough drift
#
commands:
  - say hi # valid
  - hello world # invalid
```how can i check if a command is invalid
errant narwhal
#

f

#

nah

errant narwhal
#

u don't understand

rough drift
#

there was a plugin for it

rough drift
errant narwhal
#

@rough drift u don't have args sub command

quaint mantle
errant narwhal
#

then

pine island
#

this works right?

errant narwhal
#

only add one lettle not 2

rough drift
errant narwhal
#

like edit say hi to sayhi

errant narwhal
#

can u show ur plugin.yml?

rough drift
#

My commands work, i need to check if commands inputted by the user are valid commands the console could do

#

such as /say or /gamemode

#

those are valid

hollow bluff
rough drift
#

but /thisisanonexistingcommand aint

errant narwhal
rough drift
#

well thanks for trying to help :D

errant narwhal
rough drift
#

also yes, you can use maven on eclipse

#

there was a plugin for it

#

lemme find it for ya

errant narwhal
errant narwhal
#

ok thank you

full elbow
#

is there a plugin that disable elytra?

sharp flare
#

pretty sure there are ones that exist if u google it

full elbow
#

E

#

i cant find one

fallen thunder
#

Someone know how to do this ? I want do a plugin statut !

#

I can't pu image

spiral light
#

you need to confirm your profile to post images

sharp flare
spiral light
red sedge
#
List<String> emojiList = Config.getStringList("emojis");
        for (String i : emojiList) {
            List<String> list = List.of(i.split("\\|"));
            String replacement = list.get(0);
            String syntax = list.get(1);
            String noColorSyntax = "!" + syntax;
            String permission = list.get(2);
            if (requirePermission &&
                    (!p.hasPermission("server.chat.emoji." + permission) && !p.hasPermission("server.chat.emoji.*"))) {
                continue;
            }
            str = str
                    .replaceAll(noColorSyntax, ChatColor.stripColor(Misc.colouredNoEmoji(replacement + "&f")))
                    .replaceAll(syntax, Misc.colouredNoEmoji(replacement));
        }
        return str;
``` how can i make this more efficient
fallen thunder
full elbow
spiral light
sharp flare
spiral light
#

for disabling elytra and you dont know how to code java you can take a look at the skript thing that exist

sharp flare
#

skript is not recommended on live servers

fallen thunder
spiral light
#

uptime .... ?

#

like the image tells you

red sedge
#

like idk a playtime command or /gmc commands

sharp flare
#

I guess if he knows what he's doing, worth a try

golden kelp
#

hello guys, I want to create a custom potion which makes the player double jump, how can I do so?

quaint mantle
golden kelp
#

I have an alt idea, whenever the player tries to double jump the PlayerToggleFlightEvent (iirc thats what it is called) is called and then I can track if the player has the effect and if he does I can give him a lil boost
so I need to learn how to

  1. Check if the player has my custom effect
  2. Give the player a lil boost
sage dragon
#

Might be a stupid question, but how would I actually check if a player has an inventory currently open?
Player#getOpenInventory never returns null, so does InventoryView#getTopInventory and InventoryView#getBottomInventory never returns null either...

brave sparrow
golden kelp
#

frick

#

what can I do then?

brave sparrow
#

That’s the best way to do a double jump

#

Lol

golden kelp
#

have u ever implemented double jump?

#

is triple jump implementable?

dark arrow
#

is there is any good libraries to make custom enchants easier

golden kelp
#
    private void groundUpdate (Player player) {
        Location location = player.getPlayer ().getLocation ();
        location = location.subtract (0, 1, 0);

        Block block = location.getBlock ();
        if (!block.getType ().isSolid ()) return;

        player.setAllowFlight (true);
    }
    @EventHandler (priority = EventPriority.HIGH)
    public void onPlayerJoin (PlayerJoinEvent event) {
        this.groundUpdate (event.getPlayer ());
    }
    @EventHandler (priority = EventPriority.HIGH)
    public void onPlayerDamage (EntityDamageEvent event) {
        if (event.getEntityType () != EntityType.PLAYER) return;
        if (event.getCause () != EntityDamageEvent.DamageCause.FALL) return;
        event.setCancelled (true);
    }
    @EventHandler (priority = EventPriority.HIGH)
    public void onPlayerMove (PlayerMoveEvent event) {
        if (event.getPlayer ().getAllowFlight ()) return;
        this.groundUpdate (event.getPlayer ());
    }
    @EventHandler (priority = EventPriority.HIGH)
    public void onPlayerToggleFlight (PlayerToggleFlightEvent event) {
        if (event.getPlayer ().getGameMode () == GameMode.CREATIVE || event.getPlayer ().getGameMode () == GameMode.SPECTATOR) return;

        event.setCancelled (true);
        event.getPlayer ().setAllowFlight (false);
        event.getPlayer ().setVelocity (event.getPlayer ().getLocation ().getDirection ().multiply (1.6d).setY (1.0d));
    }

DOUBLE JUMP

restive tangle
#

Bro

golden kelp
#

yea?

restive tangle
#

Have you done your daily prayers yet?

golden kelp
#

Why?

restive tangle
#

It's the daily prayers, it should be done daily obviously

golden kelp
#

bruh

restive tangle
golden kelp
#

H O W

tender shard
#

I was pinged here

#

but I cant find it

#

lol

#

so I guess I'm fine

analog hinge
#

Trying to make an EnumMap with Material as key and ArrayList<String> as value
tried this but it's telling me it can't resolve the constructor and I can't see why

EnumMap<Material, ArrayList<String>> recipesMap = new EnumMap<Material, ArrayList<String>>();

any idea?

eternal night
#

you need to pass the enum key class to the constructor afaik

analog hinge
#

well i did

#

Material is the enum

eternal night
#

you didn't

#

final Map<Material, List<String>> map = new EnumMap<>(Material.class);

analog hinge
#

oh yeah mean that, yeah I was confused

#

alright ill try

tall nova
#

https://hatebin.com/psbwrfqctq
I run this class everytime a player dies using the PlayerDeathEvent, when it gets triggered the server lags a lot and I immediately or eventually get a ticking world exception and the server crashes (I’m using Mojang mappings)

eternal night
#

I mean, the other is just generic argument specification

#

not really passing anything

analog hinge
#

it works thanks :)

#

started java less than a week ago so im a bit lost sometimes x)

eternal night
#

Ohhh

#

yea no worries then 😅

#

thought you had some experience as you are using an enum map

analog hinge
#

yeah I know C++, did a bit a C, python and some other

#

I'm still not used to EVERYTHING being classes lol

#

it's also super fun because it's the first time I actually make a development project
These past few years it's only been learning, learning and learning...

#

without even applying what I had learnt to a real project

golden kelp
#

Hello guys I want to make a custom potion, how can I do so, I want to make a potion which gives u ability to double jump (I have the double jump worked out) but dunno how to do the tracking if playuer has the potion effect

young knoll
#

Add them to a map

#

With a time stamp of when it runs out

waxen plinth
golden kelp
#

oo

waxen plinth
#

You can do that with a map like coll said

golden kelp
#

Thanks

waxen plinth
#

You could also use a scoreboard tag or pdc

#

Both of those would be persistent, not sure if you need that

golden kelp
#

Nah i can use a HashMap for it, dont need any permanent storage

stuck oasis
#

Hey I was trying to build a Minecraft plugin and used the Minecraft Coding Plugin template for Spigot and I don't know how to implement the main class in "src/main/me.cit.PluginLoader". In Manifest.mf it says "Invalid main class"

grim ice
#

is there a way to get players nearby a player in a specific area

vocal cloud
#

?jd

grim ice
#

I want to get players in the 3x3 area where the player is in the center

grim ice
#

so

young knoll
#

There’s one that even accepts a filter iirc

grim ice
#

how am I supposed to use it in my case? not sure

young knoll
#

Player#getNearbyEntities(1.5,1.5,1.5)?

grim ice
#

4.5, 4.5, 4.5?

young knoll
#

You want a 3x3 area

#

Where would 4.5 come from

grim ice
#

alr im drunk

#

ty

young knoll
#

The numbers are radius iirc

lost matrix
rough drift
lost matrix
blazing scarab
#

(Paper)

stuck oasis
lost matrix
stuck oasis
#

Nope

#

First time building a plugin

lost matrix
stuck oasis
#

Wait what you mean by dependency manager

lost matrix
stuck oasis
#

Ah yeah I made it in maven

lost matrix
#

How do you compile it?

stuck oasis
#

Building it with the artifact I made so I get the .jar file

lost matrix
# stuck oasis Building it with the artifact I made so I get the .jar file

So you just ignore maven and everything in the pom.xml
Dont use maven if you dont have quite a bit of experience with plain Java.
Here is a guide on how to build a spigot plugin from scratch without maven/gradle:
https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/

rough drift
#

@lost matrix its an intellij plugin, they just choose "spigot plugin" and it generates everything for them, then all you do is go to maven -> LifeCycle -> package

stuck oasis
#

I was so stupid that I built the plugin to .jar with an artifact and didn't remember I can do the same thing in maven lol

#

But I think my console is still saying that "can't find main class"

rough drift
#

can you send the built jar file

lost matrix
rough drift
#

why?

#

it does everythin for them

brave sparrow
#

That’s the issue

lost matrix
brave sparrow
#

They don’t learn

#

Lmao

unreal quartz
#

Don’t use a tool which simplifies processes for you if you don’t know the process

vocal cloud
#

Usually when the main class can't be found it's a plugin.yml issue

stuck oasis
rough drift
#

however if they want to make plugins only they should focus on learning plugins then maven imo

stuck oasis
#

I had wrong file in plugin.yml

vocal cloud
#

Mhm

#

I know

rough drift
#

wait

#

nvm

golden kelp
#

How to give the player 40 hearts for 10 minutes?

rough drift
vocal cloud
#

By giving them 40 hearts for 10 minutes

golden kelp
#

LOOKS LIKE THE FLOOR HERE IS MADE OUT OF FLOOR

rough drift
golden kelp
#

ok man

#

but for real can anyone tell me?

rough drift
#

yeah use health boost effect

golden kelp
#

and how do I turn it off after 10 minutes?

vocal cloud
#

By giving them 10 minutes of the effect?

golden kelp
#

oh

#

forgot

#

NOW I KNOW WHY U GUYS WERE TALKING LIKE THT

#

i thought u couldnt specify time

tribal holly
#

Hi i have register a custom enchant but i have only the glow effetc on the item, is there any way to display the new enchant in enchant vanilla list ? or did i need to handle this by myself with lore ?

blazing scarab
#

manually

tribal holly
#

hmmmm

blazing scarab
#

custom enchantments are unsupported

tribal holly
#

hmmmmmmmm

#

is there an event when an enchant of an item is changing ?

mint mesa
#

do I come here for help on essentials not hooking into my project?

shrewd sentinel
#

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type

#

public class CustomMob extends EntityZombie {

    public CustomMob(Location loc) {
        super(EntityTypes.be, ((CraftWorld) loc.getWorld()).getHandle());

        this.b(loc.getX(), loc.getY(), loc.getZ());

    }

}
delicate lynx
tender shard
#

is there a way to check if a player is "still" mining a block?

#

PlayerInteractEvent fires when a player starts mining

#

BlockBreakEvent is called when it's done

#

but if they keep pressing the mouse button...

rough drift
#

question

#

is the command map always the same

tender shard
#

yes

rough drift
#

alright

#

then i can just get it once

mint mesa
rough drift
#

right?

tender shard
shrewd sentinel
delicate lynx
#

I was replying to someone else

tender shard
tender shard
tender shard
#

wrong reply

#

ugh I am stupid today

tender shard
glossy venture
#

hm

tender shard
#

I am looking for something like... player.isMining() lol

#

probably doesn't exist

rough drift
#

and when they leave also remove them

rough drift
#

why not?

glossy venture
#

but we dont know how to detect cancel

tender shard
#

okay wait I'll try to explain what I need it for

glossy venture
#

at least without packets

tender shard
rough drift
tender shard
#

so tl;dr

#

my plugin switches to the proper tool when attempting to mine a block

#

it should switch back to the previous when a player is finished with mining

rough drift
#

uhhhhhh

tender shard
#

if I just switch back on blockbreakevent but they are still mining, I'm fucked

glossy venture
#

why cant you use packets

tender shard
rough drift
#

lemme think, because i know there is something to detect it

tender shard
#

but I'd love to do it without

#

because I don't want to have protocollib as dependency

glossy venture
#

i think it might be the only option

glossy venture
tender shard
#

yeah sure, it'd be just "either install protocollib or not have that feature"

glossy venture
#

register a channel listener to the netty channel pipeline

tender shard
#

oh

#

yeah

#

but

#

I've never done that

rough drift
#

its easy ish

tender shard
#

and have no idea about how netty works

rough drift
#

lemme send you the code for it

glossy venture
#

i think you need to do it per player

#

and when they join

tender shard
rough drift
#

yep

#

and also unregister it

#

when they leave

#

lemme open the project

glossy venture
#

ike make sure to tag him cuz hes in #bot-commands lmao

rough drift
#
ChannelDuplexHandler channelDuplexHandler = new ChannelDuplexHandler() {
  @Override
  public void channelRead(ChannelHandlerContext ctx, Object obj) throws Exception {
  // Obj is your packet, you need NMS to get the packet list
  super.channelRead(ctx, obj); // Remove to cancel the packet
  }
};
((CraftPlayer)player).getHandle().playerConnection.networkManager.channel.pipeline().addBefore("packet_handler", "your_handler_name", channelDuplexHandler);
```On Join ^

```java
Channel channel = ((CraftPlayer)player).getHandle().playerConnection.networkManager.channel;
channel.eventLoop().submit(() -> {
  channel.pipeline().remove("your_handler_name");
});
```On Leave ^

IIRC its that
#

@tender shard

#

Also I have a question, how'd you put hyperlinks in your signature? (so not https://website.com but Website)

glossy venture
#

signature?

lost matrix
glossy venture
#

oh on spigotmc

rough drift
tender shard
rough drift
#

np

rough drift
#

the thing in the spigot forums

#

under your post

#

there's a DISCORD image with some other links

tender shard
#

isn't there a button to add links?

rough drift
#

Yeah but for me they always appear as full links

lost matrix
#

There is only one external plugin in use for my projects. And that protocollib. I think its well written.

tender shard
#

I just click on the one right of the A

#

if that doesn't work, click on the "wrench" symbol and use BBCode

#

e.g. my signature is this:

#
[CENTER]Author of [URL='https://www.mfnalex.de']ChestSort, AngelChest and other open source 1.13+ plugins[/URL].
Check out my development resources: [URL='https://www.spigotmc.org/threads/powerful-update-checker-with-only-one-line-of-code.500010/']UpdateChecker [/URL]- [URL='https://www.spigotmc.org/threads/custom-block-data-store-any-information-in-blocks-without-databases-or-files.512422/']CustomBlockData[/URL]
[URL='https://discord.jeff-media.de'][IMG]https://api.jeff-media.de/img/discord1.png[/IMG] [/URL]
[/CENTER]
rough drift
#

OHHHH

#

thanks

tender shard
#

np

rough drift
#

yay it works

tender shard
#

now show it to us

rough drift
#

i can't post pics xD

tender shard
#

you can send a link to your profile