#help-development

1 messages Β· Page 483 of 1

regal scaffold
#

It's really not

remote swallow
#

its like 2mb

regal scaffold
#

I thought that too at the start

#

Don't shade it

#

Just add it to the library in plugin.yml

remote swallow
#

my plugin with it is 650kb, witout its 150

#

if you want 1.17 support you have to shade

river oracle
regal scaffold
#

Yup

river oracle
#

I thought it was on its on repo

regal scaffold
#

Nope

#

Central

remote swallow
#

thats only snapshots

regal scaffold
#

java.lang.NoClassDefFoundError: net/minecraft/network/syncher/SynchedEntityData

#

Help me out

#

Why

remote swallow
#

i dont see chocos bungee api branch on his bukkit repo

regal scaffold
#

Yes, it is remapped

dire marsh
river oracle
remote swallow
#

adventure dies if you use the libraries feature on 1.17

dire marsh
#

bruh

regal scaffold
#

Any ideas?

river oracle
regal scaffold
#

Where are the nms tryhards so I can tag

remote swallow
#

that appears to not really help

young knoll
#

How does that not help

regal scaffold
#

It's not included yet

#

Doesn't matter

remote swallow
#

more stuffi have to read

regal scaffold
#

And he said he stopped working on it anyways

young knoll
#

Ikr

#

If he doesn't do it I will smh

remote swallow
#

do it r

#

rn

young knoll
#

(Except idk how to modify spigot patches :lul:)

remote swallow
#

same way for cb

young knoll
#

To make new ones yes

river oracle
regal scaffold
#

Instead of making a pr

#

I just did it for myself

#

Faster

remote swallow
#

wouldnt this like add json to the item

young knoll
#

Yes NMS is much faster

regal scaffold
#

I'm pretty sure

young knoll
#

But it is not future proof and does not help anyone else

regal scaffold
#

You cant have clickable lore

#

Just letting you know ebic

young knoll
#

Correct

remote swallow
#

i just need keybinds

regal scaffold
#

Neither

remote swallow
#

all i want

regal scaffold
#

You cant

#

Limitation

remote swallow
#

fuck

regal scaffold
#

I'm 99% sure

#

Same thing as holograms

#

I added support for all components

#

But hover, click from the component directly doesn't work

remote swallow
#

keybind is client side so i would guess it works

regal scaffold
#

Detect keybinds and check if it's the right item

#

gl

remote swallow
#

i only need to show the keybind

regal scaffold
#

Not even sure how

#

Wait

river oracle
#

the component already does that for you so its not a huge deal

regal scaffold
#

You just want to show?

#

Not have an action

remote swallow
#

yeah

regal scaffold
#

...........

remote swallow
#

just show the string value

young knoll
#

Text, Translatable, and Keybind components should all work

regal scaffold
#

That's not the same as you said

#

Then yes

#

It works

#

n m s

remote swallow
#

i need to run buildtools now

young knoll
#

L

river oracle
#

L

dire marsh
#

L

river oracle
#

use my BuildTools python script that does the exact same thing as BuildTools atm lol

remote swallow
#

i made my own bat

river oracle
#

because I cbf to add the other stuff I wanted

remote swallow
#

aks me for versions and remapped then just runs

regal scaffold
#

@tender shard

remote swallow
#

hes prob asleep by now

regal scaffold
#

java.lang.NoClassDefFoundError: net/minecraft/network/syncher/SynchedEntityData

SynchedEntityData dataWatcher = new SynchedEntityData(null);
#

Hate having to figure this out

river oracle
remote swallow
#

gitgood?

river oracle
#

reminds me I need to update this

regal scaffold
#

It's not

#

It's remapped

dire marsh
#

that's a mojang name though

regal scaffold
#

I'm using nms in about 100 more things

#

In the same plugin

#
spigotRemap {
    spigotVersion.set("1.19.3")
    sourceJarTask.set(tasks.shadowJar) // or `tasks.shadowJar` if you use Shadow plugin.
}
stiff knot
#

Hey does anyone know how to use bold text in the tablist? I'm using this right now and it works with colour codes but not bold text for some reason :/

remote swallow
#

use getStringList instead of casting

dire marsh
#

well the error says it's trying to find the mojang class

regal scaffold
#

What can I do to debug then

dire marsh
#

maybe the remapping for that is bugged

#

in which case kekw

remote swallow
#

clean, then rebuild

regal scaffold
#

19.3

#

I know it's there

#

I checked too

#

Wanted to make sure I wasn't losing my mind

stiff knot
kind hatch
#

What's your string look like? Because formatting should come after the color.

stiff knot
#

ah actually thats probably it

#

lemme switch it around it a bit 1s

quaint mantle
#

Anyone know why this isn't working?

 @EventHandler
    public void entityDamageByEntity(EntityDamageByEntityEvent event) {
        Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Fired");
        
        if (event.getDamager() instanceof Player) {
            Player player = (Player) event.getDamager();
            Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Is player");
            
            if (player.getInventory().getItemInMainHand().containsEnchantment(CustomEnchants.WITHER)) {
                Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Has Wither");
                
                LivingEntity entity = (LivingEntity) event.getEntity();
                entity.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 40, 1));
                Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "added");
            }
        }
    }

the print statements indicate its stopping at the conditional that checks if it has the Wither enchantment yet it definitely has the enchantment and ive done this before for a Telepathy custom enchantment and it worked that line worked

regal scaffold
#

Why

#

Do I need to remap

#

Lets say it's wrong. And it's not remapping correctly

young knoll
#

Why do you need to remap?

#

Because the server runs obfuscated

regal scaffold
#

Oh ok I thought so

#

But why would some classes work

#

And some not

dire marsh
#

although you can get mojang mapped server jars

stiff knot
#

I translated the colours before formatting, still not working :/

kind hatch
stiff knot
#

yeah

#

the colours show fine

#

but the bold text doesn't

#

it's really weird

kind hatch
#

What's the config look like?

stiff knot
#

oh

#

i just saw it

#

nvm ignore me i had a zero brain moment

kind hatch
#

Yea, color ---> formatting. &b&l

stiff knot
#

i cannot believe i missed that

#

yeah its working now

tardy delta
#

please use some proper dependency injection instead of classloader magic

river oracle
sterile token
river oracle
#

yes

young knoll
#

On a string it is

river oracle
#

otherwise use String#replace

sterile token
#

yeah

stiff knot
#

i have no idea man

#

i wrote it as something else originally

#

and intellij was just like "do this instead" so i just kinda did

tardy delta
#

have some utility method lol

#

@storm valeno

#

bruh goofy discord tags

sterile token
#

Oh made it by some sort of IA because it seems/look a copilot autocompletation

stiff knot
#

yeah

#

honestly it works fine as it is

sterile token
#

Yeah remember IA can help to build logic, but not always is the best πŸ‘πŸΌ

tardy delta
#

what ia?

sterile token
regal scaffold
#

Ok I'm switchging from gradle to mavne

#

Fk gradle

#

It's ass

stiff knot
#

realistically it isn't gonna be a huge hit to the overall performance of my plugin

#

i see no reason to overcomplicate it

tardy delta
#

i believe you mean ai then

sterile token
#

IA πŸ€”

#

Its the same bro

kind hatch
#

Tf if it is.

#

Artificial Intelligence

tardy delta
#

in french maybe

quiet ice
#

Yeah the french like to mix stuff up

sterile token
#

IA = AI

#

Are the same

quiet ice
#

So while for everyone it is EU, for the french it is the UE.
Same with NATO (OTAN) and many more abbreviations

kind hatch
lost matrix
#

Intelligent Artificallity

sterile token
lost matrix
#

XDDD

sterile token
#

Arent the same

#

🀣

lost matrix
#

Verano at it again

quiet ice
#

You see we speak english here

sterile token
#

i mispelled on english, but are the same thing

kind hatch
#

I swear to god he is nothing but a troll.

quiet ice
#

So we abide by english grammar

wise mesa
#

is it possible to make a world that doesn't get saved to disk

quiet ice
wise mesa
#

ie would reset on server restart

quiet ice
#

And perhaps a neglect of the english language

wise mesa
#

without deleting it on server restart

#

not a big deal if it isn't possible

quiet ice
#

Can't you disable autosaving?

#

But not sure if that works when shutting down the server

sterile token
quiet ice
#

I thought it was on a per-world basis

kind hatch
quiet ice
#

But could be a paper thing again

sterile token
#

whereiam?

remote swallow
#

just before i go and have a few breakdowns while adding base components to lore, has anyone done it b4 and still got the code or know of something that can add base component arrays to lore

quiet ice
#

At worst just use a custom world managers - that ought to do the trick

wise mesa
#

okay not a big deal

#

will probably just clear the areas i don't need

quiet ice
#

?jd-s but let's see

undone axleBOT
remote swallow
#

choco has a pr open for it atm

#

on spigot

sterile token
#

Yeah but for recommendations if you will code public plugins for spigot site, You wont be able to publish them if they use paper api

remote swallow
#

i just need to mimic it without spigot access

quaint mantle
#

So I've been looking for ways to disable enemy ai online for one of my custom enchants and found: /entitydata @e {NoAI:1} pretty sure that's just a NBT tag but how would I set an NBT tag in code like that?

quiet ice
#

Yeah then NMS or bust

#

That being said you might look into the paper impl

remote swallow
#

ive already reached the point where ive gotta use nms

remote swallow
#

oh hi md

#

how are you

quaint mantle
kind hatch
#

Yea, stupid easy.

lost matrix
# wise mesa without deleting it on server restart

I dont think there is an easy way to achieve this. There is some API which looks like it should
prevent saving chunks but i had limited success with those in the past. Safest way would be
to simply delete and restore the regions folder.

regal scaffold
#

How to include a maven dependency from a repo with credentials

#

Oh I remember

#

.m2/settings

quiet ice
#

maven or gradle?

regal scaffold
#

maven, I'm getting away from gradle

#

It's terrible

#

cba

quiet ice
#

It's actually good if you can spend enough time with it

quaint mantle
quiet ice
#

Maven on the other hand doesn't improve by much if you spend more time with it

quaint mantle
#

just tried this and uh they're kind of disabled perm now lmao

LivingEntity entity = (LivingEntity) event.getEntity();
entity.setAI(false);
wait(3000);
entity.setAI(true);
#

Pretty sure wait is ms

#

I changed wait to Thread.sleep and it froze the game for the entire 3 seconds lmao

eternal oxide
#

you can't wait nor sleep the main thread

quiet ice
#

unless you want this shit to happen

regal scaffold
#

Is it possible to use those libs with maven?

tardy delta
#

mmh

regal scaffold
#

With gradle I was

quaint mantle
regal scaffold
#

Which is what I mean

quiet ice
regal scaffold
#

What does setting up correctly mean

undone axleBOT
regal scaffold
#

Like lets say I want to incluide those in the bundle for github

quiet ice
#

The lazy approach would be to make use of a file://-repository

#

The correct one would be to use the proper maven repos

regal scaffold
#

There is no proper maven repo

#

For massivecore

#

And I don't feel like compiling myself

tardy delta
#

do they have a github?

kind hatch
#

You can use the systemPath variable

tardy delta
#

do it with jitpack then

wet breach
regal scaffold
#

How would I do it geols way thn

quiet ice
#

So

    <repositories>
        <repository>
            <url>file://${project.basedir}/deps</url>
            <id>local-potemkin-repository</id>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>empty</groupId>
            <artifactId>modlauncher</artifactId>
            <version>999.0.0</version>
        </dependency>
    </dependencies>
regal scaffold
#

there it is

#

Sick!

quiet ice
#

The layout within your deps folder would then looks somewhat like that:

.
└── empty  // {group}
    β”œβ”€β”€ log4j // {artifact}
    β”‚   └── 999.0.0 // {version}
    β”‚       β”œβ”€β”€ log4j-999.0.0.jar  // {artifact}-{version}.{type}
    β”‚       └── log4j-999.0.0.pom
    └── modlauncher
        └── 999.0.0
            β”œβ”€β”€ modlauncher-999.0.0.jar
            └── modlauncher-999.0.0.pom

the .pom files are not required per-se but can be useful from time to time

wet breach
#

well file repo isn't the only way, you could set the depedency as a system dependency instead

quiet ice
#

Won't work in maven 4X

#

The system scope is deprecated for removal

wet breach
#

doubt many will upgrade then

#

shame even maven is in the habit of removing actual useful features

quiet ice
#

That is something you might have thought when they removed http://-repos, but here everyone is using a version of maven that doesn't support http:// by default

eternal oxide
#

just install to maven local

wet breach
#

they didn't remove http repos

quiet ice
#

They block them by default now

#

There is a mirrior that targets all http repos

wet breach
#

just go into your settings and change it if you really want it

#

maven isn't stopping πŸ™‚

quiet ice
#

Yeah should have made that "by default" thing a bit more clear

sullen marlin
#

https works fine

quiet ice
#

Yeah https works and will continue to work

edgy crystal
#
        VehicleData vehicleData = vehicleDataMap.get(minecart.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
        double maxSpeed = vehicleData.getMaxspeed();
        double acceleration = vehicleData.getAcceleration();
        double[] currentSpeed = {0};
        new BukkitRunnable() {
            @Override
            public void run() {
                if (player.isInsideVehicle()) {
                    minecart.setVelocity(
                            player.getFacing().getDirection().setY(0).multiply(currentSpeed[0] + minecart.getVelocity().length() * 2));
                    System.out.println(currentSpeed[0]);
                    System.out.println(minecart.getVelocity().length());
                    currentSpeed[0] += acceleration;
                } else {
                    this.cancel();
                }
            }
        }.runTaskTimer(Main.getInstance(), 0, 5);
    }````

yoo, i am searching about 2 hours for the problem.
the code i want should do this: every 0.25sec the currentSpeed gets applied to the minecart and the currentspeed += acceleration

but ingame th evehicle only moves at ~1 speed
eternal oxide
#

what do your sysouts show?

edgy crystal
#

[23:55:17] [Server thread/INFO]: 0.0
[23:55:17] [Server thread/INFO]: 0.0
[23:55:17] [Server thread/INFO]: 1.0
[23:55:17] [Server thread/INFO]: 1.0
[23:55:17] [Server thread/INFO]: 2.0
[23:55:17] [Server thread/INFO]: 2.025
[23:55:18] [Server thread/INFO]: 3.0
[23:55:18] [Server thread/INFO]: 3.025
[23:55:18] [Server thread/INFO]: 4.0
[23:55:18] [Server thread/INFO]: 4.025
[23:55:18] [Server thread/INFO]: 5.0
[23:55:18] [Server thread/INFO]: 5.025
[23:55:18] [Server thread/INFO]: 6.0
[23:55:18] [Server thread/INFO]: 6.025
[23:55:19] [Server thread/INFO]: 7.0
[23:55:19] [Server thread/INFO]: 7.025
[23:55:19] [Server thread/INFO]: 8.0
[23:55:19] [Server thread/INFO]: 8.025
[23:55:19] [Server thread/INFO]: 9.0
[23:55:19] [Server thread/INFO]: 9.025

eternal oxide
#

shows speed is increasing

edgy crystal
#

yes but why isnt that applied to my vehicle?

young knoll
#

I'm pretty sure minecarts have a speed cap

eternal oxide
#

[23:55:19] [Server thread/INFO]: 9.025 says it is, thats the velocity length

eternal oxide
#

then you are being limited as Coll said

#

the minecart velocity is reporting as you expect

edgy crystal
#

maxspeed is 120

quaint mantle
eternal oxide
#

ticks

quaint mantle
#

Ight ty

young knoll
#

According to the wiki the max speed is 8 blocks/s per axis

orchid trout
#

how do people do those command manager things where you use annotations to make the description, permissions and stuff

young knoll
#

They probably just grab acf or whatever and use that

orchid trout
#

what is afcf

young knoll
#

Annotation command framework

quiet ice
#

I thought it was Aikar's command framework

young knoll
#

Not according to the GitHub

quiet ice
#

Ah huh

bold vessel
#

Did the armor protection or sword damage change between recent version ?

quiet ice
bold vessel
#

Cuz i take like 0 damage on my server in 1.19.4

young knoll
#

Nope

worldly ingot
#

Make sure you have an up to date version of ProtocolLib

#

There was a bug at one point that prevented damage from being inflicted

#

Or maybe it was ViaVersion

#

One of those two lol

bold vessel
#

I dont use ViaVersion but im gonna take a look

young knoll
#

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

regal scaffold
#

'void' type not allowed here

#

When I try to compile with maven

#
                actives.addAll(super.activateOne(object));
#

I'm having more issues even getting it to compile with maven

#

Wasn't getting these before on gradle at all

quiet ice
remote swallow
#

?paste the error

undone axleBOT
frigid scaffold
#

do anyone know how to make a restart-script spigot.yml for linux i use tumx

granite owl
frigid scaffold
#

yes like /restart

granite owl
#

yes

#

make a manager in c++

#

🀣

frigid scaffold
granite owl
#

just ask urself

#

how

#

is a server supposed to completly stop its own process

#

and then restart

young knoll
#

/restart is literally a command

frigid scaffold
eternal oxide
#

spigot already has restart

young knoll
#

Although usually it’s better to just have a loop in your startup script

granite owl
#

then i clearly dont know what he means

kind hatch
#

You have to setup the start script.

eternal oxide
#

just set your .sh script in correct spigot.yml to call it

remote swallow
#

you said your getting an error, we need that error

frigid scaffold
granite owl
#

do u use maven

remote swallow
#

?paste the full error

undone axleBOT
eternal oxide
#

I use windows so mine is in spigot.yml restart-script: Start.bat

remote swallow
#

that doesnt help us at all

eternal oxide
#

that just calls your start.bat script you would normally start your server with

frigid scaffold
#

im not windows

eternal oxide
#

whatever command you use to start your server

remote swallow
#

where is the plugin.yml in intellij or whatever ide you use

#

and do you use maven/gradle

eternal oxide
#

put it in a .sh file in your server root, set it executable perms

#

add it in your spigot.yml as I showed you

frigid scaffold
#

i use tmux and it dont work

eternal oxide
#

no idea what tmux is

remote swallow
#

another varient of screen

eternal oxide
#

ah

remote swallow
#

kk, iirc if you dont use maven/gradle the files to include in teh jar should go in /src/

eternal oxide
#

you must know where you MC server is

frigid scaffold
#

/home/opc/

eternal oxide
remote swallow
#

that looks like its in src/me

#

not src/

frigid scaffold
eternal oxide
#

thats just the sample. sh file

young knoll
#

I think MD recommended a loop in start.sh instead of using the restart feature

frigid scaffold
#

ye know what

young knoll
#

Or maybe it was someone else

eternal oxide
#

it works fine

#

?paste

undone axleBOT
remote swallow
#

ah, no idea then. Check intellij is adding those files on compile

eternal oxide
somber night
#

i have a few questions

  1. is there any way i can sort this into different files?
  2. i cant manage to fix bugs such a:s custom items getting consumed in bulks of 5 instead of one, the items being usable on vanilla recipes, "meth" item not usable
    https://paste.md-5.net/axahoxaran.cs
    if you can help i'd gladly appreciate it
    (asking again because i dont think anyone answered)
young knoll
#

Hmm copying plugin jars in the startup script

#

Smart

frigid scaffold
eternal oxide
#

did you edit your spigot.yml?

frigid scaffold
#

yes

eternal oxide
#

?paste your spigot.yml

undone axleBOT
frigid scaffold
eternal oxide
#

change restart-script: /home/opc/start.sh to just restart-script: start.sh

#

probably

remote swallow
#

isnt opc the root users

kind hatch
#

Yea, the restart script should be in the same folder as the server jar.

remote swallow
#

or similar

kind hatch
#

root is the only true root account.

#

Everything other group needs permission or to be part of the su groups.

#

You're plugin.yml isn't in your compiled jar.

frigid scaffold
#

it works now but idk where the consle is

kind hatch
#

The console should be in the same location as the server directory

frigid scaffold
#

i use tmux

kind hatch
#

I don't know what that is.

remote swallow
frigid scaffold
remote swallow
#

check in the intellij build system the plugin.yml is set to be added to the compiled jar

kind hatch
#

Probably because you forgot to include it. How are you compiling your jar? Maven? Gradle? Manually?

kind hatch
#

What does your artifact look like?

#

Well that explains it. You have nothing in there.

#

How did you create the artifact?

#

Did you change anything on the popup window?

#

It should of done that for you automatically. Normally you'd see a folder called compile output from <projectName>

#

Or something similar

#

You only have the META-INF folder for some reason.

#

Try creating a new artifact and see if it includes the compile output. Same steps. Jar --> From modules with dependencies.

#

Send a screenshot of what it looks like

#

I meant of the page after that step. :p

#

That is weird.

#

Yea, if you don't have this in your artifact, it won't compile properly.

#

Although I'm not sure why it's not including it when you create the artifact.

regal scaffold
#

java.lang.NoClassDefFoundError: abq

#

I was able to remap

#

But still the same error

young knoll
#

Are you remapping for the wrong version or something

regal scaffold
#

No

#

1.19.3 just like server

kind hatch
#

Where?

#

Wdym?

regal scaffold
#

Yes

#

It's valid

#

It can't even file the class

#

Same as before

#

Just obfuscated name

eternal oxide
#

its real name in spigot is net.minecraft.network.syncher.DataWatcher

regal scaffold
#

I know

#

I've been having this error all day

#

Still not working

#

idk what to do

eternal oxide
#

if you are using the remapped jar you use DataWatcher

regal scaffold
#

I am using obf car

#

jar

eternal oxide
#

if you are obfuscated you use SynchedDataWatcher

regal scaffold
#

I'm coding with mojang-remapped

#

Then building as obf

kind hatch
#

So use DataWatcher

#

The special source plugin converts remapped code back to obfuscated code.

#

So if you are using the remapped jar, write remapped code.

regal scaffold
#

...

#

What

#

That makes no sense

kind hatch
#

How hard is this to understand?

eternal oxide
#

are you using specialsource?

regal scaffold
#

No

#

Gradle

eternal oxide
#

why not?

regal scaffold
#

Because I'm using gradle

eternal oxide
#

then paperweight?

regal scaffold
#

Yes

#

Listen

#

I have 100 other things

#

Using nms

eternal oxide
#

can't help you on Gradle

regal scaffold
#

Working perfectly

#

It's literally just this SynchedEntityData dataWatcher = new SynchedEntityData(null);

#

It

kind hatch
#

Do those other 100 things use the mappings?

regal scaffold
#

It's not a build problem

frigid scaffold
#

got it to work with tmux

#!/bin/bash
tmux new-session -d -s my_session 'java -Xmx19168M -Xms19168M -jar paper.jar --nogui'```
edgy crystal
#
    public void onVehicleMove(VehicleMoveEvent event) {
        if (event.getVehicle().getType().equals(EntityType.MINECART)) {
            Vehicle vehicle = event.getVehicle();
            if (event.getVehicle().getPassengers().get(0) != null) {
                Player player = (Player) event.getVehicle().getPassengers().get(0);
                VehicleData vehicleData = vehicleDataMap.get(vehicle.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
                double acceleration = Math.abs(vehicleData.getAcceleration()); // Beschleunigung auf positiven Wert setzen
                System.out.println(acceleration);
                Objects.requireNonNull(player.getVehicle()).setVelocity(player.getLocation().getDirection().setY(0).multiply(2 * vehicle.getVelocity().length() + acceleration));
            }
        }
    }```

trying to fix this. i want that every time a vehicle is moving, the speed multiplies 2x, but i doesnt work.
brave sparrow
#

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

edgy crystal
#

sorry, the vehicle is moving but only at 2.0 speed

#

but it does not multiply

regal scaffold
#

They're all using mojang mappings

#

@kind hatch

brave sparrow
kind hatch
brave sparrow
#

Also why are you doing requireNonNull there

edgy crystal
eternal oxide
regal scaffold
#

I understand

brave sparrow
regal scaffold
#

But it's not working for me with all the rest of my nms working correctly

eternal oxide
#

Your issues is clearly paperweight then

edgy crystal
eternal oxide
#

not a Spigot issue

brave sparrow
kind hatch
edgy crystal
# brave sparrow Add some debug too

my code now

    public void onVehicleMove(VehicleMoveEvent event) {
        if (event.getVehicle().getType().equals(EntityType.MINECART)) {
            Vehicle vehicle = event.getVehicle();
            if (event.getVehicle().getPassengers().get(0) != null) {
                Player player = (Player) event.getVehicle().getPassengers().get(0);
                VehicleData vehicleData = vehicleDataMap.get(vehicle.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
                double newAcc = vehicle.getVelocity().getZ() + vehicleData.getAcceleration();
                System.out.println(newAcc);
                player.getVehicle().setVelocity(player.getLocation().getDirection().setY(0).multiply(vehicle.getVelocity().length() * 2));
                System.out.println(vehicle.getVelocity().length() * 2);
            }
        }
    }````

problem: vehicle is getting slower

debug:
```[01:39:45] [Server thread/INFO]: 0.19072766091831947
[01:39:45] [Server thread/INFO]: 1.9523270238599832
[01:39:45] [Server thread/INFO]: 0.18968338312566352
[01:39:45] [Server thread/INFO]: 1.952588044364577
[01:39:45] [Server thread/INFO]: 0.1886448229940064
[01:39:45] [Server thread/INFO]: 1.952847635721898
[01:39:45] [Server thread/INFO]: 0.18761194921783966
[01:39:45] [Server thread/INFO]: 1.9531058057568564
[01:39:45] [Server thread/INFO]: 0.18658473066305967
[01:39:45] [Server thread/INFO]: 1.9533625622515192
[01:39:45] [Server thread/INFO]: 0.18556313636602914
[01:39:45] [Server thread/INFO]: 1.9536179129453441
[01:39:45] [Server thread/INFO]: 0.18454713553264387
[01:39:45] [Server thread/INFO]: 1.9538718655354144
[01:39:45] [Server thread/INFO]: 0.18353669753740448
[01:39:45] [Server thread/INFO]: 1.954124427676669
[01:39:45] [Server thread/INFO]: 0.18253179192249314
[01:39:45] [Server thread/INFO]: 1.954375606982135
[01:39:45] [Server thread/INFO]: 0.18153238839685568
[01:39:45] [Server thread/INFO]: 1.9546254110231565
[01:39:45] [Server thread/INFO]: 0.18053845683528832
[01:39:45] [Server thread/INFO]: 1.954873847329622
[01:39:45] [Server thread/INFO]: 0.17954996727752978
[01:39:45] [Server thread/INFO]: 1.9551209233901936
[01:39:45] [Server thread/INFO]: 0.17856688992735809
[01:39:45] [Server thread/INFO]: 1.9553666466525292
[01:39:45] [Server thread/INFO]: 0.1773116893057258
[01:39:45] [Server thread/INFO]: 1.9556803879787632
[01:39:45] [Server thread/INFO]: 0.17119942766743357
[01:39:45] [Server thread/INFO]: 1.9572081669167571
[01:39:45] [Server thread/INFO]: 0.1452359849995531
[01:39:45] [Server thread/INFO]: 1.9637004825869266
[01:39:45] [Server thread/INFO]: 0.12321005756961957
[01:39:45] [Server thread/INFO]: 1.9692371335872443
[01:39:45] [Server thread/INFO]: 0.014784886537881207
[01:39:45] [Server thread/INFO]: 1.996308536019995```
brave sparrow
eternal oxide
edgy crystal
#

and ingame its getting slower

eternal oxide
#

Direction is a unit vector so will always be 1

brave sparrow
edgy crystal
#

so what can i do?

eternal oxide
#

he's muliplying by 2

#

so sorry less than 0.5 it will decrase

#

he's multiplying 1 * (velocity * 2)

brave sparrow
#

How

#

for any non-negative number velocity * 2 is always bigger than velocity

#

It should not be slowing down in that context

eternal oxide
#

if velocity = 0.4...
direction(1) * (2 * 0.4 = 0.8) == 0.8

brave sparrow
#

Yes

edgy crystal
#

ahh

eternal oxide
#

ah yep my heads broken

brave sparrow
#

And 0.8 is faster than 0.4 lol

edgy crystal
#

i dont get it

#

my math cracks

eternal oxide
#

I had the 1 stuck in my head, 0.8 being less than

brave sparrow
#

@edgy crystal I suspect you’re speeding up but by such a small amount that you’re not noticing it

eternal oxide
#

Your sysout is printing newAcc not the actual velocity you are setting

edgy crystal
#

System.out.println(vehicle.getVelocity().length() * 2);

brave sparrow
#

Ish

brave sparrow
eternal oxide
#

first one is an odd calculation which is going down

#

second is the actual velocity which is going up

brave sparrow
#

Yes

eternal oxide
#

So the velocity IS increasing. just not by much each time

edgy crystal
#

alright,
so thank you, but i don't know what to write for an code haha

#

my math & english are not the best

brave sparrow
#

Try changing it from 2 * to like

#

4 * or something

#

And see what it looks like

eternal oxide
#

System.out.println(vehicle.getVelocity().length() * 2); is showing it getting faster

brave sparrow
#

^

#

You just need to increase the rate at which it’s speeding up

eternal oxide
#

Your actual acceleration is probably being slowed by MC resistance

brave sparrow
#

Minecarts are very slow, just doubling the speed isn’t going to be super noticeable

edgy crystal
#

alright, ill turn it up to 5

#

i have turned it up to 5, and if i push the veh, this prints:

[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.994602621367113
[01:54:14] [Server thread/INFO]: 5.001608672327551
[01:54:14] [Server thread/INFO]: 4.9100770044103434
[01:54:15] [Server thread/INFO]: 5.002437417160766
[01:54:15] [Server thread/INFO]: 4.1809649734668515```
eternal oxide
#

if you push the cart MC will be trying to set a constant velocity

edgy crystal
#

alright, so the velicity.length ~1, and only the multipliere (in this case 5) sets the speed

eternal oxide
#

no

#

a velocity is not a unit vector

#

if you are pushing the cart MC will be setting a speed

edgy crystal
#

okay

edgy crystal
eternal oxide
#

it sounds like you want to just override the minecart acceleration/deceleration.

edgy crystal
#

yes

eternal oxide
#

to always accellerate in the direction the player is facing?

edgy crystal
#

thats right

eternal oxide
#

then I'd suggest you track it yourself

#

ignore the velocity that MC reports to you

#

track the speed and apply it yoursef

edgy crystal
eternal oxide
#

so store a vector for your minecart which will be your speed

#

each tick you take that vector add a vector multiplied by the players direction

#

then apply that to the minecart and store it as your new vector

edgy crystal
#

hm alright

eternal oxide
#

kinda like player.getDirection().setY(0).normalize().multiply(0.5)

#

would be your acceleration vector

#

each tick

#

so you fetch whatever vector you set last time, add your acceleration vector, apply to the minecart and store the new vector for the next tick

edgy crystal
#

alright i'll give my best

quaint mantle
#

what is the egg for the pterodactyl panel?

twin venture
#

hi what's iam doing wrong?
i made a plugin that is 3 parts:

  • api Module
  • core Module
  • ROOT Module.
#

all repo and dependacies are added into core and api

wise mesa
#

does player#teleport cause a playermoveevent

twin venture
#

when ever i do maven reload :

eternal oxide
#

show the actual pom entry causing the error

young knoll
twin venture
#

i think i fixed it ..

#

final error πŸ™‚

#

Failed to delete \SkyPvP\core\target\maven-status\maven-compiler-plugin\compile\default-compile\createdFiles.lst

eternal oxide
#

you have two maven running?

twin venture
#

1?

eternal oxide
#

file busy would prevent deletion

#

restart ide

twin venture
#

got it working

hazy parrot
#

Just realised this is spigot server lol, how is it related

wise mesa
#

appreciate it

#

oh

grand plover
#

is there a plugin where i could do stuff like /enchant sharpness 50

wise mesa
#

@grand plover

#

oh i see you figured that out

torn oyster
#

would there be an easy way to make fog (if players have it enabled) act like a world border

#

and have it slowly shrink

grand plover
wise mesa
#

no

#

ask in the right channel please

grand plover
#

k my bad

young knoll
#

Sadly you can’t change the fog distance without a client mod

torn oyster
#

is there a way to get my game working with those special client mods

#

that do things like auto gg

young knoll
#

Auto gg is probably hardcoded to hypixel

torn oyster
#

oh

vocal cloud
#

Well, if you take auto gg apart you could figure out how it works to emulate it

paper trout
#

hey i'm making a plugin where the player is this little robot that you control
so that raises the question is it possible to implement tank controls with locked head rotation or is that like really hard?

wise mesa
#

what's the easiest way to use brigadier for server commands

young knoll
#

A command framework that supports it

#

Like acf

undone axleBOT
subtle folio
#

I don't know why.. but when I start my server I get errors that my config is null, but my config is initalized first in the on enable, https://paste.md-5.net/gotobinanu.java heres the error [02:44:19 ERROR]: Error occurred while enabling Tazpvp v1 (Is it up to date?) java.lang.ExceptionInInitializerError: null at world.ntdi.nrcore.utils.command.CommandCore.<init>(CommandCore.java:55) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.commands.EventCommandFunction.<init>(EventCommandFunction.java:51) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.Tazpvp.registerCommands(Tazpvp.java:181) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.Tazpvp.onEnable(Tazpvp.java:98) ~[Tazpvp.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.4.jar:git-Paper-515] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.4.jar:git-Paper-515] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:555) ~[paper-1.19.4.jar:git-Paper-515] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:466) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-515] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getString(String)" because "world.ntdi.nrcore.utils.config.ConfigUtils.CONFIG" is null at world.ntdi.nrcore.utils.config.ConfigUtils.<clinit>(ConfigUtils.java:17) ~[Tazpvp.jar:?] ... 16 more

dark arrow
#

how can i remove my dependence of ai , i am so addicted on generating the code by ai that i am loosing my ability to code 😭

river oracle
#

and use google instead

river oracle
dark arrow
river oracle
#

I only use ai for monotonous stuff like repeating similar code if need be

torn shuttle
#

she's a beaut

#

I'm a bit of an artist myself

#

my plan to make a tower defense plugin while simultaneously making a standalone tower defense game that mirror functionality is truly the stuff of madmen

reef forge
#

getting this error

#
    public void onPlayerDeath(PlayerDeathEvent e) {
        Player deadPlayer = e.getEntity();
        DeadPlayerUtil.createDeadPlayer(deadPlayer.getUniqueId(), deadPlayer);
        deadPlayer.sendMessage("YOUR UUID: "+ deadPlayer.getUniqueId());
        try {
            DeadPlayerUtil.saveDeadPlayers();
        } catch (IOException ex) {
            System.out.println("Failed To Save JSON File.");
            ex.printStackTrace();
        }

    }```
#

code

#

        DeadPlayer deadPlayer = new DeadPlayer(p.getUniqueId(), p, p.getDisplayName());
        deadplayers.add(deadPlayer);
        deadplayersuuid.add(deadPlayer.getUUID());

        return deadPlayer;
    }```
#

some more code

#

        Gson gson = new Gson();
        System.out.println(Hardcore.getPlugin().getDataFolder().getAbsolutePath());
        File file = new File(Hardcore.getPlugin().getDataFolder().getAbsolutePath() + "/deadplayers.json");
        file.getParentFile().mkdir();
        file.createNewFile();
        Writer writer = new FileWriter(file, false);
        gson.toJson(deadplayers, writer);
        writer.flush();
        writer.close();
        System.out.println("DeadPlayers Saved Successfully.");

    }```
#

more code

#

can anybody help me?

#

    private UUID id;
    private String playerName;
    private Player player;


    public DeadPlayer(UUID id, Player player, String playerName){
        this.id = player.getUniqueId();
        this.playerName = player.getDisplayName();
        this.player = player;
    }

    public UUID getUUID() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public String getPlayerName() {
        return playerName;
    }

    public void setPlayerName(String playerName) {
        this.playerName = playerName;
    }

    public Player getPlayer() {
        return player;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }
}```
quaint mantle
reef forge
quaint mantle
reef forge
hallow aurora
#

Hello, what is the differency for Chat on Spigot and Bungee? My plugin controlling the chat and don't action correctly.

Sorry my bad english X,,D

sullen marlin
#

Can you be more specific please

#

What is the issue

hallow aurora
#

Now thinking about it, could it be that the management of the players changes?

Oh and what I wanted to say above, what are the differences between spigot and bungee in chat? Since my chat plugin doesn't correctly do what I want.

sullen marlin
#

I don't understand what are you asking

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

river oracle
quaint mantle
wet breach
#

that shouldn't be too hard

#

but awesome you are making progress uwu

#

yeah always important to learn and understand concepts

#

even if you might not use it any time soon πŸ˜›

#

they come in handy when you have to make some new concept to handle problems πŸ˜„

#

you will figure it out eventually, just takes time so use what works now improve it when you can πŸ™‚

#

or maybe even sooner

#

who knows, you will figure out the more you dive and learn the inner workings of Java πŸ˜‰

#

w3 schools is good, but won't teach you beyond a certain point

#

once you hit that point, you will have to learn about the JVM πŸ™‚

#

unfortunately, there isn't very good reading materials in regards to learning about the JVM

sullen marlin
#

yes

dark arrow
#

how can i check if my nms packages are installed succesfully and get the names of all the functions and classes

pulsar flicker
#

just type out the package names? Should autocomplete them

dark arrow
#

i cant find any package named 'net.minecraft'

#

i just downloaded the build tools and changed the dependency spigot-org to spigot, where it could have went wrong 😦

dark arrow
#

once i change the groupid and artificat id i get error that is it not found

hallow aurora
#

permit me share github link?

dark arrow
#

i dont think there is any restriction on sharing code links

hallow aurora
#

GitHub: https://github.com/Majhrs16/ChatTranslator

My problem is, sourceLang and targetLang are inverted between each player, that is, for example: from player A who has Z=1, and player B who has X=2, when A sends a message, B receives X instead of Z.

This only happens when the plugin is used on a bungeecord

GitHub

Traduce tu chat de Minecraft automaticamente! Contribute to Majhrs16/ChatTranslator development by creating an account on GitHub.

misty ingot
#

it is pretty clearly specified on the plugin page that the plugin is not compatible with bungeecord

#

*also, thats not "a Github"

hallow aurora
misty ingot
#

wot

hallow aurora
hallow aurora
#

ok

#

but, this channel is for bungee :V

#

this description say textualy "Serious Spigot and BungeeCord programming/development help | Ask development-related questions here"

chrome beacon
#

Yes this is the right place

#

You missunderstood what Sleepy was trying to tell you

hallow aurora
#

I mean, that's why they make different accessories, since it's not the same base :o

#

oops xd

somber night
#

how can i make custom items unusable on vanilla recipes

hallow aurora
#

But, I would like the plugin to be on each server, not on the entire network.

somber night
#

how can i do that, ive been trying but cant get it to work

somber night
#

thanks

hallow aurora
#

which is it?

#

ohhh, thanks

wet breach
#

probably the easiest way, not necessarily required though

tender shard
#

Why ping

quaint mantle
#

how i add message to Player.kick(); ?

rotund ravine
#

?jd-s

undone axleBOT
eternal oxide
#

no its not

rotund ravine
#

He’s probably using Paper

eternal oxide
#

Stop using paper

quaint mantle
#

what

#

oh rihgt

#

i forgro

rotund ravine
#

It’s deprecated for components

eternal oxide
#

Build against Spigot

rotund ravine
#

Not due to it not being usable

quaint mantle
#

oh

#

i can still use it?

rotund ravine
#

Yes

quaint mantle
#

ayyy

tender shard
#

your server software and/or api is deprecated

twin venture
#

Hello there , i know this might be bad to do , but iam making a custom death system based on damage event .

what iam using is :
EntityDamageEvent

    if ((player.getHealth()  -

event.getDamage() > 0)) return;

after that i cancel the damage and heal the player and teleport him so he never die acctuilly

#

there are 1 bug i found but its related to the combatLog i guess .

#

the problem is :
if i hit someone and i die without getting any damage from the other player , like die from void , or burn by lava etc ..
i will not get any death stats , and that player who was attacked won't get any kill stats ..

tender shard
#

your username is killer, yet you prevent kills

quaint mantle
#

runTaskTimer(plugin, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */); is this like a 30 second delay?

tender shard
tender shard
twin venture
quaint mantle
twin venture
#

there is only this method which return the attacker

#

i want to make new method to get the other player who was attacked

tender shard
eternal oxide
#

You need to tag the damaged player any time they are hurt by another player. and timestamp it.

#

if they die within an acceptable timeframe you can attribute the kill to the last damager

quaint mantle
vivid skiff
#

How can i check if a player can build from the player interact event?

eternal oxide
#

its better to do it in teh block place event

#

depending on what you want to do after

vivid skiff
#

I want to do something similar to itemsadder when a custom block is placed

#

But i can't use the block place event to do it

eternal oxide
#

no clue what they is, I've never used it

#

why can't you use the block place event?

vivid skiff
#

When i click a block with a item like PAPER it will place a barrier block, but if i can't build it will not

eternal oxide
#

there is no way to tell if you can build when another plugin cancels the event

#

you could fire off a BlockPlaceEvent yoruself and check if it's cancelled

#

but it's not recommended as you could mess with other plugins.

spare radish
#

Using BlockGrowEvent, I created the following code to make a crop grow one more step than normal when it grows. But it doesn't work well. Can someone help me?


    @EventHandler
    public void blockGrowEvent(BlockGrowEvent e){
        Block crop = e.getBlock();
        BlockState state = crop.getState();
        Ageable ageable = (Ageable) state.getBlockData();
        if (ageable.getAge() < ageable.getMaximumAge()) {
            ageable.setAge(ageable.getAge() + 2);
            state.setBlockData(ageable);
            state.update(true);
        }
    }

eternal oxide
#

you need to cancel the event if you are manually changing the growth

spare radish
#

I see! Thank you very much. I will give it a try.

small timber
#

why is this?

eternal oxide
#

a stair is not solid

#

also filter by Material::isBlock

#

you no longer need the while loop then

#

sorry seems stair is solid

#

its light thats allowed through

somber night
#

why is this not working?

if (item.hasItemMeta() && item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey(this, "meth"), PersistentDataType.BYTE)) {
// Apply potion effect after x seconds
for (PotionEffectType type : PotionEffectType.values()) {
int duration = 20 * (90 + player.getPotionEffect(type).getDuration());
player.addPotionEffect(new PotionEffect(type, duration, 0));
}
}

eternal oxide
#

last comment, this code will only work for a single player

#

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

remote swallow
#

any errors? does the item actually have a byte pdc key?

somber night
#

its supposed to give every effect but it isnt even usable

somber night
#

and no errors

remote swallow
#

hold the item in game and run /data get entity @s SelectedItem

lost matrix
#

Did you register the listener?

somber night
#

i did

lost matrix
#

Then print out the item data and show it to us.
And send your whole code.

somber night
remote swallow
#

you are adding the effects with the amp of 0

#

so no effects

lost matrix
#

amp 0 should be lvl 1

somber night
#

sorry, im new to this, whats that mean

remote swallow
#

you add the effect with a level of 0

somber night
#

oh that, yeah 0 is level 1 effects

remote swallow
#

add sysouts then

somber night
#

what that

lost matrix
remote swallow
#

System.out.println()

somber night
lost matrix
#

Dont use minecraft as a namespace. Use your own namespace.

somber night
eternal oxide
#

System.out.println("we reached here!");

twin venture
#

what is the senarios of death i should expect?

#

if(attacker == null && combatLog.isInPvP(player.getUniqueId())){

#

what else :p?

lost matrix
#

0 context => crossly generalized answer

twin venture
#

ik ik

#

but i have been trying to handle some things

#

if i hit someone and i fall to void, it should give stats , but its not ..

lost matrix
twin venture
#

bcz i didn't get damage from the player who i damaged

#

i only damaged him .

lost matrix
twin venture
#

i made something custom ..

pseudo hazel
#

well if they never damaged you that life and you fall in the void regardless thats a skill issue and they wouldnt get the kill for it usually

#

I imagine you would need to keep track of every fight in some way

somber night
remote swallow
#

a screenshot

#

?img

undone axleBOT
eternal oxide
#

?img

undone axleBOT
eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

lost matrix
# twin venture i made something custom ..

Custom could look like this:
Add 2 PDC tags to each player/entity

  • UUID of last attacker
  • Long timestamp of last attack

Then you can always check who attacked this entity and how far
this attack lays in the past. Just make sure to clean it on death/game end.

twin venture
eternal oxide
#

don't bother with PDC as this data shoudl not be permanent

#

just a HashMap

somber night
lost matrix
#

Hm, if you dont need it to be persistent then PDC might not be the right approach.
But this will result in people logging out before they fall into the void to deny the kill.

twin venture
#

what iam doing wrong?

remote swallow
eternal oxide
#

create a Record containing lastAttacker and timestamp

twin venture
#

it should check :

  • killer is null but player is in combatlog
  • killer is null but player is not in combatlog
  • killer is not null and player in combatlog
eternal oxide
#

then push to a Map of <UUID, record>

twin venture
#

check the code i sent .

pseudo hazel
#

which method does this get checked?

somber night
twin venture
#

if i hit a player and i die to void , it should give stats to me and to the player who got attacked (Kill stats).

lost matrix
pseudo hazel
#

but noone got attacked

#

you just fell in the void

twin venture
#

not really ,

eternal oxide
#

if I punch you, then run around the corner and get run over by a car, did you cause my death?

twin venture
#

if i hit someone , and i fall to void

i do this :

remote swallow
#

ow

#

that hurts

eternal oxide
#

?paste code to not spam

undone axleBOT
lost matrix
#

This can be replaced by just

playerCombatInfoMap.put(playerId, playerCombatInfo);
somber night
#

also, would the"public void onCraftItem" in my code prevent items with those nampespaced keys from being used in crafting?

misty ingot
remote swallow
#

a), use an item builder, b) dont store that in yml, c) store the id as an int d) load items on startup and when a new one is created

#

loading the yml and every item when someone opens a gui is just going to cause lag

misty ingot
#

what is an item builder

remote swallow
#

create storage handlers and load items on startup

small timber
remote swallow
eternal oxide
misty ingot
remote swallow
#

allows you to do new ItemBuilder(Material.RED_CONCRETE).name("<red>Downvote").build()

eternal oxide
remote swallow
#

want me to push what i have to github and show you what i mean with storage handler

#

oh also use a getter for data, not a public field

misty ingot
#

i am going to switch to json

eternal oxide
#

then you need to use UUID.fromString

#

else it's attempting a name lookup with the UUID string, which will not exist and it trys to ask Mojang

remote swallow
#

if you want expandability you should have an interface for storage

misty ingot
#

gonna try it like that

eternal oxide
#

Which is where its slow

eternal oxide
#
UUID.fromString(plugin.data.getString(ymlPath + ".owner"))```
somber night
misty ingot
#

aw yep its real fast now

somber night
#

i added this
System.out.println("we reached here!");

remote swallow
misty ingot
#

i will still make the changes i should

remote swallow
misty ingot
#

mhm

somber night
twin venture
#

is there a simpler way i can make this system?

small timber
#

also it works for all non solid blocks like slabs

remote swallow
small timber
#

it only doesnt work for full blocks

remote swallow
small timber
#

he said that stair is not a solid and then that it is a solid

#

so I don't get where the problem is

remote swallow
#

check stash to see what the material enum says is solid then

somber night
eternal oxide
#

add a filter for Material::isBlock

#

then you can delete your while loop

misty ingot
#

the repo is not public btw @remote swallow

remote swallow
#

oh

eternal oxide
#

Next you need to deal with

remote swallow
#

i thought it was lmao

eternal oxide
#

that will be fine if there is only ONE player on the server doing anything

pseudo hazel
#

or if the listener is made for evey player xD

remote swallow
# somber night and how may i do that, im extremely new
public class MyClass extends JavaPlugin {
    private NamespacedKey methKey;

    @Override
    public void onEnable() {
        this.methKey = new Namespacedkey(this, "meth");
    }

    private boolean hasMethKey(ItemStack stack) {
        if (stack != null && stack.hasItemMeta) {
            return stack.getItemMeta().getPersistentDataContainer().has(methKey, PersistentDataType.BYTE);
        }
    }
}
eternal oxide
#

yep, which would be a crazy thign to do, right

remote swallow
eternal oxide
#

delete Material[] materials = Material.values();

#

its not needed

#

just pick a random from solidMaterials

#

if you filtered for isBlock you know it's going to be a solid block

small timber
#

wait that's to me?

eternal oxide
#

your current code does not create a player file

small timber
#
        if(block.getType() == generatedBlockType && !completed){
            completeTask(p);
            completed = true;
        }

this only runs if it generates a non full block like a slab or stair

eternal oxide
#

unlikely

small timber
#

i mean i tested it many times

#

if it generates a slab, i walk over it, the method triggers

#

if it's something like oak wood it doesn't work

eternal oxide
#

ok first thing, your Block block = p.getLocation().getBlock(); is always going to be Air or water or lava

#

so Block.getType() is never going to be your generated type

#

unless it's a partial block, like a slab or stair

small timber
#

ohhhh

#

so that's the reason

#

so how can I change it

eternal oxide
#

what exactly are you trying to do, not what you code does. What is your actual goal?

small timber
#

basically, a random block generates and walking on it completes a task

#

and also it needs to be persisent

#

so it saves itself to a yaml file

eternal oxide
#

generates where?

rose aspen
#

I got the same issue here.

Packet encoding of packet ID 82 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "trackedValues" is null
        at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.pack(ClientboundSetEntityDataPacket.java:17) ~[?:?]
        at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.write(ClientboundSetEntityDataPacket.java:38) ~[?:?]```

What was the solution here?

I try to send a `ClientboundSetEntityDataPacket` to attach some entitydata for a armorstand via mojangmappings.
`protocollib.sendServerPacket(nearby, PacketContainer.fromPacket(new ClientboundSetEntityDataPacket(stand.getBukkitEntity().getEntityId(), stand.getEntityData().packDirty())));`

But somehow all players exept one player will be kicked from the server with error `Packet encoding of packet ID 82 threw (skippable? false)`
But it is random, which players will be kicked.
eternal oxide
#

make a thread, so its easier to talk

rose aspen
#

me?

eternal oxide
#

no DKL

small timber
#

help

remote swallow
#

anyone know how im somehow stack overflowing by opening a different inventory on the close of another

#
    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onInventoryClose(InventoryCloseEvent event) {
        System.out.println("called");
        CustomInventory inventory = inventoryMap.get(event.getView());

        if (inventory != null) {
            inventory.consumeCloseEvent(event);

            this.inventoryMap.remove(event.getView());
        }
    }
``` thats whats causing it
#

it runs the called like a hundred times then dies

eager jacinth
#

Hello. I'm currently developing a plugin for profiles. I added caching via LoadingCache, but when I get a profile from the cache, it returns a reference, so if I edit something in the received profile, it will be edited in the cache. How to avoid it? Create a copy constructor or something similar?

pulsar flicker
mortal hare
#

have anyone tried this?

#

seems cool

river oracle
#

I'd consider trying maybe if I had a vsc plugin to make the compiler and linter shut up

mortal hare
#

it does have intellij plugin for that tho

river oracle
#

I don't use intellij so rip for me

#

I'll stick with my boring old vanilla java for now I suppose

pseudo hazel
#

yeah same, I wouldnt want my java to become c++

#

I mean I do use intellij but still

vivid skiff
#

How can i send a PacketPlayInArmAnimation in nms?

hazy parrot
mortal hare
#

not all features i like

#

i honestly would love to have preprocessor definitions in java

#

and to make those variables accessible through java command by inputting the class

#

that way build system could recognize them

#

and do some logic

pseudo hazel
#

if anything I would want scripts that arent attached to a class

hazy parrot
#

Ig templates here just makes generics available at runtime

mortal hare
#

just like c++ does

#

by not using generics

mortal hare
#

hiding the implementation behind syntax

remote swallow
#

i was calling Player#closeInvenetory

#

on the inv close event

mortal hare
#

something like fastutil does

#

it implements separate class for the different implementation

#

instead of using generic types

#

to alleviate the performance overhead of generics

pseudo hazel
hollow sail
#
Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
      PacketContainer container = Freebuild.getInstance().getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
        container.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.ADD_PLAYER);
        container.getGameProfiles().write(0, WrappedGameProfile.fromPlayer(player));
        try {
            Freebuild.getInstance().getProtocolManager().sendServerPacket(player, container);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
#

How can I best fix this error?

#

I've tried everything, it just doesn't work.

quiet ice
#

Are you using the right right version of protocollib?

mortal hare
#

no i use left one

torn shuttle
#

guys should I ask microsoft for 4 bil or 8bil usd for my game

mortal hare
torn shuttle
#

nah godot

hollow sail
chrome beacon
hollow sail
chrome beacon
#

Not yes

dark arrow
#

?nms

hollow sail
chrome beacon
#

Yeah

hollow sail
dark arrow
#

I need help with this documentation
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmcspigot1.18.2-R0.1-SNAPSHOTπŸ«™remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
Here i don't know weather to change group id or not , cuz if i do no change it gives error for unfound group id , after changing it i also have to change the artifact id , version which gives error cuz the '<goal>' tag would have remap which is not found

chrome beacon
dark arrow
quiet ice
#

how do you run it?

hollow birch
#

hey im running into a weird problem im working with packets for the first time and trying to override the default mining animation but to do that you have to give the player permanent mining fatige which you do with this

player.addPotionEffect(PotionEffectType.SLOW_DIGGING.createEffect(-1, -1));

#

the problem im having is when the player leaves and rejoins or the server closes it still says they have mining fatigue

dark arrow
#

it just gives error

hollow birch
#

but it doesnt do anything unless they drink milk and it gets reapplied

somber night
hollow birch
#
            for (PotionEffect effect : player.getActivePotionEffects()) {
               player.removePotionEffect(effect.getType());
            }
        });```
#

thats in my on disable and the same method on player quit

#

should remove every active potion effect the player has

somber night
#

it should as far as im aware

#

or maybe not, since youre looking for online players?

hollow birch
#

the server runs this before the players are kicked as far as im aware

somber night
#

then it should

hollow birch
#

im going to give mtyself some other effects and see if it clears those

#

welp

#

idk what i changed

#

but i just

#

rebuilt the plugin from intellij

#

and it worked

#

so

#

maybe i changed something last night at like 2 am and forgot about it

summer scroll
#

I need help giving a colored glow effect to player, been searching in the forum but I only found that it can only work with a team, but is that the only way?

sterile token
#

What would be the best way for getting the main class instance from objects (like models, utilities). Because you cannot use DI for them

eternal night
sterile token
#

I mean why you laught it's a really importante question

eternal night
#

That's not a laughing emoji

#

That's a "what" Emoji

sterile token
#

Oh sorry mate i just get up

#

Here Is where i find DI a deal, that you can't imolement it over utilities or models things

tender shard
#

why shouldnt that work?

sterile token
#

Yes that Is correct while not doing utility method like UserModel, BlaModel, etc

tender shard
#

please show me ANY example where DI wouldn#t be possible

sterile token
#

But what about for Enums, models where smtimes you need main instance. How you get one? Because those are not initialized

tender shard
#

if your enums requires your main instance, it probably shouldnt be an enum.
no idea what you mean with "models"

eternal night
#

If your enum needs a reference to your main instance you are doing Smth wrong

sterile token
#

With models i refer to objects which are used for any properties. Like User, Sever etc

tender shard
sterile token
#

With DI you can't pass it, you should a static getter un that cases

eternal night
#

What

tender shard
#

bruh you're too high again

sterile token
#

That's the point I'm trying to go

tender shard
#

no, you're just talking random bullshit again lmao

eternal night
#

Pls just produce an example

pulsar flicker
#

If you're crafting area is 3x3, why are you not using the normal crafting table interface?