#help-development

1 messages ยท Page 1040 of 1

smoky anchor
#

fire resistance potion makes you immune to fire

pseudo hazel
#

well fire resistance allows you to swim in lava unharmed

wet breach
#

however all we want is the code to run damage as if it was from fire

#

not actually set them on fire

short drift
#

Then I suppose it might be a bug. Is someone able to confirm if it exists on your end too?

pseudo hazel
#

fire res still lets you get set on fire, you just dont take damage from the fire ticks

short drift
#

Setting damage type to ON_FIRE causes fire sound, but also has knockback.

pseudo hazel
#

weird

wet breach
#

fire shouldn't have knockback o.O

pseudo hazel
#

what does the pov look like from the player

#

first person

short drift
#

Walking into ACTUAL fire has no knockback.

wet breach
#

right, because the damage from fire doesn't have knockback or shouldn't

pseudo hazel
#

yes thats why I said I dont think its normal knockback

short drift
wet breach
#

another test

#

you could try starvation damage

#

that also has no KB or shouldn't

pseudo hazel
#

yes but what about from first person perspective

#

also what version is this

short drift
#

1.21

pseudo hazel
#

yeah thats teleportation

#

but the question is, how xD

short drift
#

It might be teleportation, but I'm not the one doing it.

wet breach
#

do you have other plugins on the server?

short drift
#

Not really.

pseudo hazel
#

and if you walk into it from the opposite side?

wet breach
#

so that is yes

short drift
#

Nothing that would have anything like this.

pseudo hazel
#

like does it always knock you back in the same direction?

short drift
pseudo hazel
#

hmm

short drift
#

South-East I would say.

#

Oh, actually.

#

I have one idea.

#

Let me try that out real quick...

wet breach
#

try setting the location of the damage?

short drift
#

I remembered the chair plugin had a setting related to damage. This might be it if the chair plugin is malfunctioning.

wet breach
#

hence I asked if you had plugins

#

generally when testing even if you think it might be a bug, you should remove all plugins except what you are testing

#

so you can be certain nothing else is interfering

short drift
#

Although, turning that setting off did not seem to make a difference.
But I'll try disabling all plugins next.

wet breach
#

also helps if you intend to submit a bug report

#

?jira

undone axleBOT
smoky anchor
short drift
#

Disabling plugins didn't help.

wet breach
hazy parrot
#

Does anyone have idea how should I manage my versions in monorepo microservices architecture ? I decided that every service will have independent version and because of that I have no idea how I should pass each service version to CD. I trough that I can maybe do that with merge request labels but that doesn't really sound good imo

short drift
wet breach
#

makes sense

smoky anchor
#

can you try regular /damage command with only the type and no location/entity ?
I wonder if that still causes knockback, if so then this is a spigot bug

short drift
short drift
wet breach
#

well I don't have the source, but I am going to assume that without a location or entity set it falls back to the most basic damage vanilla has which happens to have knockback

smoky anchor
#

Then I assume spigot has a bug

wet breach
#

I don't think it is

short drift
wet breach
#

since setting location fixes it

short drift
#

It's unintuitive.

smoky anchor
#

if the vanilla command does not deal kb when not specifying the location
the DamageSource should not either

wet breach
#

however, using the builder utility is also not a necessity either just fyi for applying damage

#

just makes it easier

short drift
#

At first I tried without the damage builder of course.

#

But that had also knockback.

wet breach
young knoll
#

You can also just directly set health

#

But that wonโ€™t account for any armor

smoky anchor
wet breach
short drift
#

Yes, but I wanted the visual damage effect. And applying the damage effect alone - that also had knockback.

wet breach
young knoll
#

Not the sources

#

It used to just be generic damage

short drift
#

Fire damage also had knockback.

young knoll
#

No idea why

#

Maybe some internal jank

short drift
#

Well, I don't have account in the new jira thingamajig. If someone wants to make a bug report about this feel free to take over.

#

I'm happy that I got it to work somehow. Thank you everyone for your help.

river oracle
short drift
#

I've had pretty bad experiences with reporting bugs for open source projects. So I prefer not to.

river oracle
#

I mean it likely won't end up being fixed as soon then idk what to say

#

As long as you got it working ig

wet breach
#

I really don't think it is a bug =/

river oracle
#

I don't think fire does knock back in vanilla

short drift
#

Maybe it's not a bug, but at the very least it's weird default behavior for calling:
player.damage(1.0)) in my opinion.

wet breach
wet breach
short drift
#

I wonder if that happens with monsters too ๐Ÿค”

wet breach
#

you were using the builder class to apply damage, not just calling the damage method

short drift
#

So the next thing I tried was to use the builder.

#

In attempt to get rid of the knockback.

wet breach
#

right, but my point is the builder class must do something different when you don't specify one of the three options

young knoll
#

Iโ€™ve realized I can use packet listeners to allow my action bar stuff to play nicely with other plugins using the action bar

#

Just need to figure out how to only intercept packets that arenโ€™t from my plugin

hollow vessel
#

Hi, I have problem with sending packet using ProtocolLib, can someone help me? I'm new with packets...
This is an exception when I send this method
https://paste.md-5.net/tovetaduwe.sql

public void changeFov(Player player, float fovValue) {
        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
        PacketContainer packet = protocolManager.createPacket(PacketType.Play.Client.ABILITIES);

        packet.getBooleans().write(0, true);
        packet.getFloat().write(0, 0.05f);
        packet.getFloat().write(1, fovValue);

        protocolManager.sendServerPacket(player, packet);
    }

line 18 (as we can see in exception) is this line of code:

packet.getFloat().write(0, 0.05f);
young knoll
#

Then there is no float field to write to

hollow vessel
chrome beacon
#

Check the nms packet class

hollow vessel
#

which class

chrome beacon
#

The class for the packet you're trying to send

hollow vessel
#

I think I need to send ClientboundPLayerAbilitiesPacket this packet but this is internal which I can not access, am I right?

chrome beacon
#

Open it and see the packet format

hollow vessel
#

I can not access this class

#

cause it is internal

chrome beacon
#

?nms

young knoll
#

Alternatively

#

?mappings

undone axleBOT
young knoll
#

Fields should be listed there

chrome beacon
#

Right that too

hollow vessel
#

what do I have to do with it

young knoll
#

No idea

#

Does plib have a way to print what fields are available

#

Or any way to find out

hollow vessel
#

maybe something like this?

#

or how can even send this packet without PL

quiet fiber
#

Can anyone help me with a plugin? im trying to make a plugin that gives effects depending on what armor trim a player have on their chestplate, and i have a problem with getting the amor trim data, cos its basically not in Itemmeta

river oracle
#

It litrally is girlll

#

Cast ItemMeta to ArmorMeta ๐Ÿ’ช๐Ÿ˜ˆ๐Ÿ˜ˆ๐Ÿ˜ˆ

quiet fiber
#

im a man btw xD

river oracle
#

I know

river oracle
#

Import it

#

Frrrr

#

Make sure you're using java 21 UwU

#

If you're on latest

quiet fiber
#

i installed the latest java just before doing the plugin to make sure its good

#

@river oracle could you somehow join a vc for like 3 minutes

river oracle
#

I'm on vacation

#

Absolutely not

quiet fiber
#

oh ok

river oracle
#

Well I'm trying to be on vacation

#

I'm stuck in an airport ๐Ÿ’€

quiet fiber
#

can i send you a part of the code in dms to see if its alr?

quiet fiber
river oracle
#

It aint the nuclear launch codes

quiet fiber
#

ikr

#

private void applyEffects(Player player) {
ItemStack chestplate = player.getInventory().getChestplate();
if (chestplate != null && chestplate.hasArmorMeta() && chestplate.getArmorMeta().getPattern()) {
for (ArmorTrim armorTrim : chestplate.getArmorMeta().getPattern().keySet()) {
applyEffectFromConfig(player, String.valueOf(armorTrim.getPattern().getKey()));
}
}
}

tardy delta
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
hollow vessel
quiet fiber
young knoll
#

Itโ€™s hasItemMeta and getItemMeta

quiet fiber
#

but both ways something else is red xD

young knoll
#

You need to cast an instance of ItemMeta to armor meta

quiet fiber
#

to make it the easiest, what exactly to change in the part i sent?

icy beacon
young knoll
#

ArmorMeta meta = (ArmorMeta) chestplate.getItemMeta

quiet fiber
#

because basically wherever i change smth with that it goes red again

#

@young knoll @river oracle

lean pumice
#

If i regenerate the end, does it regenerate the end or a normal world called end?

spice burrow
quiet fiber
#

ItemStack chestplate = player.getInventory().getChestplate();
ArmorMeta meta = (ArmorMeta) chestplate.getItemMeta;
ItemStack meta = ArmorMeta;

#

like that? @spice burrow

tawdry echo
#

?java

#

Idk bruh

remote swallow
#

?java17'

#

?java17

undone axleBOT
sacred cedar
#

Hey i am currently updating my plugins
and ran into the issue where the class AttributeModifier is marked for removal

and i need a sort of thing like that at any cost

here is the current code i've written:

meta.addAttributeModifier(
  Attribute.GENERIC_ATTACK_SPEED,
  new AttributeModifier(
          UUID.randomUUID(),
          "generic.attackspeed",
          -attackDelay(),
          AttributeModifier.Operation.ADD_NUMBER,
          EquipmentSlot.HAND
  )

is there a alternative for that?

pseudo hazel
#

paper?

sacred cedar
#

its a bukkit package

sacred cedar
hollow vessel
pseudo hazel
sacred cedar
pseudo hazel
#

there are different constructors

#

and the one that takes a namespacedkey as constructor isnt deprecated

sacred cedar
#

OH

pseudo hazel
#

its because of how vanilla changes things

sacred cedar
#

now i see it

spice burrow
quiet fiber
spice burrow
#

idk much about c++ but pretty sure that requires you to define the type too... same thing in java

quiet fiber
#

btw

quiet fiber
spice burrow
#

share your code and stacktrace please I don't wanna keep guessing at what's wrong

pseudo hazel
#

if its red usually it has a reason

#

maybe hover over it or something to see a message as to why its red

spice burrow
# quiet fiber i added this and again smth is red bruhhh
      ItemStack chestplate = player.getInventory().getChestplate();
      ArmorMeta chestMeta = (ArmorMeta) chestplate.getItemMeta();
      chestMeta.setTrim(new ArmorTrim(TrimMaterial.AMETHYST, TrimPattern.BOLT));
      chestplate.setItemMeta(chestMeta);

i've never set an armor trim before but this should work

pseudo hazel
#

maybe check if the player is wearing a chestplate, but yes should work I think

quiet fiber
#

imma send you the whole code rn

spice burrow
#

chestMeta#getTrim

quiet fiber
#

i sent you in dms cos it doesnt let me here

pseudo hazel
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

hollow vessel
#

Hi, I have problem with sending packet using ProtocolLib, can someone help me? I'm new with packets...
This is an exception when I send this method
https://paste.md-5.net/tovetaduwe.sql

public void changeFov(Player player, float fovValue) {
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Client.ABILITIES);

packet.getBooleans().write(0, true);
packet.getFloat().write(0, 0.05f);
packet.getFloat().write(1, fovValue);

protocolManager.sendServerPacket(player, packet);
    }

line 18 (as we can see in exception) is this line of code:

packet.getFloat().write(0, 0.05f);
royal jay
#

are there any reports with the .setAbsorptionAmount, im trying to set the obsorbtionamount of the enderdragon bow somehow it isnt being set and there is no error

enderdragon.setAbsorptionAmount(Config.enderDragonSettings.get("Phase2Absorbtion").getAsDouble());
System.out.println(enderdragon.getAbsorptionAmount() + " -- " + Config.enderDragonSettings.get("Phase2Absorbtion").getAsInt());

System returns: 0.0 -- 300.0

carmine mica
#

you need to add a max absorption modifier otherwise it'll be clamped to that value

#

just like with health, you can't set health higher than the max health attribute, same applies to absorption

royal jay
#

how do i change the max value for absorbtion?

#

doesnt look like there is a method for it

trail coral
#

how can i make my plugin support multiple versions?

#

with maven

chrome beacon
#

Have the main part of the code compile against the oldest version you want to support

#

Then add multiple maven modules for different versions

#

And only load code supported on the running version

carmine mica
royal jay
#

ah i see, thx

trail coral
chrome beacon
#

Just don't use a class from another module unless that module supports the running version

#

There are many ways of handling that

#

Just using a switch statement is one way of doing it

#

You can also use reflection if you prefer that

trail coral
#

i meant the whole process

chrome beacon
#

I don't have a guide for you atm

#

Just follow the steps I wrote and it will work

jaunty harness
#

Hi!, I have a problem. How do i code so that if we click an item in the first InvenEvent we can move into the next InvenEvent?

lilac dagger
#

which invenevent?

clever lantern
#

when the player places a block which had pdc in it can i retrieve the data from the block by:
ItemStack item = block.getState().getData().toItemStack(1); or some other way?

pseudo hazel
#

no

#

you need to store it in the chunk pdc

chrome beacon
#

?blockpdc

undone axleBOT
chrome beacon
#

?morepdc

undone axleBOT
clever lantern
#

when player places item get pdc from item and put it on block

#

?

chrome beacon
#

Wait do you want to get the item in the place event

clever lantern
#

yes

#

basically player when placing block i need to check if it has certain key stored in pdc

jaunty harness
# lilac dagger which invenevent?

I have InvenEvent_1 and InvenEvent_2. In InvenEvent_1, there is an item that makes us move to InvenEvent_2 if we click it. Do you understand what i mean?

clever lantern
#

lol

#

ty

supple abyss
#

Does someone here know why everytime I paste a schematic with FAWE API it gets slower progressively? Never used their API before so yeah

chrome beacon
lilac dagger
#

there's an inventory

#

you can then use assuming you have inventories

#

in your inven evnt 1 and 2

supple abyss
trail coral
#

can anyone help me thru making plugins multiversioned? i have some issues/questions like how do i use maven modules for that

green prism
#

Hi there. Do you think I should merge my commons into my public plug-in?

jaunty harness
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!

silent slate
#

Hey, I'm trying to design a GUI that has 3 heads, each representing either the owners, trusted and members of the current plot the person is standing on. Now i got this error: https://pastebin.com/x1MF64d1

This is my code for the function:
https://pastebin.com/GDJn0u2q

trail coral
chrome beacon
#

What do you want us to do

#

Read your mind

green prism
#

olivo

chrome beacon
#

Yeah shade it if possible

trail coral
#

literally just asked a question that you could answer why does that need mind reading

#

thers nothing to provide for it

trail coral
#

doesn't help

#

im asking for a walkyhru and youre just naming the steps

chrome beacon
#

Be more specific

#

What exactly do you need help with

trail coral
#

I DONT KNOW HOW TO USE MODULES AND LOAD THEM

chrome beacon
remote swallow
#

Alex has a guide too iirc

jaunty harness
trail coral
blazing ocean
#

Hi there! Today Iโ€™m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

chrome beacon
jaunty harness
green prism
# chrome beacon Yeah shade it if possible

I see. I appreciate your help.
Only problem is that I'm actually using the libraries feature

libraries:
  - "com.zaxxer:HikariCP:4.0.3"
  - "org.mongodb:mongodb-driver-sync:5.0.1"

Inside my Commons plug-in, which drastically reduces its size. Shading that commons means shading those libraries inside as well

#

what would olivo do? ๐Ÿคฃ

chrome beacon
#

Add that to your plugins library section instead of shading them

trail coral
#

if i dont use nms do i need to do anything or does it support different versions on its own?

#

like if i set api-version to 1.13

#

does it just support everything 1.13+?

chrome beacon
#

You can do so with a Map

#

They key can be the players uuid

green prism
chrome beacon
silent slate
chrome beacon
#

You're trying to modify an immutable set

silent slate
#

why is it immuteable?

#

and how can i make it so i can edit it?

chrome beacon
#

Haven't looked at the code yes

#

yet*

#

Just told you what the error said

silent slate
#

but isnt there a general solution to the problem?

#

These are the sets: ```
java
Set<UUID> plotOwners = plot.getOwners();
Set<UUID> plotTrusted = plot.getTrusted();
Set<UUID> plotMembers = plot.getMembers();

blazing ocean
#

not modifying an immutable set

chrome beacon
#

well the general solution would be not modify the immutable set

silent slate
#

and if i need to?

#

can i clone it somehow and then edit that set?

chrome beacon
#

you can clone it

pseudo hazel
#

yes new HashSet(plotOwners)

silent slate
pseudo hazel
#

should be

#

?tas

undone axleBOT
chrome beacon
silent slate
#

like this?

#

Set<UUID> plotOwners = new HashSet<>(UnchangeableplotOwners);

pseudo hazel
#

do you really want me to put ?tas again?

silent slate
#

i am already trying this

pseudo hazel
#

cool

dusty totem
#

Hey how to get address from ServerConnectedEvent event that client targeting?

sacred cedar
#

Hey,

I am currently trying to remove all vanilla crafting recipes. And i run into the problem that i cannot use Bukkit.clearRecipes(); because of my custom recipes and now i get everytime i restart the server and join errror spamming that the server couldn't find the recipe to give it to the player.

So i need to check if a recipe is a vanilla one and remove it without removing my other ones.

Any ideas?

silent slate
#

same fu****ing Caused by: java.lang.UnsupportedOperationException
at com.google.common.collect.ImmutableCollection.remove(ImmutableCollection.java:282) ~[guava-32.1.2-jre.jar:?]

chrome beacon
#

yeah don't try to modify the immutable set

silent slate
#

i am not

blazing ocean
#

yeah you are modifying an immutable colleciton

chrome beacon
#

Well that error says you are

silent slate
#

i am accessing the second 3

        Set<UUID> UnchangeableplotTrusted = plot.getTrusted();
        Set<UUID> UnchangeableplotMembers = plot.getMembers();

        Set<UUID> plotOwners = new HashSet<>(UnchangeableplotOwners);
        Set<UUID> plotTrusted = new HashSet<>(UnchangeableplotTrusted);
        Set<UUID> plotMembers = new HashSet<>(UnchangeableplotMembers);```
chrome beacon
#

Send the entire stacktrace

#

?paste

undone axleBOT
silent slate
chrome beacon
#

What's GUIUtils.java:209

silent slate
#

plotOwners.remove(currentUUID);

#

for (UUID currentUUID : plotOwners) {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(currentUUID);
plotOwners.remove(currentUUID);

            plotOwnersName.add(ChatColor.RED + offlinePlayer.getName());
        }
chrome beacon
#

Does plotOwners happen to be immutable

silent slate
#

plotowners is a hashset i created

#

Set<UUID> plotOwners = new HashSet<>(UnchangeableplotOwners);

#

this is the imuteable thing

#

Set<UUID> UnchangeableplotOwners = plot.getOwners();

chrome beacon
#

Recompile the jar and restart

silent slate
#

wait

chrome beacon
#

You're most likely running old code then

silent slate
#

hail nah

#

i dont even need to remove it here

#

i dont even need to edit it here

#

dump mistake

short drift
#

Carpets don't seem to have alpha anymore?

#

When did that get removed?

umbral ridge
#

what are these blocks?

small hawk
#

is there a way to spawn exaclty this guy with code? I mean not the enities because it's fairly easy, but connect the llamas to the villager with leads and set custom trades inside him?
https://i.imgur.com/SMBzo4I.png

dusty totem
#

Is there a way to get BungeeCord (public) IPAddress based on client connection?
So to where is the client connected?

chrome beacon
#

Are you making a bungeecord plugin?

dusty totem
#

yup

#

I need feedback to which IPAddress (bungee) client is connected

digital nova
#

like when i built i'm just told no classes in net.minecraft exist

#

net.minecraft itself is apparently not present

chrome beacon
#

How are you building

digital nova
#

intellij build cmd

chrome beacon
#

Make sure you build with maven

#

Open the maven tab on the right, and run the package task

digital nova
#

always been like this, still have the issue

chrome beacon
#

So the classes are in the IDE? but not available during package?

cedar flint
#

I created a custom inventory and am trying to cancel item pickup from certain slots, but when I do that it also cancels the player inventory movement. How to do this correctly?

digital nova
chrome beacon
chrome beacon
digital nova
#

lmao i have 2022.2

#

is that an issue?

pseudo hazel
#

probably

chrome beacon
#

I believe there was an issue with Intellij for a bit

#

can't remember exactly what it was so give it an update

#

and see if it helps

digital nova
#

i'm installing 2024.1 so that should hopefully work

slender elbow
#

well, older intellij versions don't really know about modern java versions like the ones Minecraft is compiled for today, so possibly

digital nova
#

Ok time to do some disk cleanup

#

i don't even have enough space to install intellij

tardy delta
#

๐Ÿ’€

quaint mantle
#

slay

digital nova
#

moving it all to an archive hdd now lol

scarlet jolt
#

hi, ive been learning plugin dev recently and I was hoping someone could help me with a few questions, dms is easier but here is fine too

#

lmk cus im doing a plugin vs datapack battle thing with my friend

chrome beacon
scarlet jolt
#

thanks so much

#

ok so im trying to make a bee thats always angry

pseudo hazel
#

wdym plugin vs datapack

#

plugins can use datapacks ๐Ÿ’€

#

you win

scarlet jolt
#

LOL

#

my friend is making the same mob using datapacks

pseudo hazel
#

oh I see

scarlet jolt
#

and im tryoing to make it in plugin

pseudo hazel
#

tough fight

scarlet jolt
#

yeah

#

hes like really good and i dont know a thing hes also usinf genorators and datap[ack discord severs so ug

chrome beacon
#

So what are you comparing

scarlet jolt
#

ueah

#

ill send a ss

#

oh i cant

chrome beacon
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

scarlet jolt
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

young knoll
#

The bee api has a setAnger option

scarlet jolt
#

i dont have forums

young knoll
#

Presumably you just need to keep setting that to > 0

scarlet jolt
#

pproblem

#

not option

young knoll
#

You can also keep setting hasStung to false

scarlet jolt
#

well under public Wisp

#

i didnt come up with name btw

#

i have bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");

#

nad it works

#

bee.setCustomNameVisible(true);

#

but i tried adding attributes and they dont work

#

AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);

scarlet jolt
#

thanks

#

does anyone know why that code doesnt work?

chrome beacon
#

Could you send the entire method

#

?paste

undone axleBOT
scarlet jolt
#

yeah

#

public class Wisp {

public Wisp(Location location, PluginBattle plugin) {
    Bee bee = (Bee) Objects.requireNonNull(location.getWorld()).spawnEntity(location, EntityType.BEE);

bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
bee.setCustomNameVisible(true);
Objects.requireNonNull(bee.getEquipment()).setHelmet(new ItemStack(Material.YELLOW_STAINED_GLASS, 1));
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);

    new BukkitRunnable() {
        @Override
        public void run() {
            if(bee.isDead()) {
                return;
            }

            if (bee.getTarget() == null) {
                for(Entity entity : bee.getNearbyEntities(10, 10, 10)) {
                    if(entity instanceof Player) {
                        bee.setTarget((Player) entity);
                        bee.setHasStung(false);
                    }
                }
            }

            bee.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 120, 2));

        }
    }.runTaskTimer(plugin, 50L, 100L);

}

}

#

ngl i watched a tutorial and like customized it to be the wisp

#

it helped me learn a lot but im still confused by some things

pseudo hazel
#

like what

scarlet jolt
#

wdym

#

oh

#

lol

#

why the atttributes wont work

#

and even thought bee.setHasStung(false);

#

it loses it

#

even when it target range

chrome beacon
#

So first of when spawning an entity and modifying it directly after you should use the spawn method that takes a consumer

#

That ensures the entity is spawned with your data

#

Instead of it being spawned and then modified

scarlet jolt
#

oh i see

young knoll
#

A helmet on a bee wonโ€™t render

chrome beacon
#

Secondly that code will cause a memory leak

young knoll
#

And the speed effect probably wonโ€™t do anything either

scarlet jolt
#

yeah those both didint worj lol

chrome beacon
#

You keep the timer running and a bee instance

#

Regardless of if they're needed or not

young knoll
#

You should check isValid and then cancel the timer

chrome beacon
#

^^

young knoll
#

isValid also covers isDead

scarlet jolt
#

oh im not that advanced... i watched a tutorial and modified it to be the wisp i literally learned Java two days ago

chrome beacon
#

dw about it

#

I've seen worse

scarlet jolt
#

LOL

#

thanks

twin venture
#

do itemstack serlized string need to have a type adapter for it to work using redis? cuz the data aren't sent

#

i use redis so when server start (lobby server) it push update of the kit instane to all servers

#

and in other server there will be a pubsub , that will listen for the pushed data

#

but for some reason the contents of the kit (itemstacks) is not being sent

scarlet jolt
#

oh idk what a serlized is but im running a localhost server

chrome beacon
twin venture
young knoll
#

Why canโ€™t the servers just pull the kits from a central database on startup

chrome beacon
#

^^

twin venture
#
  • lobby server start -> load kits from kits.yml -> push them into redis using pubsub -> in game moudle plugin there will be a event to listen for the pushed data
twin venture
#

and other people said the same thing too

chrome beacon
#

They can pull from Redis

tranquil prairie
#

I have 3 modules: A and B and then a common module where A and B depend off on. I want to move a class from module A to the common module so module B can use it but the class has a lot of references in module A. If I make common depend on module A then its a circular dependency (common depends on module A and module A depends on common). How do I have the class in the common module so both classes can use it while still having it reference the objects in module A?

chrome beacon
#

Anyways you've probably given them more information

#

Which is why they told you that

chrome beacon
pseudo hazel
#

if common depends on A, is it really common?

scarlet jolt
#

woah you guys are smart

tranquil prairie
young knoll
#

Then donโ€™t

twin venture
young knoll
#

Your common module shouldnโ€™t depend on any other modules (maybe an api module)

quiet ice
twin venture
#

the bug that iam stuck on rn is the itemstacks serlized string is not being sent to redis

tranquil prairie
#

What should I do to fix the problem though?

pseudo hazel
#

what problem

scarlet jolt
twin venture
#

the idea was to have it on a proxy (bungeecord) but again there are no itemstack api on bungeecord so how would i load it ..

#

and it will push it into other servers

young knoll
#

IF I depend on A I will have a problem
then donโ€™t do that

quiet ice
scarlet jolt
#

LOL

young knoll
tranquil prairie
#

My current problem is that a class in common has references in module A but I need to use in it B

twin venture
scarlet jolt
#

and then use words that nobody knwos and make it veryt long

#

and then you are smart

tranquil prairie
#

Not circular dependency, I just pointed it out as why the simple answer would be problematic

young knoll
#

Then you need to move those references to common too

twin venture
twin venture
#

i checked the InstantCreator , i checked configuration nothing is wrong ..

chrome beacon
#

Are the servers on when the data is published

#

Otherwise they will miss the data

twin venture
#

you don't seems to understand my problem ๐Ÿ™‚

#

it does send them correctly , my only problem it does not send the serlized itemstack

scarlet jolt
#

what did you mean by memoery leak and how do i fix the isDead and isValid thing?

tranquil prairie
#

It is trying to reference it but is failing to resolve it obv

twin venture
#

types are :
"kits" .. for example

pseudo hazel
#

I mean can you build the module without A

tranquil prairie
pseudo hazel
#

if not it literally depends on A, then you have to what coll said and move it over to common

#

maybe you can use an interface an dependency injection

#

depends on what kinda thing you wanna move over

chrome beacon
#

We can't really give better advice without knowing what the code is

oak mica
#

how could i make a player heal with the natural animation?

#

i googled it and it was talking about packets but if i do it that way, will the player actually get healed in the server internally or will it just show on the player's screen that they healed

young knoll
#

If you do both then both will happen

#

If you only send a packet nothing will change on the server

scarlet jolt
#

is this how i make it angry

#

bee.setAnger(10);

oak mica
#

so i shuld send the packet then do .setHealth()?

young knoll
#

Yeah

oak mica
#

alr cool ty

scarlet jolt
young knoll
#

Should work

scarlet jolt
#

okay all of my attrivutes arent working

#

i think I got an answer earlier but I didint understand it

#

bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
bee.setCustomNameVisible(true);
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);
bee.setAnger(10);

#

those all should work right? i think it had som,ething to do with the place they were so the attrivtes would update when the bee was spawned

#

but idk how I woiuld fix that

pseudo hazel
#

use the spawn method with the consumer

#

do you know what a consumer is in java?

scarlet jolt
#

no i learned java like 2 days ago

#

ive got coding experince tho so uh

#

lol

pseudo hazel
#

lmao

#

so basically it will look someting like this spawnEntity(location, EntityType.BEE, (bee) -> {//stuff about the bee});

#

idk if thats the exact syntax for the method

#

but the consumer part is bee -> {}

#

which means "take this bee, what do you wanna do with it?

scarlet jolt
#

phhh

pseudo hazel
#

and then you can go and name the bee and make it angry inside of that

scarlet jolt
#

i have that

#

ohh*

scarlet jolt
# pseudo hazel so basically it will look someting like this spawnEntity(location, EntityType.BE...

public Wisp(Location location, PluginBattle plugin) {
Bee bee = (Bee) Objects.requireNonNull(location.getWorld()).spawnEntity(location, EntityType.BEE);

    bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
    bee.setCustomNameVisible(true);
    AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
    assert attribute != null;
    attribute.setBaseValue(100);
    bee.setHealth(100);
    AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
    assert attribute2 != null;
    attribute2.setBaseValue(3);
    bee.setAnger(10);
pseudo hazel
#

thats not it

scarlet jolt
#

ph

#

oh*

pseudo hazel
#

read what i typed

#

you need the consumer

scarlet jolt
#

oh i see, do I put it in the public Wisp thihg

#

and then the attrivutes go in there i see

#

thank you

scarlet jolt
#

oh okay, the spawnEntity doesnt seem to work

#

do I use this

#

SpawnEggMeta

tardy delta
#

๐Ÿ’€

scarlet jolt
#

LOL OKAY WELL THANKS FOR TRYING

tardy delta
#

last param is a lambda

rapid vigil
#

I don't think you'll know what a lambda is only 2 days after you've got into java :p

slender elbow
#

do you eat that with mayo?

silent slate
tardy delta
#

its just a function

silent slate
#

k, nice 2 know xD

brazen badge
digital nova
#

We often pass it around

silent slate
#

(() => something)

#

this is the only thing i know about it

#

from some old js days xD

digital nova
digital nova
silent slate
#

good ol discord.js bots

digital nova
#

I love djs

#

Itโ€™s far better than JDA

silent slate
#

since coding in java ive begun hating js

digital nova
#

Iโ€™ve always hated js

#

The only reason I agree to use it is discord bots or web dev

silent slate
#

i just love how strict java is, not relative variables, you always know what data types you get

digital nova
#

Typescript is a mess frankly

silent slate
#

theres no change its gonna return you an array if u want a string for example

#

in js you never know

digital nova
#

You can easily break typescript and get undefined behavior

#

Since in the end it transpiles to js

hazy parrot
#

no way u are coding 2 yrs in java and never came across lambdas

silent slate
#

yeah

hazy parrot
#

that is like fundamental

silent slate
#

can be described in one sentence of song lyrics

digital nova
#

Not really if you learn Java the old school way

#

They were only added in Java 8

silent slate
#

"I want it my way. Tell me why?" Because I hate learning and just wanna code for the fun

#

I may do "complicated" stuff and may really overcomplicate my projects, but thats just how i code, unless doing it in a professional setting

#

Trying out new stuff and coding how I like is the only thing keeping me motivated

hazy parrot
digital nova
#

A lot of people still use Java 8

#

I think as of recent pre Java 8 had luckily been eliminated for the most part

#

But a lot of the industry is on Java 8

pseudo hazel
#

yeah

#

java 8 has lambdas

tardy delta
#

thats like the only thing it has

young knoll
#

Hey it has

#

Uhh

#

Integers

wet breach
#

lambda's are not necessary in terms of java

wet breach
#

if anyone is developing in the industry today right now for java, they are most likely not using java 8

#

the nifty part with java that makes this more likely is the fact that newer versions of the JVM can run old java code versions

tardy delta
#

even college doesnt use java 8 \๐Ÿคก

digital nova
#

including the jvm/jdk version

#

not just the language features they use

hazy parrot
# wet breach its not

if u didn't came across lambda that means u never used any kind of stream api, never used completable future, never used threads, never used executors

#

etc

#

so i would call that fundamentals

silent slate
#

yep

slender elbow
#

threads

#

lmao

#

let's ignore the part where threads have been a thing since java 1

hazy parrot
#

i mean thread takes runnable, that is why i mentioned it

silent slate
#

i used completeable futures before, but never really understood it deeply

slender elbow
#

and runnables have been a thing since java 1 as well

silent slate
#

used bukkit runables before

silent slate
#

async stuff

digital nova
#

they are slightly different but

#

same basic idea

silent slate
#

i needed them for luckperms api

hazy parrot
wet breach
hazy parrot
#

i mean nothing requires lambda

wet breach
#

streams are not necessary, and I don't remember if completables require lambda or not

slender elbow
#

nothing strictly requires lambdas

hazy parrot
#

it can be impl or anonymous class

real lagoon
#

Without lambdas

silent slate
wet breach
#

I personally don't really use lambda's myself. Maybe every once in a while simply because there is a few things where it is a bit convenient but outside of that I don't use them

silent slate
#

well i needed to use this

() -> {

for bukkit runables

real lagoon
real lagoon
silent slate
silent slate
wet breach
real lagoon
#

So i didn't understand the context

#

I can't say the r word, what the fuck

#

I was trying to say "Probably i'm r3t4rd3d" but discord didn't let me send this message

quiet ice
#

perhaps talking about stuff using the sun Unsafe? But that isn't security but rather anti-security (for some people, but I'd digress if I elaborate)

digital nova
#

I know many people who work in silicon valley based security companies, almost any backend product they have written in java is not greater than java 11

slender elbow
#

that's most likely existing environments

quiet ice
#

Won't last for all too long - many environments moved past J11 or even past J17 (some libraries even went completely nuclear and went past J21)

slender elbow
#

i can't say i've worked with security products, but the several products and environments i've worked with/for were 17 or 21

digital nova
#

main thing with security products is everything used has to be tried and tested for at least a handful of years

#

and they have a certification team that needs to approve any libraries they use

quiet ice
#

From https://github.com/qos-ch/slf4j/discussions/379 the overall consensus was that SLF4J should move to J17 or even J21.
So if people are pushing SLF4J for such a change, you can guarantee that <J17 is dead (that is, no new projects are written in it) at an enterprise level.

digital nova
#

nobody upgrades just for slf4j

quiet ice
#

Yes, but the opposite is true: SLF4J is likely to stay in line just for these projects

slender elbow
#

i'm not even sure what your point is tbh

#

slf4j isn't going to make people upgrade, sure, but it will make people and firms consider the possibility that investing in upgrading could have a net positive return

young knoll
#

Gotta leave java 8 some day

#

Eventually even the extended support will end

quiet ice
#

Sadly I'm a bit pinned with J8 right now unless I decide to delve a bit into cross-compiling C and decide to screw over mac users

winter zenith
#

is there a bukkit event that fires for all events

#

ideally with a name

river oracle
#

No

young knoll
#

No but you can listen to every event and print the name with a bit of trickery

#

Itโ€™s ugly tho

winter zenith
#

how

sullen marlin
#

?xy

undone axleBOT
winter zenith
#

what is that

sullen marlin
#

you've asked a question that doesn't seem to make sense; explain why you want "a bukkit event that fires for all events"

quiet ice
#

Basically, often there is more than one way to solve a problem

winter zenith
#

achievements

#

configurable.

#

put event name into json file as trigger

quiet ice
#

?jd-s

undone axleBOT
sullen marlin
#

you can register event listeners based on the class as epr the registerXXX overrides

#

but query how that is going to work anyway, how will it know what to do with each event

winter zenith
#

true

winter zenith
#

well iโ€™d listen to only player specific events

#

or events that involve players

#

and apply some action to a player based in the config

wet breach
# digital nova main thing with security products is everything used has to be tried and tested ...

it depends, the only governance in regards to security is whatever the federal government puts out if you intend to use their standards or make products for the use of the government. As for everything else there is really no certification process or should say standardized process. If someone doesn't go past a certain version often times it is because the product is no longer being developed. One of the important things that changed after 11 was reflection. So some things that require reflection will not necessarily work if you go past java 11 without some updating.

#

but in regards to testing for a handful years, yeah don't need to do this not with java anyways

twin venture
#

what is the best aproch to :
(sending custom data bettwen servers in real time and it change in real time) is it possible? iam talking about (creating kits , editing kits , editing cosmeitcs .. sending User updated data )

i used redis but iam stuck on a bug that i don't think its fixable ..

#

my idea was :

  • in lobby moudle or proxy moudle plugin when server start , load kits from kits.yml file.
  • push this loaded data into jedis after loading the kits.yml
  • have a event pubsub that listen to that chanel when it get a message , then update the data on that server running..
river oracle
#

Redis or plugin messages

twin venture
#

with redis iam stuck on itemstack serlized string , its not being sent with redis , idk if i need to make a InstanceCreator for ItemStack bcz redis use gson?

wet breach
#

why couldn't the servers just pull this info from one location? o.O

#

seems you are going about some design in a wrong way or trying to do something differently that doesn't need to be done differently

mellow edge
#

I don't get that, buildtools applys firstly craftbukkit nms patches, but yet some parts of vanilla code aren't fixed; still have compiler errors. How can then it just construct a jar with maven?

young knoll
#

I imagine for the stuff we donโ€™t patch it just copies the already compiled class?

#

Could be wrong

mellow edge
#

well I don't get it from the code because it gets complicated with maven and stuff

twin venture
#

and in the lobby server it push them

wet breach
#

No that is not all that is left. This is a reason such things as DB's exist like mysql.

#

So there is more then just the design you are going with that works and accomplishes what you are wanting. It just seems the way you are going is proving difficult or maybe not ideal. So maybe use a different approach.

mellow edge
wet breach
twin venture
mellow edge
wet breach
#

Not all classes get decompiled or used. Classes not used get put into an mc jar that spigot depends on and is later shaded in.

mellow edge
#

ok

slender elbow
#

the classes that are modified for whatever reason, if those contain decomp errors they need to be fixed

#

but the classes that spigot doesn't patch are not processed as sources, so they aren't recompiled

mellow edge
#

so I think I got it, craftbukkit&spigot decompiles classes, applies patches to the files they need (also fixes every error in those files), then only this files are used in recompilation, and are combined with vanilla jar. so in short: not the whole jar is reconstructed, thus classes that are get decompiled but are not used in any way don't need to get fixed?

slender elbow
#

correct

tranquil glen
#

could someone help me figure out how to downgrade my spigot from 1.21 to 1.20.6 in my pom.xml?

#

thought this would do it

slender elbow
#

sure

#

what's the issue?

tranquil glen
#

wait

#

sorry im dumb

#

my server jar is still 1.21

slender elbow
#

keep in mind you can't downgrade your server, if the world was generated in 1.21 you can't run it in an older version

tranquil glen
#

oh thats fine, im just using a library that has a conflict with 1.21

#

and i wanna finish making this while they figure that out

#

cause i dont have the knowledge to work around it unfortunately

wet breach
#

This way we dont need a bunch of db connections all the time for the data

#

You can store literal files in mysql called blobs

trail coral
#

Syntax error, insert "VariableDeclaratorId" to complete EnhancedForStatementHeaderInit
what the fuck is this bro ๐Ÿ˜ญ it says that when i try to loop thru a hashmap

kind hatch
#

Missing variable name

#

Entry<String, String> entry : entryset

trail coral
#

im so braindead bro

slender elbow
#

javac error messages are very good (not)

young knoll
#

Enhanced for statement header, init?

#

Java is British

elder dune
#

I have it in my code but it will not trigger at all

floral drum
#

what do you have in your code? and how exactly did you "use it"?

elder dune
#

    private Main main;
    public Growth (Main main) {
        this.main = main;
    }

    @EventHandler
    public void onArmorApply(ArmorEquipEvent event) {
        Player player = event.getPlayer();
        ItemStack itemStack = event.getItemStack();

        player.sendMessage("You have successfully applied " + itemStack.getType());
    }

    @EventHandler
    public void onArmorRemove(ArmorUnequipEvent event) {
        Player player = event.getPlayer();
        ItemStack itemStack = event.getItemStack();

        player.sendMessage("You have successfully removed " + itemStack.getType());
    }```
#

I put what he has added the listener to my main onEnable so its getting called

#

and will loead but when I Equip the Armor no message is sent

#

And yes I have it in my maven

young knoll
#

The api likely uses other events to call the custom armor events

#

But it doesnโ€™t tell you to register them anywhere

remote swallow
#

holy fuck

#

that library is a plugin not a library

young knoll
#

Yeah I just noticed that

remote swallow
#

use something like alex's armor equip lib instead

young knoll
#

Once this PR gets merged

#

Then we party

remote swallow
elder dune
remote swallow
#

how do you put it on

elder dune
#

Then when I put a second peace on it says the first peace name

elder dune
remote swallow
#

might be a bug

elder dune
#

Done right click too same thing

remote swallow
#

alex should be around tomorrow to debug it and update it

young knoll
#

I meant a spigot PR

remote swallow
#

dont care didnt ask

young knoll
#

Rude

remote swallow
#

did you even tie your own tie

young knoll
#

No

remote swallow
remote swallow
# tender shard Ok

the person above coll also says it seems to not work so you get to debug stuff

tender shard
remote swallow
tender shard
#

can't help without code

remote swallow
#

@elder dune send ur code

tender shard
#

if it shows the "last" armor, it sounds like they're using getOldArmorPiece() instead of getNewArmorPiece()

sullen belfry
#

@tender shard i've dmed you the code

remote swallow
sullen belfry
tender shard
#

please just send it here

remote swallow
sullen belfry
tender shard
#

I don't understand the purpose of that code. Why re you adding maxHealth when people unqeuip stuff?

Also why are you looping over the normal equipment slots? You should only care about getNewArmorPiece() and getOldArmorPiece()

#

if newArmorPiece is your item, add to max health.
if newArmorPiece is null and oldArmorPiece is your item, substract from maxHealth

sullen belfry
sullen belfry
tender shard
#
on ArmorEquipEvent
  if newArmorPiece is MyObject
    maxHealth = maxHealth + extraConfigHealth

  if oldArmorPiece is MyObject
    maxHealth = maxHealth - extraConfigHealth
sullen belfry
#

just wanted to know why the event won't fire when i apply the armor first time but it will register when i apply the second armor

tender shard
#

show your whole event listener code

sullen belfry
#

here is a demo of the issue

tender shard
#

Well your code only runs if they already have any armor equipped - so ofc it wonโ€™t run if they equip the first item

sullen belfry
#

to make things more clear

tender shard
#

Line 6 in your paste is the issue

young knoll
#

Canโ€™t ya just apply a max health attribute to the item

tender shard
#

Tldr the event does fire for the first item, youโ€˜re just not doing anything in the event.

The event is called BEFORE the armor is equipped (as itโ€˜s cancellable). Simply check getNewArmorPiece instead of looping over already equipped armor

sullen belfry
young knoll
#

I mean like I said

#

When you apply the enchantment also apply an attribute

#

Then the game will handle the rest

sullen belfry
sullen belfry
tender shard
#

for example

    void onEquip(ArmorEquipEvent event) {
        if(isMyCustomItem(event.getNewArmorPiece())) {
            // My custom item was equipped - raise max health
            event.getPlayer().setMaxHealth(event.getPlayer().getMaxHealth() + 10); // Should use attributes instead btw
        }
        
// Do not use else if, because a player could exchange your custom item with another custom item, so we add/remove max health separately
        if(isMyCustomItem(event.getOldArmorPiece())) {
            // My custom item was unequpped - lower max health
            event.getPlayer().setMaxHealth(event.getPlayer().getMaxHealth() - 10);
        }
    }
    
    boolean isMyCustomItem(ItemSTack item) {
        if(item == null) return false;
        // Check if item is my custom item
        if(...) return true;
        return false;
    }

I don't know why you're checkig the already existing items. Also you're completely ignoring the result of getNewArmorPiece(), which is the only thing you'd care about

#

also you can easily check that the event fires correctly, even on first time

    void onEquip(ArmorEquipEvent event) {
      Bukkit.getLogger().info("ArmorEquipEvent called");
    }
sacred cedar
#

Hey,

I am currently working on a custom item system. And i had to rework some of the code due to the 1.21 update and now i run into the issue where i get the item correctly and in survival everything seems to works fine but when i am in creative and open my inventory or interact in any way with the item ALL attributes i coded on the item are just gone out of nowhere.

My attribute code:

@Override
default HashMap<Class<?>,InitUpdateMethod> getInitUpdateMethods() {
    HashMap<Class<?>,InitUpdateMethod> initUpdateMethods = ClickHitDamageItem.super.getInitUpdateMethods();
    initUpdateMethods.put(HitWeaponItem.class, itemStack -> {
        itemStack.editMeta(meta -> {
            meta.addAttributeModifier(
                    Attribute.GENERIC_ATTACK_DAMAGE,
                    new AttributeModifier(
                            new NamespacedKey(CatalyaRPG.getInstance(), "catalya_attribute_attack_damage"),
                            damage(),
                            AttributeModifier.Operation.ADD_NUMBER,
                            EquipmentSlotGroup.HAND
                    )
            );
        });
        return itemStack;
    });
    return initUpdateMethods;
}

This is btw not every attribute i am adding discord didnt let me send the whole thing bit its basically the same for every attribute.

worthy yarrow
sacred cedar
#

it just wipes the attribute data

#

when i open the inventory or interact with it

#

and that only inside creative mode
in survival it seems fine
thats why i am so confused

worthy yarrow
#

I assume it's the same issue being creative is just buggy

sacred cedar
#

BTW with normal weapons from the creative inventory this doesn't happen

worthy yarrow
#

There probably is, best way I can think of is just disallowing any sort of manipulation when it comes to your item(s) in creative mode

#

Creative really likes to mess with things not so vanilla

sacred cedar
worthy yarrow
#

All I know is that creative likes to fck with anything inventory/itemstack related

worthy yarrow
sacred cedar
sacred cedar
worthy yarrow
#

Staff need your items for what reason though?

sacred cedar
#

i am basically creating a whole new item system

worthy yarrow
#

Just make it known that creative will fck their items up or as I said just dont even allow them to touch in creative I suppose

#

I feel like there would be an actual workaround, I'm just unaware of it

devout otter
#

is there any good nick plugin that supports 1.8 or higher?

sacred cedar
devout otter
sacred cedar
devout otter
#

essentials doesnt work and ive been looking for one for years

sacred cedar
worthy yarrow
worthy yarrow
sacred cedar
#

i will try that

#

thanks

worthy yarrow
#

No worries! Good luck finding an answer to that haha I never could

devout otter
worthy yarrow
#

I mean I'd suggest that

#

You get the bonus of being able to build it whatever way you like with whatever features you want

#

Only issue being: diy I suppose

wet breach
# sacred cedar so there is no fix for that?

When the player switches to creative there is an event for when their gamemode switches, you can save their survival inventory or cache it and then clear it. When they switch back put their items back. Should preserve all the item related things you are having issues with.

worthy yarrow
#

Ah thats good

#

Didn't know that was an event

sacred cedar
wet breach
devout otter
#

it may be

#

essentials interfering with the nick plugins i use

#

but i have essentials nick disabled in config

devout otter
#

doesnt change nametag

wet breach
#

Right, i think libdisguises messes with nametags.

#

Well does more then that as well lol

#

But i think it might accomplish what you are wanting.

devout otter
#

i think its 1.12 up

wet breach
#

As for making a plugin you would need to mess with packets for that if i remember right

devout otter
#

yeah

worthy yarrow
#

display entities?

#

Idk if that would just interfere

#

With the original nametag

wet breach
devout otter
#

i was thinking about that

worthy yarrow
#

Text display i meant

#

Make it a bit easier than that

devout otter
#

thats what some servers do

worthy yarrow
#

I mean

#

Can you mount text displays to a player?

wet breach
#

Since they are entities yes

worthy yarrow
#

Ah right

#

That'd be quite easy then

devout otter
#

im working on a kitpvp server

wet breach
#

You can use scoreboard to make nametags invisible

#

So with the text entity option no need for messing with packets and it would be more versatile

worthy yarrow
devout otter
#

cause

#

i messed around with so many plugins

#

for the past 6 hours

#

and literally none change my name

wet breach
#

It doesnt need to be good. Just needs to work. Later on you can have someone else fix it lol

worthy yarrow
#

I'm just trying to encourage you to code haha

wet breach
# devout otter for the past 6 hours

This is normal with running a server. But if you are low budget and dont want to be stuck with what is available you are going to have to learn to make your own stuff

#

Good news it only takes like 3 months to become somewhat good with java

#

You wont be the best, but you will be able to make stuff regardless

worthy yarrow
#

I'd say that's true if you commit to java and java only for that three months, if you try to split focus ie: start on a whole new api before learning the language, that will just make your habits bad as well as not learning as much as you should

devout otter
#

how would i view my own nametag accurately

#

because im on lunar client rn and it says my name is still the same

#

and i got no one to join me

novel parrot
#

Is there a FallingBlockLandEventโ€ฆ that Iโ€™m not seeing?

novel parrot
#

Seems that EntityChangeBlockEvent is my answer.

exotic obsidian
#

guys i have a question

#

if i want to create a golden head and i want the head color gold, how i can do that?

grim hound
#

the reflection is just normal Bukkit.setOwnerProfile

exotic obsidian
grim hound
river yew
#

ItemStack customHead = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) customHead.getItemMeta();
skullMeta.setOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTA1YTJjYWI4YjY4ZWE1N2UzYWY5OTJhMzZlNDdjOGZmOWFhODdjYzg3NzYyODE5NjZmOGMzY2YzMWEzOCJ9fX0=");

customHead.setItemMeta(skullMeta);

how i can make custom texture to the player head, this dont work, help

grim hound
#

Or if you wanna support multiversion, check out the full SkullSupplier class there

river yew
#

ok

exotic obsidian
# grim hound

i need to install the plugin first then use this value?

grim hound
exotic obsidian
#

but im using 1.8

#

i don't think ur code will work with me

river yew
#

` ItemStack customHead = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) customHead.getItemMeta();
skullMeta.setOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGFiZDcwM2U1YjhjODhkNGIxZmNmYTk0YTkzNmEwZDZhNGY2YWJhNDQ1Njk2NjNkMzM5MWQ0ODgzMjIzYzUifX19=");

customHead.setItemMeta(skullMeta);`

are this code work? not the texture, are the code has error, because this on 1.20.5+

grim hound
#

Then use the reflection version

exotic obsidian
#

public ItemStack createSkull() {
ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();

    GameProfile profile = new GameProfile(UUID.randomUUID(), "none");
    profile.getProperties().put("textures", new Property("textures", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGFiZDcwM2U1YjhjODhkNGIxZmNmYTk0YTkzNmEwZDZhNGY2YWJhNDQ1Njk2NjNkMzM5MWQ0ODgzMjIzYzUifX19"));

    try {
        Field profileField = headMeta.getClass().getDeclaredField("profile");
        profileField.setAccessible(true);
        profileField.set(headMeta, profile);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    head.setItemMeta(headMeta);
    return head;
}

like this right?
@grim hound

grim hound
#

Ye

exotic obsidian
#

tysm

#

that was really helpful โค๏ธ

novel parrot
#

Iโ€™m trying to find an event that fires when a falling block landsโ€ฆ I thought EntityChangeBlockEvent would do it but it appears not toโ€ฆ any pointers here?

blazing ocean
#

is it possible to spawn structures asynchronously

#

like with the structure manager

grim hound
shadow night
grim hound
blazing ocean
#

running a custom fork anyway

shadow night
#

lol

grim hound
#

Or spigot fork

blazing ocean
#

nop

shadow night
#

This makes me wanna ?whereami so hard

blazing ocean
#

spigot/paper fork

blazing ocean
grim hound
blazing ocean
#

he always is

shadow night
grim hound
#

Oh wait

shadow night
blazing ocean
blazing ocean
grim hound
#

Anyway, Minestom is op

#

Their source is just so damn well-written

#

Like I'm obssesed on optimization

#

And I have (almost) nothing on them

#

Very impressively written

blazing ocean
grim hound
#

Any modifications become no problem

#

Java's src as well

novel parrot
#

I think I found it nowโ€ฆ EntityRemoveEvent

novel parrot
#

Yes

#

Also just tested EntityRemoveEvent and got my debug message

#

So I think Iโ€™m good to go, for my purposes anyway

blazing ocean
crude furnace
#

wsg

novel parrot
#

Hmmโ€ฆ this isnโ€™t quite getting to what Iโ€™d hoped. EntityRemoveEvent letโ€™s me know that the falling block has landed, but what Iโ€™d actually like is to know when a block is created by a falling block landing. Seems I could pull this info from the event but if thereโ€™s an event similar to BlockPlaceEvent which fires when the falling block turns from an entity into a block that would be more what Iโ€™m looking for.

#

Please tag me if anyone has an answer, calling it a night and by morning I assume this will be a bit buried. Thanks!

golden tulip
#

How can I open the Blockinventory from a Stonecutter?

vast ledge
#

If you have the block, you should be able to do smth like #getInventory If I'm not mistaken

pseudo hazel
#

does a stonecutter even have storage?

#

or do you just mean the menu

green prism
#

Is it possible to use JavaPlugin#saveResource to save a whole folder?

quiet ice
#

Well probably yes, but for that you'd need to know the contents of the folder - so it's not a single saveResource call I reckon

quiet ice
undone axleBOT
green prism
#

Do I have to statically name all files inside my resource folder?

quiet ice
#

Yeah, safeResource can only store a single file.
You could use the protection domain to query the contents of the jar and work yourself backwards from it - but that's a bit overkill and there exist simpler solutions I am not exactly knowledgeable about so I can only present the overkill one.

#

Doing it statically isn't the approach I'd go with though, even if it is rather easy to pull off

green prism
#

way

quiet ice
quiet ice
green prism
# quiet ice Well I reckon you can use `MyPlugin.class.getResourceAsStream("directory/")` to ...

I'm looking at Oraxen (Open-Source), which did the same thing
Well... they're using hardcoded names too haha

    public ConfigsManager(JavaPlugin plugin) {
        this.plugin = plugin;
        defaultMechanics = extractDefault("mechanics.yml");
        defaultSettings = extractDefault("settings.yml");
        defaultFont = extractDefault("font.yml");
        defaultSound = extractDefault("sound.yml");
        defaultLanguage = extractDefault("languages/english.yml");
        defaultHud = extractDefault("hud.yml");
    }```

https://github.com/oraxen/oraxen/blob/master/core/src/main/java/io/th0rgal/oraxen/config/ConfigsManager.java
quiet ice
#

Well I mean, I was completely expecting that you wanted to extract a directory with hundreds of files within it

quiet ice
#

yeah then there is 0 reason to over-engineer that. All solutions for extracting a directory will be larger than solutions for extracting 5 files

green prism
#

haha, thank you so much for your help ๐Ÿ™‚

green prism
quiet ice
#

I believe that was an in general

twin venture
tardy delta
#

preparedstatement::setblob

twin venture
#

can i just use mongodb for example?

tardy delta
#

IM NOT THE ONE WHO CAME UP WITH IT