#help-development

1 messages · Page 1276 of 1

left jay
#

and yes

drowsy helm
#

That is very strange

#

Decompile the DamagePlugin and see if the method exists

left jay
remote swallow
#

is DamagePlugin your own?

left jay
#

yep

remote swallow
#

just as a quick test, on the damage plugin re-run clean then install then delete the plugin on the server and re-add it

left jay
#

ok sure

left jay
#

will update u later

mortal hare
#

its weird to think that when i got rid of event driven listeners and handlers my code just from applying YAGNI shrank like 20-30%
also its way cleaner and more things are encoded in the types than in the runtime
if i need to generalize i can always just change the guts of the implementation to wrap those classes under event listeners in the futrue
like fr, code is just so easier to write when you just dont try to chase the "what if I need to do A in the future"

ivory sleet
#

yea

#

we tend to suck at prematurely abstracting

#

so its (often) better to write something that works first, a solution- although it may not be correct yet it works... and then we abstract, refactor and restructure it into the shape we want

mortal hare
#

i think that's the reason why i've never finished my minecraft server

#

i've written core plugin of the server before trying to code something useful

ivory sleet
#

yea thats fair

mortal hare
#

you cant just make a core plugin if you dont know what your server needs, sure you can predict like you would need centralized command handling abstractions etc

#

but still

ivory sleet
#

but its like an acceptance of failure sort of,

if I were able to, I would 100% wanna shape and abstract my code into the ideal structure before getting it to work or in parallel, its just that so many times we don't know that ideal structure or that perfect shape is gna look like before we get it to work

#

now dont get me wrong, if I asked u to write an orm u'd probably be able to write a nice abstraction whilst writing the solution, but thats just because u've done it so many times

mortal hare
#

i would write orm first because i would probably do integration tests for it and splitting it from something instead of embedding it inside another class just does make sense for testing imho

ivory sleet
#

yea fair, I mean thats if u do care about tests, which to many is an important aspect of their software development

mortal hare
#

i also started to adore records more, my right now golden rule is that if there's some data which can be decoupled from behaviour which needs to be public should belong in record class and if someone needs to attach some behaviour embed a reference to behaviour class like so:

public interface ChatHistory {
    ChatResponse FetchResponse(ChatMessage message);
    void DeleteResponses(int fromIndex);
    Collection<ChatResponse> RegenerateResponses(int fromIndex, ChatMessage message); 
}

public record class Chat(int id, ChatHistory history);

since ChatHistory fully encapsulates history data in this case, so its part as a value inside a record

#

that way you dont need to write getters for it and overall improves code readability

#

it seems to work well but we'll see

#

maybe i'll change my mind

ivory sleet
#

I think what I like about records is the fact that its also guarantees transparency

ivory sleet
#

esp in Java

mortal hare
#

same

#

it depends™

ivory sleet
left jay
sly topaz
ivory sleet
#

not entirely

#

i mean sure, by the looks of it, it seems java wants developers to be able to write code in the DOP paradigm as well

#

seeing as records were added

sly topaz
#

performance of a program entirely depends on how well the data is being laid out to favor cache locality

#

you may not directly do DO but whatever language you're using will do it under the hood anyway

ivory sleet
#

they are two different things

sly topaz
#

data oriented programming is just applied data oriented design

ivory sleet
#

yes and no

#

data oriented programming at its core is about principles regarding data scheming, transparency, immutability, separation of data and behavior

data oriented design is to design code with efficient usage of CPU caches for one, this regards spatial and temporal locality as u were talking about earlier, data oriented design doesn't care about immutability, separation of data and behavior etc

#

sure they both contrast to OOP

sly topaz
ivory sleet
#

it is

#

you dont regard encapsulation for example

#

you dont regard polymorphism for example, instead u make use of case/switch expressions

young knoll
#

Are we reverting back to 1980s programming?

#

When resources were a commodity

ivory sleet
#

subsequently u dont get into the issues of OOP such as tight coupling, arguable and negligible performance overhead, you dont get these highly complex relationships between classes, and you dont get huge state management issues for one

mortal vortex
young knoll
#

Best I can do is 8kb of ram

ivory sleet
young knoll
#

Yeah it does

#

There’s a series of videos on YouTube about someone optimizing Mario 64

#

Particularly on there the shared RAM is the bottleneck, so cpu cache is even more important

ivory sleet
#

yea

#

well RAM is slow in the grand scheme of things sadly

#

so itd make sense for games to make use of this optimization

#

@sly topaz i should ask, did I enlighten you, or does it seem like im the one living under a rock?

sly topaz
ivory sleet
#

oh my bad, food time muy importante

sly topaz
#

but I do see your point, I'll explain myself better when I finish cooking

ivory sleet
#

i may be asleep atp, but ill have a look once i wake up then ^^

crude zephyr
#

i have this code to play a sound when a player joins the game, but its only doing it for said player and not for every player, how would i change it to make it for every player?

floral marlin
#
for (Player pl : Bukkit.getOnlinePlayers()) {
    pl.playSound(pl)
}
#

I wrote that from the phone

#

XD

#

Use that

crude zephyr
#

well done

#

for the (pl), change that to player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0f, 1.0f);?

floral marlin
#

Yea

#

pl.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0f, 1.0f);

slate surge
#

i hate maven

drowsy helm
#

gradle >>

drowsy helm
slate surge
drowsy helm
#

why you doing pl.playSound(pl.playSound

floral marlin
#

change the player.getlocation to pl

crude zephyr
#

fixed i think

slate surge
crude zephyr
#

wait fuck

slate surge
#

bruh

#

imma kms

#

u need to play a sound to all players on the server right? @crude zephyr

crude zephyr
#

yes

slate surge
#

so basicallly pl.playSound plays a sound at a location for the player

#

so if u want to the play a sound to all players

#

u need the location of the player u r playing to sound for

#

so u need to supply pl.getLocation

#

not whatever "player" is

crude zephyr
#

so many p's inflatable

floral marlin
#
@EventHandler
public void onJoin(PlayerJoinEvent e) {
  for (Player pl : Bukkit.getOnlinePlayers()) {
     pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 1.0F);
  }
}

use that

crude zephyr
#

commented = old
bottom = new

#

dosent like pl

floral marlin
#

)

#

) after onlineplayers

crude zephyr
#

ahh i see

#

omg it works

floral marlin
#

does it work

crude zephyr
#

yee

floral marlin
crude zephyr
#

thanks pelowisa

floral marlin
#

yw

crude zephyr
#

i do wanna add some things to it tho

floral marlin
crude zephyr
#

i need a libary of sound effects to find what i want

crude zephyr
floral marlin
crude zephyr
#

exactly :)

#

IT DOES!!!!

#

omg im so smart

#

@floral marlin this is the other plugin code i have rn but the potion effect dosent work

#

i think its coz we need to add a 1 tick delay

crude zephyr
#

one second?

floral marlin
#

go to ur main class and add this

public final class "ur main class" extends JavaPlugin {
private static main instance;
public static main plugin;

@Override
public void onEnable() {
plugin = this;
instance = this;

}

public static main getInstance() {
    return instance;
}

public static main getPlugin() {
    return plugin;
}
#

so

#

ASAA

sly topaz
#

why do you have two variables for the instance

floral marlin
sly topaz
#

one is enough

floral marlin
#

ik

crude zephyr
#

like so?

floral marlin
#

change main to DreamDeath

sly topaz
#

and remove one of the variables

#

I believe I had shown an example of this to you before

#

though, at this point it is just not being familiar with the syntax, I'd recommend doing a java course if you can

crude zephyr
#

im doing a c# corse rn and thats already too much 😭

sly topaz
#

there are fairly short java courses out there

#

java's own one is pretty short

crude zephyr
#

i removed all "instance"

sly topaz
#

what does the inlay hint say when you hover over the red-underlined method

crude zephyr
#

oh its because i have it twice

floral marlin
#
    @EventHandler
    public void asdasd(PlayerRespawnEvent e) {
        var p = e.getPlayer();
        p.sendMessage(ChatColor.LIGHT_PURPLE + "You woke up from a bad dream");

        Bukkit.getScheduler().runTaskLater(main.getInstance(), () -> {
            p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 200, 1));
            p.addPotionEffect(new PotionEffect(PotionEffectType.NAUSEA, 200, 1));
        }, 2L);
    }
crude zephyr
sly topaz
#

if the event handler is inside the main class, you don't need a singleton, you could just use this directly

#

the singleton will be useful if you decide to move the event handler to another class

crude zephyr
#

sorry that means nothing to me

#

uhh

sly topaz
#

is the event handler inside the DreamDeath class?

#

the event handler being the method with the @EventHandler annotation

#

you can use a paste service to paste big classes like that next time

#

?paste

undone axleBOT
crude zephyr
#

i uhh dont know how

floral marlin
#

just paste the code in that page

crude zephyr
#

done, then what

sly topaz
#

and then hit the save button on the top right bar

crude zephyr
#

yee i did that

#

but idk how that would paste into discord

sly topaz
#

you can share the link now

#

it'll contain whatever you pasted

crude zephyr
sly topaz
#
        // Need to add a 1 tick delay
        player.addPotionEffect((new PotionEffect(PotionEffectType.BLINDNESS, 200, 1)));
        player.addPotionEffect((new PotionEffect(PotionEffectType.NAUSEA, 200, 1)));

if you need to add a tick of delay, all you have to do is use the bukkit scheduler like pelowisa has shown above

sly topaz
crude zephyr
#

would i do
var p = e.getPlayer();
or what i originaly did
Player player = event.getPlayer();

sly topaz
#

either way is fine

crude zephyr
#

main is red

sly topaz
#

main is a namespace

#

in this case, your class isn't called main, it is called DreamDeath

#

so you should replace it with that

blazing ocean
#

I feel like you should learn java before this

crude zephyr
#

but if i do, .getInstence() goes red

blazing ocean
#

because you called it getPlugin

crude zephyr
#

so change getInstence to getPlugin?

sly topaz
#

yes

crude zephyr
#

oh okii so its done

#

ill test it now

#

fuck yeah it works

#

just changing the effect duration

floral marlin
crude zephyr
#

thanks you 2

floral marlin
#

yw

crude zephyr
#

now i need to work on the perms

daring light
#

Is there a way to not completely override another plugins command but add on to it?

#

I want to add a subcommand to another plugin but let it keep its own commands

#

Like a plugin has /cmd registered and I want to listen for that so if it's /cmd subcommand I can do something

buoyant viper
#

please help chat,, i booted up my pc to write code... but i started listening to KE$HA... now i am too busy dancing to make plugins...

pseudo hazel
#

you gotta lock in

#

dance on your keyboard instead

drowsy helm
#

But if you want to actually modify the execution youll have to do some runtime manipulation

fathom dirge
#

To change the tab complete of the existing command you might be able to use TabCompleteEvent

smoky anchor
#

?services Discord is not the right place for this

undone axleBOT
mortal vortex
smoky anchor
#

Or saying "not scam" :D

mortal vortex
smoky anchor
#

Oooh I did just assume they want dev work. Ty!

blazing ocean
worthy yarrow
mortal hare
#

i want mutable records

#

without defining getters setters

#

but allowing to overload them

#

something like record but mutable

#

would be nice

echo basalt
#

just make a class

#

lombok moment

eternal night
#

not mutable but yea

#

withers

mortal hare
#

such thing would be so cool

public struct Player(final int id, string username, ...) {
  @Override
  public void username(string username) {
    // code
    this.username = username;
  }
}
#

ant then just

player.username("Dovias");
slender elbow
#

mutable records 💀

eternal night
#

mutability truely is the worst

mortal hare
#

final int id would make getter only

eternal night
slender elbow
#

and now you break every program that uses records

#

gj

mortal hare
#

how

slender elbow
#

because now every existing java source file that defines a record has its components be mutable, needing to add final to make it immutable

mortal hare
#

well i propose new keyword struct

#

with new object type

#

so it can maintain compatibility with records

slender elbow
#

you should reach out brian goetz about your ideas, i'm sure he's gonna receive them with great respect

mortal hare
#

😭

pseudo hazel
#

whats the point though

mortal hare
#

less code

#

ensures contract

#

in a strict way

#

if i see final i know its immutable

#

if it doenst have it must be mutable

pseudo hazel
#

I mean why not use a class

echo basalt
#

why have it mutable

slender elbow
#

mutable by default is a stupid default

pseudo hazel
#

too bad thats what java already is xD

slender elbow
#

yep

echo basalt
#

why doesn't java do some funky inheritance shit to make List inherit ImmutableList

slender elbow
#

but the point of records is that they are immutable anyway

mortal hare
echo basalt
#

so we'd have kotlin's concept with a weird naming scheme

slender elbow
#

there is no ImmutableList in java

blazing ocean
#

explicit immutability is evil

echo basalt
#

:(

slender elbow
echo basalt
#

they have immutable lists just not explicitly

pseudo hazel
#

well if its a property anyone wants to edit, why is it not public

slender elbow
#

if that's what you use it for, go for it

echo basalt
#

I'm sure he can achieve what he wants with an annotation processor

ivory sleet
blazing ocean
#

annotation metaprogramming my behated

slender elbow
#

Immutables is love

pseudo hazel
#

insert rust here

echo basalt
#

just code in asm

#

ffs

#

get all the freedom you want

mortal hare
#

i recently started experimenting with putting immutable data like getters in records and then if something needs to be mutated i create new interface and for it implementing class which acts as a value class

public record Player(UUID id, Username username, ...);

public interface Username {
   string fetch();
   void change(string username);
}

public class MojangAuthUsername : Username {
   private MojangAuthUsername(UUID playerId) { ... }

   @Override
   public void fetch() { ... }

   @Override
   public void change(string username) { ... }

   public MojangAuthUsername create(UUID playerId) { ... }
}

instead of making everything an interface i put only encapsulated data behaviour inside interfaces, that way you only need to unit test only the behaviour and you can leave getters alone since that's enforced by java spec.

also it allows you to construct Player objects easily without having to call factory methods etc.

or just construct usernames without player objects

#

seems to work well for now, but my mind is always changing so idk 😄

ivory sleet
#

as lynx said, Java will eventually (likely) add withers

pseudo hazel
#

sounds complicated

ivory sleet
#

so reconstructing a new record type instance based on an existing one will be less verbose

pseudo hazel
#

whats a wither

#

like record.with()?

slender elbow
#

so you know when you go to the nether

#

there are these forts

pseudo hazel
#

those withers only destroy records, not create new ones

ivory sleet
#

dovidas, records are also good because of their strictness, making them mutable is meh as they lose the signature of being transparent immutable data carriers- and that signature means a lot, to both programmers but also the jvm seeing as it can make aggressive assumptions about records to optimize things in certain ways like escape analysis n id guess inlining?

mortal hare
#

that strictness allows me to build code with interfaces where i only really need them, thus i can mock only parts which are needed to mocked and that what i love the most about them

worldly ingot
#

I was really confused

mortal hare
#

in the code i've provided i only need to unit test Username interface implementations

#

i dont need to test Player since its immutable and its guaranteed by java spec to be like that

#

the only con is that is that Player object can now only be loaded eagerly

#

but i think about that as more as a win

#

i prefer eager loading than implicit lazy loading

#

code should be explicit what it does when performance is critical

#

you shouldnt lazy load IO operations inside getters

ivory sleet
#

i mean yea 100%

mortal hare
#

if you want that use a class with an interface and methods

thorn isle
#

jit escape analysis is pitiful

#

i think they completely gave up on it and are putting their eggs in the value-based classes basket now

buoyant viper
thorn isle
#

💀

blazing ocean
dark arrow
#

what to do i had some code in my plugin that allows me to run commands remotely , now the server owning is threatning to sue me

chrome beacon
#

Now why did you put that in there

dark arrow
#

because i was working for free

#

so i compesated by giving me stuff in the server for free

chrome beacon
#

So you just added a backdoor to give yourself stuff 💀

dark arrow
#

I mean you are making it sound serious , it was just a playful party trick

#

but he cant sue me right? he is bluffing

blazing ocean
#

😭

#

get a lawyer or something

topaz hollow
chrome beacon
#

👀 nice timing

dark arrow
topaz hollow
topaz hollow
dark arrow
topaz hollow
dark arrow
topaz hollow
#

come to dm i will explain

chrome beacon
dark arrow
chrome beacon
#

and you believe that?

blazing ocean
#

@ md

#

actually isn't he an attournee or whatever

dark arrow
topaz hollow
dark arrow
#

how do we delete messages in console?

chrome beacon
#

You cannot

#

Trying to mess with the server even more isn't going to help you

dark arrow
#

omg i can get out of it

chrome beacon
#

You're just making it worse for yourself

dark arrow
#

if they have no evidence in logs what will they do

chrome beacon
#

You do realize this is a public channel right

#

You've already admitted to what you've done

slender elbow
#

i will sue you @dark arrow

dark arrow
dark arrow
slender elbow
#

idk

dark arrow
#

i am kinda pseudoannonymous i just hope he is not smart enough to get my ip from the server

#

or maybe i will delete it too

mellow edge
#

It's impossible to open a custom tile inventory without the bottom (HumanEntity's) inventory right?

slender elbow
#

you can use resource packs to visibly hide it, but it can't not be included in the actual opened menu

grim hound
#

how can I disable the hitbox of an entity? (such that clicking on it will pass it by and click the entity behing it)

dark arrow
grim hound
#

I think there is a friendly fire option

dark arrow
grim hound
dark arrow
grim hound
#

EntityDamageByEntityEvent

spring canyon
echo basalt
oak light
#

Hey if I put a plugin in softdepend will it always load before my plugin?
If not, will its classes be available via reflection at least at runtime when my plugin is loading?

chrome beacon
#

yes

#

dependencies are loaded first

thorn isle
#

it will load before your plugin if it is present and there are no circular dependencies

oak light
chrome beacon
#

yes

oak light
#

Also do soft depnendcies exist in 1.8?

#

when were they added

sullen marlin
#

Forever ago

#

Way before 1.8

thorn isle
#

1.8 was also forever ago

oak light
#

Alright great, asking cause I want to refactor some really bad code I have for detecting VIa support across platforms to just do a class load via reflection and store it in a private static final variable that will get inlined so we only check once

sullen marlin
#

Two forevers ago

mortal hare
#

is the golden rule of mocking is that you should mock objects which you cannot write unit tests for? I mean if you written unit test for it, what's the point of mocking it by making your tests brittle
you cant just mock everything away, as that would require defining interfaces all over for no reason

thorn isle
#

mocks also allow you to create nonstandard and broken behavior for e.g. parameters of the unit-tested class to verify that the class handles any errors in other classes gracefully

cinder igloo
#

hi

#

im getting: Could not decrypt data from /45.33.29.47:57382. Make sure the public key on the list is correct. i have the port setup right and everything correct and the right public key.

ivory sleet
# mortal hare is the golden rule of mocking is that you should mock objects which you cannot w...

For one, in today’s world, mocking does not require making something an interface. We have stuff like mockito, and powermocks.

if your tests become brittle/fragile, it may be a sign that you’re running into the fragile test problem, which on its own doesn’t necessarily correlate to mocking

but let’s say you have some unit that somewhere uses a database dependency, you obviously don’t wanna boot up the database everytime you run that unit test, because you’re actually not testing the database, but rather you’re testing the unit which depends on the database programming interface code of urs- therefore you likely wanna mock that dependency, which is a way of saying “hey, given that whatever this unit depends on doesn’t fail, does this unit also not fail?”, its a way of isolating ur proofs put simply

edit: i dont think there exists a golden rule, but if one were to estimate itd be- mock what u dont have authorship over

#

^ I should say mocking is something u often do in unit testing, but less so in for example integration, regression or system tests

drowsy helm
#

are you using velocity

burnt current
cinder igloo
slate surge
#

getVersion() < ProtocolConstants.MINECRAFT_1_19_3?

#

why less than 1.19.3

kind hatch
#

Because 1.19.4 is when chat signing/reporting got added to the game.

slate surge
#

ah

#

thnx

lucid hearth
#

How do I send a fetch request to a http server hosted with a bukkit plugin?

#

I can't chain the ports

#
HttpServer.create(new InetSocketAddress(8000), 0);```
drowsy helm
lucid hearth
#

I want to recieve requests

drowsy helm
#

that is not sending a fetch request then

#

you have a few options. I'd recommend Javalin

lucid hearth
#

I can just do fetch("localhost:8000") when i'm hosting a local bukkit server

#

and that works

#

but on an actual server I dont know what to send to

drowsy helm
#

you're just going to have to expose the 8000 port and send it to the public ip

lucid hearth
drowsy helm
#

are you self hosting?

lucid hearth
#

nope, using a server host

drowsy helm
#

You're going to have to ask them to expose the port for you

lucid hearth
#

I can't do it myself at all?

drowsy helm
#

No, if you want to access it externally that is up to the network administrator

lucid hearth
#

I'll just make it send periodic requests and get the data through responses then ig

drowsy helm
#

Or use a message broker like redis

buoyant viper
#

encode your data in the ServerList Ping Request

#

shrimple

random compass
#

?services

undone axleBOT
dark arrow
#

do we need to use nms package to create working npc

drowsy helm
dark arrow
drowsy helm
#

something like Citizens or zNPC

dark arrow
#

i think citizens is more customizable while znpc is more easy to use

dark arrow
#

how ot give players powedered snow frostbite effect without poweder snow

floral marlin
slate surge
#

how does minecraft validate the chat chain

#

(the server)

dark arrow
#

any alternatives to citizenapi?

sly topaz
dark arrow
sly topaz
#

if you want to handle their AI then use MobChipLite

slate surge
harsh ruin
#

how to create interactive entity with scale of 0.5block with a plugin ?

chrome beacon
#

world#spawn & Interaction#setInteractionHeigh &
setInteractionWidth

harsh ruin
#

it's doesn't work for me

chrome beacon
#

Show your code

harsh ruin
#

wait, I put back a lib that has nothing to do with my project, and now it works, well thanks anyway, I'll get back to you if I have a problem

brazen hawk
#

Perhaps this isn't the right place to ask - though a development question nonetheless... I https://github.com/SpigotMC/XenforoResourceManagerAPI in regards to the site API and just wanted to check that it's still the latest and there's not other docs somewhere else? I'm looking to search for resources by name, meaning I won't have their ID already. If this is not possible, no worries, but figured I'd ask.

GitHub

Exposes resource/author information via a simple JSON REST API - SpigotMC/XenforoResourceManagerAPI

wise mesa
#

is there a way to make a minecart derail

brazen hawk
azure zealot
trail coral
#
        Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(255, 0, 0), 1.5f);
        location.getWorld().spawnParticle(Particle.REDSTONE, location, 1, 0, 0, 0, 0, dustOptions);

java: cannot find symbol
symbol: variable REDSTONE
location: class org.bukkit.Particle

#

:/

#

using 1.21 spigot (in plugin.yml i have apiversion 1.20)

chrome beacon
#

That would be correct, there is no particle named REDSTONE

#

Probably looking for DUST

buoyant viper
crude briar
#

Anyone know how to do ranks based on how much a player as spent on buying individual perks/kits etc...

EG player Buys 2 Legendary Keys for $12,

Rank 1: $1-$20 Donated
Rank 2:$21-50 Donated
Rank 3: $51-100 Donated

I want to make it so when a player buys 2 legendary keys they also get Rank 1, it needs to be able to scale into the rest of the ranks as well, so if for example the player was then to go buy a kit for $10 Their total donated would be $22. So the Store would also push them up a Donator Tier into Rank 2.

#

Or if anyone knows someone who makes custom plugins

true cosmos
#

Seems like a good beginner plugin with a hook into something like luck perms or groupmanager

kind hatch
#

Pretty sure that's just a feature of tebex. You can setup something like purchase limits or goals that execute commands per individual that just run a simple rank promote command.

echo basalt
slender elbow
#

well then show me

crude briar
crude briar
echo basalt
#

you gotta manually track it

#

tebex api doesn't really give pricing info last time I tried

crude briar
#

Wdym pricing info?

echo basalt
#

how much they spent

crude briar
#

Hmm I’m pretty sure it does

echo basalt
#

either way I did it with a more manual approach

#

just run a command when they buy

crude briar
#

here

echo basalt
#

ah rest

crude briar
#

Or how did you implement it?

echo basalt
#

each product runs a command with its corresponding price and player

#

increment a running total for that player

#

And add a group based on that total

#

You can make the command query the API instead but currency conversion rates etc might influence your results

crude briar
#

could you explain it to like a 3iq
person?

echo basalt
#

I don't think it gets any easier

#

legit just /tebexadd ImIllusion 12.99

#

then we just have a lil db saying "ImIllusion has spent 69.42$"

#

and based on that you assign a group

crude briar
#

Oh like a database

echo basalt
#

takes maybe 20 minutes to write

crude briar
#

and then it gets info from that database

buoyant viper
#

im trying to look at their API doc to see if u can get transaction data and theres just like fucking nothing

#

am i stupid as shit or does their documentation suck ass

echo basalt
#

they have an endpoint for it

#

no java api

buoyant viper
#

no yeah im looking for endpoints

#

i just dont see anything

#

i see stuff about creating a listing and getting store info

crude briar
#

Like in 2020 I bought a server setup because it had that plugin and when I looked into the code it looked playerdata from tebex api so that’s why I’m like 100% sure there’s a way

#

Sadly Idk where that setup is and less that .jar

buoyant viper
#

ah i was looking at wrong api doc

echo basalt
#

eh multi currency whatevers can influence your result

#

if you don't care about it then yeah just listen to buycraft's event and fire a post request

crude briar
#

Yeah I don’t rlly mind about it tbh

buoyant viper
#

oh my god browsing Stash on mobile is an ass sucking experience

#

why cant i SCROLLLLL

young knoll
#

You can

#

With enough determination and a little bit of blood sacrifice

buoyant viper
#

yeah but its like 50/50 on if it works and 10/90 on if it lets u scroll all the way or not

mortal hare
#

never realized that simple "foo" string type is actually a valid json document
without any object or array

#

i guess that make sense

slender elbow
#

yeah and 123 is as well

#

oh and don't forget about null

#

who doesn't love null

worn wraith
#

hey everyone so sorry to ask is there anyone here familair with floodgate? im trying to make a plugin that when you right click a stick it sends a form to a bedrock player i think im almost there but im having some dependency issues and it may be bc i dont fully understand the api, im hoping someone might be willing to take a look at the source and let me know what im doing wrong

echo basalt
#

yeah I've worked w it

worn wraith
#

im very new to trying to do plugins in general but i have to make this work for my players

drowsy helm
#

Send it through

worn wraith
#

the idea here is to combine the forms advanced teleport provides with /tpa and /homes so that controller players dont have to type the commands

drowsy helm
#

so which one is not resolving correctly?

worn wraith
#

let me compile again real quick

#

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project StickMenu: Compilation failure: Compilation failure:
[ERROR] /root/test1/src/main/java/dev/yourname/stickmenu/StickMenu.java:[14,42] package org.geysermc.cumulus.form.response does not exist

drowsy helm
#

also i dont think

      <snapshots><enabled>true</enabled></snapshots>
      <releases><enabled>false</enabled></releases>``` is necessary
worn wraith
#

its org.geysermc.cumulus thas not working

drowsy helm
worn wraith
#

am i using the wrong version of cumulus

#

Could not resolve dependencies for project dev.yourname:StickMenu🫙1.0: Could not find artifact org.geysermc.cumulus:cumulus-form🫙1.1.2 in geysermc (https://repo.opencollab.dev/main/) -> [Help 1]

#

lol discord and their emojis lol

#

i have to go to bed now anyway ill keep reading thru the docs tmmr

#

i know its something super simple

drowsy helm
#

cumulus-form doesn't exist

#

in either snapshots or releases

mortal vortex
#

Anyone notice that Firefox is really really shit lately?

#

I literally cannot view JavaDocs for Spigot or Paper... I open the "Materials" enum, and scroll, after "AXOLOTL_SPAWN_EGG", the whole page is white, and my CPU usage goes to 93% 😭

#

Happens on my laptop, and Desktop

#

is there like a better way to locally view javadocs? I know you can download documentation in intelliJ, but is there any explorer / visualizer app?

oak orchid
#

Is there a way to combine datapack and custom world generation? I want to use datapack world generation for the majority of the world, but I will require a custom ChunkGenerator for the types of generation I need for very specific regions of the world.

So I'd ideally be able to use a ChunkGenerator and do something like

@Override
public void generateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) {
    random.setSeed(chunkX * 4141L + chunkZ * -12412L + worldInfo.getSeed());
    if (wallNoiseGenerator == null) {
        wallNoiseGenerator = new SimplexNoiseGenerator(random);
        floorNoiseGenerator = new SimplexNoiseGenerator(random);
        overhangNoiseGenerator = new SimplexNoiseGenerator(random);
    }

    int baseX = chunkX * 16;
    int baseZ = chunkZ * 16;

    int yMin = worldInfo.getMinHeight();

    for (int x = 0; x < 16; x++) {
        for (int z = 0; z < 16; z++) {
            if(needsCustomGenerator(baseX+x, baseZ+z)) {
                // use coded generation
            }
            else {
                // use datapack generation
            }
        }
    }

}
sullen marlin
random compass
#

so im trying to use a jar as a dependency and not have it shaded in maven, but when i unzip the packaged jar it appears to still be shaded. here my pom.xml

#

?paste

undone axleBOT
random compass
#

please help im going insane

orchid tide
#

is freeminecraftmodels your jar?

random compass
#

yes

orchid tide
#

and if you use intellij check (File -> Project Structure -> Artifacts) (it can do things on its own without maven)

random compass
#

im getting errors when i try to spawn in a custom model

#

through my plugin

orchid tide
#

I mean did you develop it or?

random compass
#

wdym

orchid tide
#

the freeminecraftmodels can be a fat jar

#

try inspecting the jar to see if it has bundled dependencies.

#

if not i got no idea.

random compass
orchid tide
#

okay. interesting

#

try deleting that and create the jar again. sometimes intellij can make artifacts outside of maven (cause why not lol)

random compass
#

what do i delete sorry?

orchid tide
#

try setting it up to not create artifacts and create the artifacts with maven only

#

everything

#

that is there.

#

under imortalsnail_maven.jar

#

all objects

#

then create the jar again. using maven

random compass
#

i just deleted then remade the artifact

orchid tide
#

okay.

#

so you understand. there are 2 ways to make an artifact
maven way: using maven command
intellij way: using intellij buttons which uses a configuration from intellij

in most cases intellij does things different than maven. so the things are not what you expect.

#

that's why I meant create artifacts only with maven.

random compass
#

i see

#

oh my days you fixed it

#

i will love you forever

#

i will credit you in my plugin

#

i will forever be in your debt

orchid tide
#

haha. no my friend. come dm

quartz relic
#

Quick question, are elytras like tridents on how you can’t change the item when thrown? So for instance when you wear the elytra it will show as default one? As when you throw a custom trident model it shows up at then normal trident

mortal vortex
#

No

#

iirc

#

u can change dem

slate surge
#

what is net.md_5.bungee.entitymap?

#

I am implementing velocity modern forwarding in bungee

#

and my client being > 1.20.1 works fine

#

but any client less than 1.20.2 gets stuck on loading world

#

when i am on 1.20.2 it doesn't rewrite the packet but on any version less than 1.20.2 gets stuck on rewriting, downstream bridge

#

my server is running 1.21

orchid tide
#

well. that might be a problem

#

velocity modern forwarding = new
bungeecord = old
old + new = errors

#

just don't. u are better without it man. lol

#

chose one and stick with it.

azure vault
#

can i add a cooldown to an item similar to that of an enderpearl? iirc its possible using datapacks nowadays

vital sandal
#
            Object craftPlayer = craftPlayerClass.cast(player);
            Object targetPlayer = craftPlayerClass.cast(target);

            Method getHandleMethod = craftPlayerClass.getMethod("getHandle");
            Object targetEntity = getHandleMethod.invoke(targetPlayer);

            Class<?> entityClass = Class.forName("net.minecraft.world.entity.player.Player");
            Method getEntityDataMethod = entityClass.getMethod("getEntityData");
            Object data = getEntityDataMethod.invoke(targetEntity);```
I'm using reflection to fix the nms issue but it showing that I cannot found any of these or class ?
smoky anchor
#

net.minecraft.world.entity.player.Player would be obfuscated on the server, no ?

vital sandal
#

it does got obfuscated ?

smoky anchor
#

I'm talking about the class, idk if the string would be obfuscated to match the class.
I dunno enough about this, prob should leave it to someone else actually sorry :D

chrome beacon
vital sandal
#

there are longer class function not just only these :l

#

but just only these doesn't work

thorn isle
#

what

mellow edge
#

is there a difference between:
ItemStack#addEnchantment

and

ItemStack#getItemMeta#addEnchant

pseudo hazel
mellow edge
#

why are there 2 ways to achieve the same thing?

pseudo hazel
#

usually because of backwards compatibility and or convenience

slate surge
#

lol

orchid tide
#

hmm. sure

slate surge
#

that sure was personal ngl

mellow edge
#

(Rn)

thorn isle
#

iirc on paper at least addEnchantment avoids an intermediate creation of itemmeta as it just edits the item component directly

#

beyond that not much in the way of difference (just remember to do setItemMeta) with the meta afterward if you use that

mellow edge
#

I think addEnchantment directly is more convenient so I am using it

sly topaz
#

I was trying to check whether the impl was actually different, but GitHub is working wonders since yesterday

#

Okay vcs is right, that was the difference I misremembered

#

On spigot it is just a convenience method, on paper it might also help performance

pliant hill
#

!veirfy

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

orchid tide
#

like render the page properly?

#

lol

azure vault
#

this is the code i'm trying to port over:

#
net.minecraft.server.v1_10_R1.WorldServer handle = ((CraftWorld) w).getHandle();

try {
  handle.save(true, null);
  handle.saveLevel();
  info("Queued " + handle.getChunkProviderServer().unloadQueue.size() + " chunks for unloading");
  handle.getChunkProviderServer().unloadChunks();
} catch (ExceptionWorldConflict ex) {
  // ...
}
short pilot
#

Good sirs, is there any way to get villager data of when they last saw an iron golem spawn, and last slept?

#

Trying to simulate iron golem spawning in a custom plugin

azure vault
#

saveLevel i couldn't find

orchid tide
short pilot
#

rip

chrome beacon
#

You might need to use nms to access that information

azure vault
chrome beacon
#

Why are you trying to force it to unload

azure vault
#

this is a 1.10 plugin i'm trying to port to 1.21.5

chrome beacon
#

consider looking at what the code does and why

azure vault
#

too complex for my simple brain

short pilot
#

fellas how can I check a block is a type of bed without having to check for each type of bed material

young knoll
#

Isn’t there a tag for beds

sullen marlin
#

Block data instance of bed

sullen marlin
azure vault
#

right

#

thanks

buoyant viper
torn shuttle
#

me, addig documentation on how to use a command

echo basalt
#

spamming - instead of F3+D

#

amateur

mortal vortex
#

wanted to hide the racial slurs he had previously spammed

young knoll
#

Just hold F3 C for 10 seconds

#

That’ll clear your chat

mortal vortex
#

ALT F4 does the trick

young knoll
#

Ehh?

mortal vortex
#

omg i didnt realize what you sent actually crashes the game... i thought it was just another bind to clear chat

#

my joke is now obsolete

slender elbow
#

yes

buoyant viper
#

a trick as old as time

young knoll
#

Sadly it warns you now

#

Ruins the fun

buoyant viper
young knoll
#

@ choco ban

mortal vortex
#

am troll

#

pls no

#

:C

sly topaz
wet breach
orchid tide
wet breach
# mellow edge Why could that happen?

if I remember right in the older versions the way it was implemented it would hold a reference to the world somewhere even though it was no longer loaded. can't really remember specifically. Also don't remember if this only applied to the base world or additional worlds

#

if the reference is never removed this is essentially a memory leak even if its small

#

anyways, I just recall that if you wanted to avoid such things in the old versions you needed to use NMS for unloading

#

wouldn't be surprised if you manage to find an old forum post on the craftbukkit forums about it lol

buoyant viper
#

what would be the simplest way to add player nicknames only to chat?

#

cancel AsyncPlayerChatEvent and broadcastMessage with my own message using the events message format?

young knoll
#

Why not just modify the message in the event?

buoyant viper
#

because im modifying the username part

young knoll
#

Pretty sure you can do that

#

Ah it takes their display name

buoyant viper
#

yee

young knoll
#

Isn’t that only used in chat though

buoyant viper
#

is it not used for tablist and/or nametags?

young knoll
#

Not according to the docs

buoyant viper
#

ah

#

yeah i just looked at the doc as u sent that

young knoll
#

“Only in chat and places defined by other plugins”

buoyant viper
#

i was under the assumption "display" included anywhere it could be seen

#

oh thats getCustomName i guess

young knoll
#

Nah that doesn’t do anything for players iirc

buoyant viper
#

i think that affects nametag (besides for Players)

young knoll
#

Tab list is controlled by setPlayerListName

buoyant viper
young knoll
#

And the name tag doesn’t really have a way to be changed

#

Not easily at least

buoyant viper
#

F

#

yeah get/setDisplayName will probably do all i need then lol

#

ill test it later

whole dawn
#

is there any plugin makers here that is intrested to making a gamemode with me i am a 3d modelist dm if intrested and should be able to vc too and 13 or above

umbral ridge
worldly ingot
#

No that's drawn on the client with no server-sided control

drowsy helm
azure vault
sly topaz
#

at most what you can do is create a task which runs a JVM with debugging capabilities enabled

#

to run Spigot with it you have to enable legacy plugin loading as well as setting the server jar file to a spigot jar

azure vault
#

Thanks

azure vault
#

however when i rebuild my code (using either gradle or intellij) and then use the intellij hotswap option, it doesn't actually hotswap

mellow edge
wet breach
#

like 1.5 to 1.8 not entirely sure how far from there after that as I haven't really kept up with patches to the implementation

mellow edge
#

Kk

azure vault
sly topaz
# sly topaz what do you mean by that
plugins {
    id("java")
    id("xyz.jpenilla.run-paper") version "2.3.1"
    id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0"
}

group = "me.javierflores"
version = "0.0.1"
val minecraft_version: String by project // Has to be set in gradle.properties file

repositories {
    mavenCentral()

    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
    implementation("org.spigotmc:spigot-api:$minecraft_version-R0.1-SNAPSHOT")
}


bukkitPluginYaml {
     main = "me.javierflores.st.SpigotTesting"
     apiVersion = minecraft_version
}

tasks {
    runServer {
        minecraftVersion(minecraft_version)
        legacyPluginLoading()
        serverJar(File("../Spigot-Sources/spigot-$minecraft_version.jar"))
        jvmArgs("-Dcom.mojang.eula.agree=true",
              "-XX:+AllowEnhancedClassRedefinition" /* Allows enhanced hotswapping */)
        debugOptions {
          enabled = true
          suspend = false
          port = 5005
        }
        javaLauncher.set(javaToolchains.launcherFor {
           languageVersion.set(JavaLanguageVersion.of(21))
           vendor.set(JvmVendorSpec.JETBRAINS)
        })
    }

}

this is how I setup runTask in a spigot plugin myself

azure vault
#

and then how do you hotswap?

sly topaz
sly topaz
#

make sure you are hotswapping an actually accessible path

#

it is no use to change something in the onEnable method since that won't be called again till you restart the server

#

you need to change something that is within the normal server lifecycle for it to work

urban cloak
#

Is there a player disconnect packet or does velocity simply close the connection when moving players?

pseudo hazel
#

sounds like a question to ask in papers server

peak depot
#

how hard is it to do custom mob spawing in a sense to when a chunk spawns it spawns apropiate mobs

fossil cypress
#

Does anyone know anything about protocol stuff like packetevents or protocollib? Im getting a network protocol error and im stumped on what it means

sly topaz
#

share the error

wet breach
fossil cypress
#

Invalid entity data item type for field 16 on entity gqn['remai078'/7953, l='ClientLevel', x=-20.00, y=59.00, z=-24.00]: old=0(class java.lang.Integer), new=0(class java.lang.Byte)

#

I want to share that this happened randomly

sly topaz
#

and what code did you use to trigger that

#

gqn is the obscuated name for net.minecraft.client.player.RemotePlayer, so I assume you're creating fake players?

fossil cypress
#

I am using libs disguises, so idk if that could be what is using that

sly topaz
#

if you're using libs disguises and it is throwing that then it is probably just the fact that it is trying to apply an entity data packet which doesn't apply for the disguised entity

#

you could just ignore that error honestly

fossil cypress
#

Well the problem is

#

That when this error happens, the player gets disconnected

sly topaz
#

what entity are you disguising and to what?

fossil cypress
#

I have my own pvp minigame that disguises players as mobs with abilities

#

These kinds of disconnects have been happening since I updated it to 1.21 and it happens so randomly and infrequent that I feel like it’s impossible to fix

wet breach
#

or when you use the incorrect version of protocollib

sly topaz
fossil cypress
#

I am pretty sure libs disguises uses packetevents now instead of protocollib

#

My own plugin was remade from scratch to work on 1.21

#

Everything is as updated as can be and on 1.21.5

#

Do I require to specify a specific api version in plugin.yml for paper? or is 1.21.5 sufficient?

sly topaz
#

it might just be a bug in libs's disguises honestly, but it should be solveable, you just have to make it stop sending entity metadata packets which aren't applicable to the disguised entity

wet breach
fossil cypress
#

PacketEvents and LibsDisguises both work on the latest version as far as i know

wet breach
fossil cypress
#

I use a backup world system

#

No worlds get loaded until I tell them to

wet breach
#

ok? not sure what that has to do with saving data

fossil cypress
#

Unless you are asking me to physically go into every world that makes a copy to make sure it's updated for the latest version

sly topaz
#

unless it happens to try save the entity data while the player is disguised and the client gets confused somehow, I don't know

fossil cypress
#

I am not experienced enough to make my own disguise system like libsdisguises does, thats why I'm using that instead

#

I do notice that usually the same players get disconnected

sly topaz
#

besides, if it were a world save issue, it'd just throw an exception on the server and not disconnect the player

fossil cypress
#

I personally haven't been disconnected with that for multiple weeks, but some people have it way more often so it could be client related or lag or idk

wet breach
fossil cypress
#

Usually there is just some kind of desync between client and server for 1 specific player

#

Because when this happens only 1 person gets disconnected instead of everyone in that world

#

Its just really weird man

wet breach
#

try a clean world

#

bet no one disconnects

fickle mantle
#

Can anyone help me put Hex Colors in my scoreboard?

sly topaz
#

let me try reproduce the issue

sly topaz
wet breach
#

unfortunately if it is corrupted world data you will either need to remake the world or delete the affected chunks

fickle mantle
#

ChatColors.of()

fossil cypress
#

I do have to note that most worlds / maps that I use for my game are originally 1.8 worlds, but I converted them to 1.21.4 by opening them in singleplayer (they are void worlds)

#

But I really dont know how much difference this makes

#

I asked this in lib's support discord too, maybe they know something

wet breach
# sly topaz let me try reproduce the issue

so here is an example how you can get this to happen, lets say someone is disguised as an entity and the world saves, now that entity is saved in a particular chunk even though its a fake entity but the server does not know this. Normally this is not an issue because when the chunk loads again the entity should kind of disappear unless the player returns to the chunk that was disguised and the plugin decides to try handling it. But lets say you disconnected and then updated everything except the chunk. Now the plugin is trying to handle old data with new format

sly topaz
#

you can just run a server with --forceUpgrade or whatever to upgrade them from the server, should only need to be done once

wet breach
#

hence the integer to byte above

fossil cypress
#

And all worlds that people "play" on are copies of a template

wet breach
#

saving runs when you shutdown

fossil cypress
#

They get unloaded and removed when the server stops

sly topaz
sly topaz
#

the player exists on the server, the entity is just a projection on the client

fossil cypress
#

Arent the disguises purely client side

sly topaz
#

they are, for lib's disguises anyway

fossil cypress
#

I dont think the server itself has any cause on this

wet breach
#

it does

fossil cypress
#

It feels like the client so the game itself just doesnt know what to do sometimes

wet breach
#

I will just go to bed now, have fun 🙂

fossil cypress
#

I dont know if this issue was there when libs was still using protocollib

sly topaz
#

I strongly believe it is just a lib's disguises bug, I'll give my hunch a go and if it doesn't reproduce it I'll try what frost mentioned

fossil cypress
#

But it could very well be a packetevents problem

sly topaz
wet breach
#

it is simply bad data, it probably would go away if you removed the plugins and just loaded the chunks and let them save

#

server these days is pretty good at pruning

#

if the worlds that players are on are never saved and are merely always copies that get loaded from a template

#

that means it is the template itself that has the problem

fossil cypress
#

But I converted all of these worlds in singleplayer vanilla from 1.8 to 1.21.4

#

How would I remove the data

#

I got this response from libs:
So it's a race condition where the packet is being modified before the disguise packet is been processed
So it's modified for a player disguise when the player disguise packet hasn't been sent yet

rotund ravine
#

Why not just make a new voidworld?

fossil cypress
#

My plugin changes a disguise's appearance or pose sometimes so it's very likely that it gets modified while someone has lag

cinder abyss
#

Hello, how can I create a custom entity with a custom texture in 1.21.5 ?

blazing ocean
#

you don't

#

you can retexture existing entities

#

you can also use display entities but yea

cinder abyss
sly topaz
#

it is very tricky, not necessarily laggy though

#

people have done crazy stuff with display entities

cinder abyss
#

are there any github repo with custom mobs ?

quaint mantle
#

plus some mob for hitbox

blazing ocean
cinder abyss
cinder abyss
young void
#

guys if you want to develop a territory system alongside a gang war system how would you approach it?

#

it gets quite messy tbf

#

like
whats the best way to implement a war system which has a few rounds and you being able to replace the people in the war if you are the gang leader

#

need second opinion

#

the territory system is simple but i dont know whats the best way to implement the war system🤔

echo basalt
#

round object

#

containing a round player container

#

state machine for round management

#

action queue that gets processed when changing states

young void
#

👍

#

thanks

drowsy bramble
#

Im just doing this so i can get the paste link so please ignore me mods and others

#

?paste

undone axleBOT
mint nova
#

maybe its not like plugin development question, but how i can change arguments name from default? Like not to change it manually allways when im importing this method (like commandSender to sender)

eternal oxide
#

The simplest way it to implement your own wrapper Interface

azure vault
pseudo hazel
#

whats wrong with the name it gives you

azure vault
pseudo hazel
#

it tries to load any jar in the plugin folder

azure vault
#

yeah im stupid

#

thanks for the help!!!

#

it works now

azure vault
#

that pops up

#

that works

paper viper
#

Don’t drag the JAR like that, that’s not hot swapping but just very dangerous

azure vault
#

im not

paper viper
#

If you just press the button with the bug

#

And says “reload code” right?

#

Or something like that

rotund ravine
mint nova
pseudo hazel
#

yes

#

so then just change it

#

the name is based on what the interface calls it

azure vault
sly topaz
#

so, no you don't have to place anything, though you already figured that out

#

you may also want to use HotswapAgent if the anoymous class ordering becomes an issue at some point, they got a plugin to fix that allegedly

rotund ravine
sly topaz
#

also make sure to run your server with Jetbrains Runtime so that enhanced class redefinition is available

glad herald
chrome beacon
#

Use Orebfuscator

glad herald
#

already tried it doesnt help against chest esp

chrome beacon
#

It does

#

if you tell it to place a bunch of chests and dispensers etc

glad herald
#

i am pretty sure it doesnt support tiles

#

but i will try again xd

thorn isle
#

for lag and optimization related help, always include a spark profile

sly topaz
#

well in this case it's pretty obvious why it is lagging anyway

glad herald
#

yeah its because its always looping

sly topaz
#

more like the scope is too big

glad herald
#

what?

thorn isle
#

listen to when the player moves from one chunk section to another and obfuscate/unobfuscate the tiles in the adjacent sections accordingly

sly topaz
#

you are checking distance of every tile entity in every loaded chunk in every world

glad herald
#

yeah how would it be better? like idk

thorn isle
#

by not doing that

sly topaz
#

like vcs2 described

#

you may also want to use distanceSquared since that's more optimal

glad herald
glad herald
#

so i should use playermove event and not use it on enable?

sly topaz
#

you can use the player move event or if you really want to make it fast then you can just listen to the chunk data packet and modify it before sending it to the player

glad herald
chrome beacon
#

That code is easily bypassed

glad herald
#

oh really

#

so no chunk data packet

sly topaz
#

How do chunk esp hacks work

glad herald
#

i wanna bypass chest esp

#

not chunk esp

sly topaz
#

I had assumed it just scanned the chunk data for tule entities

chrome beacon
#

It does

glad herald
#

yes looking for tile entities

#

nd i wanna bypass that

sly topaz
#

Does the server send an entity spawn packet for tiles too?

chrome beacon
#

no

#

they're still blocks

sly topaz
#

So it just trusts whatever is on the chunk data

#

Player move it is then

glad herald
#

onplayermove makes no sense right

#

will that not cause lags?

sly topaz
glad herald
#

because its causing laggs i got told xD

sly topaz
sly topaz
chrome beacon
#

Just use orebfuscator

#

It's implemented properly

glad herald
#

already tried it doesnt block the tiles i just can spawn fake ones

chrome beacon
#

and did you configure it to block them

glad herald
#

its by default in the list

sly topaz
#

What I would do is modify the map chunk packet so all tiles are faked by default, except maybe the ones that are going to be near the player at the moment of replacing them. Then just send the real tile entity as the player gets close enough

glad herald
#

thats what i did but the problem is i implemented it so bad its causing lags and i dont know any more efficient way

sly topaz
#

Listen to the map chunk packet with plib

#

Then modify it from there

glad herald
#

so onpacketsending event?

#

packetadapter

sly topaz
#

Yes

glad herald
#

uhm okay

#

and it will always update the chunks?

sly topaz
#

The map chunk packet probably provides the tile entity data too

sly topaz
glad herald
#

i will try that rq

sly topaz
#

To avoid recalculating the fake entities every time, also introduce a cache so that players don’t constantly recalculate far away chunks

#

But get it working without the cache first

chrome beacon
#

Modifying the chunk is quite difficult and I wouldn't recommend it if you're now to packets

#

Which is why I recommend Orebfuscator which does it for you

glad herald
#

dude did u try orebfuscator urself or u just tell me to use it 100 times xD

chrome beacon
#

Yeah I've used it many times

#

It's also the most used solution for antixray and esp cheats

#

It's baked in to Paper as well

glad herald
#

paper has no anti xray for tiles

#

and used ore rn still could use esp

glad herald
# sly topaz Yes
 @Override
    public void onEnable() {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.addPacketListener(new PacketAdapter(this, PacketType.Play.Server.MAP_CHUNK) {
            public void onPacketSending(PacketEvent event) {
                Player player = event.getPlayer();
                PacketContainer packet = event.getPacket();
                int chunkX = packet.getIntegers().read(0);
                int chunkZ = packet.getIntegers().read(1);
                World world = player.getWorld();
                Chunk chunk = world.getChunkAt(chunkX, chunkZ);
                for (BlockState state: chunk.getTileEntities()) {
                    Location loc = state.getLocation();
                    Material type = state.getBlock().getType();
                    if (type != Material.CHEST && type != Material.TRAPPED_CHEST
                    && type != Material.SHULKER_BOX && type != Material.BARREL
                    && type != Material.ENDER_CHEST) continue;
                    if (player.getLocation().distanceSquared(loc) > 100) {
                        falscherBlock(player, loc, Material.BARRIER);
                    }else{
                        echterBlock(player, loc);
                    }
                }
            }
        });
    }

thats how i did it now i still can see everything

chrome beacon
#

You're not modifying the chunk packet

#

and you're sending the block change to early instead

glad herald
#

here i am changing them aint I ?

 private void falscherBlock(Player player, Location loc, Material fakeType) {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        PacketContainer packet = manager.createPacket(PacketType.Play.Server.BLOCK_CHANGE);
        packet.getBlockPositionModifier().write(0, new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
        WrappedBlockData wrappedData = WrappedBlockData.createData(fakeType);
        packet.getBlockData().write(0, wrappedData);
        manager.sendServerPacket(player, packet);
    }

    private void echterBlock(Player player, Location loc) {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        PacketContainer packet = manager.createPacket(PacketType.Play.Server.BLOCK_CHANGE);
        packet.getBlockPositionModifier().write(0, new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
        WrappedBlockData realData = WrappedBlockData.createData(loc.getBlock().getBlockData());
        StructureModifier<WrappedBlockData> write = packet.getBlockData().write(0, realData);
        manager.sendServerPacket(player, packet);

chrome beacon
#

No

#

You're sending a different packet

glad herald
#

oh man

#

but i cant send also packettype.play.server.map_chunk at the falscherblock event?

chrome beacon
#

You need to modify the existing packet

#

not send a new one

glad herald
#

so i need to get the rawchunkdata first?

#

getbytearray

chrome beacon
#

as I said it's not easy to modify the chunk packet

#

I do not recommend it for a beginner

glad herald
#

well

fickle spindle
#

can i set like 2 hunger bars?

paper viper
#

Maybe we can figure out a solution that can replicate it

fickle spindle
#

just curious

paper viper
#

What’s life steal with the hunger

fickle spindle
rough ibex
#

yeah but you can't have more than 1 hunger bar

paper viper
#

But you can’t have more than 1 hunger bar like butter said

#

I’d recommend using the action bar

fickle spindle
#

so u mean only 1 row or i can have more row?

echo basalt
#

you can emulate it

zinc moat
#

Hey i need recomendations for a gui library

echo basalt
#

Depends on your needs

#

TriumphGUI is a pretty popular minimalist lib

#

there's IF, InvUI

zinc moat
#

Just trying to make a small shop gui with a CoinsEngine as currency manager

chrome beacon
#

Could always use

#

?gui

zinc moat
#

alright thanks i think im going to try out IF

#

it fits my needs

buoyant viper
#

Player#sendBlockChange or whatever

earnest girder
#

I'm having an issue with PlayerDeathEvent tracking the killer

PlayerX launches a custom projectile (projectile's shooter is set to PlayerX) and hits PlayerY.
ProjectileHitEvent damages PlayerY via: playerY.damage(damage, projectile)

However, in PlayerDeathEvent, event.getEntity().getKiller() returns null

Is there any way to make spigot recognize the killer as the shooter of the projectile that caused the death?

eternal oxide
#

Why are you manually damaging the player in teh Hit event instead of changing damage?

#

change teh final damage in teh damage event instead of messing with the Hit event

vague swallow
#

?paste

undone axleBOT
vague swallow
#

Hey guys, this is my code: https://paste.md-5.net/igegonofuh.cpp

so I got the following problem. The method is supposed to rotate the vector currend into the direction of the vector target. the rotationSpeedInSeconds tells in how many seconds the vector would do a 360° rotation if he wasn't stopped by reaching target. the method works fine except of one thing:

For some reason the up/down rotation works only until a certain angle. It dosn't pitch higher or lower than that angle. The angle depends on the rotationTimeInSeconds. If the rotationTimeInSeconds is 0 then the rotatation works perfectly and the pitch is as it should be. But as soon as rotationTimeInSeconds is higher then 0 it cannot exceed a certein angle that gets smaller the bigger rotationTimeInSeconds gets.

#

green in the target vector, blue the current vector, red is the axis and yellow is the outcome that doesn't tilt upwards more then the angle you can see in the screenshot

split gull
#

is there a way to have bstats included in my plugin but only work if the plugin is standalone? (not shaded)

also lmk if this isn't the correct channel to ask this

split gull
#

yay

sly topaz
#

As for the question, just have the bstats initialization be at onEnable

#

Whatever plug-in is shading yours isn’t going to be calling onEnable manually so it should be good

split gull
#

alright, thank you

pure dagger
#

is 0.0004 too little for config double value

#

?

#

whast that

chrome beacon
#

0.0009 you mean

lost matrix
#

This is 9 * 10^-4

pure dagger
#

why doesnt show normally

pure dagger
#

in my config

chrome beacon
lost matrix
#

Scientific notation is shorter at a certain point. It gets formatted when your values get too small.

pure dagger
#

if i send it to player

#

will it be like that too lol?

#

how to turn that off

lost matrix
#

Depends how you send it. Its completely up to you

pure dagger
#

oh yeah, you put stirngs there

#

how to make it normal

#

didnt know about it

#

ok i know

slender elbow
#

MessageFormat is love

stuck oar
#

how can i use a texture on a playerhead block that isnt tied to a minecraft player?

chrome beacon
#

All skins are tied to an account

#

but I assume you already have the skin data and are looking for this;

#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

thorn isle
#

there are also services where you can send a .png to and the service will use an account from a pool to set it as the account's skin, and will return you the url to the skin texture that you can then apply to a player profile to spawn in a textured skull