#help-development
1 messages ยท Page 802 of 1
wtf is this
Worked in 2020
Plugins?
This looks like a very, very bad developer "fixed" a nullpointer exception by printing out its type
your browser is probably removing it
its probably in a custom plugin
@exotic obsidian no dms thx
but the NPE isnt logged by my shit
im pretty sure
packets are fun
this is the client error which comes along with the server error
yeah its not
it could be protocollib or mojang
being funny
well its most likely an error by me but theyre not helping with debugging
Call getHikariPoolMXBean() on your data source and check the stats
There was one written in java, which i cant remember.
And there is Mineflayer ofc. (PrismarineJS )
https://imgur.com/a/NNLqx6d ok this line is giving me a massive stacktrace for some reason, any idea why that could be?
Chat GPT says something related to NullPointerException
What does ur plugin.yml look like
Asking chatgpt to read stacktraces literal genius
ACF/cloud ๐
Is it Illegal access or illegal state when constructing a util class
ok everything works thanks
?
nah the constructor usually still has an exception
i usually do unsupported operation
if i do it
which is like never
@remote swallow i have find problem: this is a "test" word created with Commands. if i do with API dont write in worlds.yml. How i can resolve it?
lets fucking gooo packet based flicker free async scoreboard sort of works
well
almost
as cu can see it needs some more work
It does nor seem to know the uptime
nah thats a different issue tho
what is the uptime then
idk what nanoTime() returns
is it all of them?
nanoTime is probaby either epoch nano or device uptime
probably
thats 3 and a half months
so ig i havent restarted my vps in 3 months
anyone know what this 40 character limit refers to?
something with the scoreboard im pretty sure
length of a score name maybe?
ok appereantly it was the max length of a score but idk how that happened because its still longer than 40 chars im pretty sure and it works
@lost matrix done
i'm trying to make an anticheat and i need to get every packets not just one
and no i'm not using bukkit events to make an anticheat because spartan ๐
Subscribe to each packet one by one
Noice
You really really dont want every packet
anyway to get their client side id?
or do i have to do it myself that 20 is 03 on the client etc?
What id are we talking about
youre using protocolllib right?
i think he is talking about the client protocol name or something
yk most hack clients dont change that lol
bro they are so ugly
who animated these shits
some dude
I wonder who that could have been ๐ค
don't feel like digging up some dude's name just so some other person can dunk on them
You can try:
https://github.com/retrooper/packetevents
Wait, it wasn't you?
Its by @alpine urchin and is already used by anticheats
no
I'd say if it was, I don't give a shit if you think my models are bad
I'm not a modeler
hell I think my models aren't great
I thaught it was you, cause I saw you in the blockbench dc asking for help with rotations
this is one of mine
I'm not trying to be a modeler
you know what I just don't give enough of a shit to justify myself to you, you think what you want
these needs more texturing
they look too
symetrical
the dark bricks are very nice though
and the green on it looks really nice as well
its just the places u put the green
and the way u did the edges is the issue
everything else looks very nice good job
oh and also
ur flag is too noisy
lots of beginers do that to add like more texture to it
but it just makes it look noisy
I can see at the corner of my eye you're typing, I'm not reading any of that
thanks for the plug there
Why is ItemMeta#getLocalizedName() empty? I need to get the name of an item and can't use the material type, since it does not always translate to the english name.
@quaint mantle if you opt for my library, we have a discord with support
is ur library better protocolib
Lol
^
you don't ask md_5 if spigot is better than paper
cause it will definitely involve some bias
but i made my library for a reason, and it's not just a knockoff
bro
i didnt ask u to rate it
i asked u if it was a better version of protocolib
as in
does it do the same thing
as protocolib
no it is not a better version of "protocollib"
ok
it's not a version of protocollib
technically it does, and i'd argue more
?
Banned
^
Perhaps a better question is asking the advantages and disadvantags of using packetevens over protocollib
big plugin owner ego smh
can someone explain why using interfaces is useful? why would i want to declare some empty methods?
bruh
im jk chill
best spigot plugin owner
it would be a better question
yeah
cause i don't think protocollib is bad
i used to use it in the past
then i decided to make my own library whilst developing my first anticheat
then i decided to dedicate the rest of my time to the library alone
so i was in most of your shoes
blud calling us poor and stupid
?
Protocollib is so bad that i excuse verus
took it too far ๐ญ
You use interfaces if you only care that certain methods are implemented. However, when using interfaces, the specifics of how they are implemented doesn't matter to you.
So lets say you want to create a method with which you equip an item to an entity. You don't care what entity it is, as long as there is an "equip" function. So you could define an interface called "EquipableEntity", which has a function called "equip(ItemStack item, EquipmentSlot slot)".
Then you OR other developers can implement their own ways of equipping an item to an entity.
i actually have 80 million players on my roblox game
but ok
let me give you an example
you can have an Entity interface, which defines a method called walk(direction)
you can have two different entity types for example, player and pig, and these subclasses can define movement differently
forexample a player could walk 2 blocks instead of 1
so you avoid many unnecessary if statements
okay thanks
the principle/walk feature is a general feature of that entity, but how it is implemented differs
@inner mulch
its like hiding what it actually does from the user code, allowing you to swap in different implementations
please use interfaces
okay
you get the examples right
yeah i need to implement it every time
This guy is much better than Dusk thank god ๐ช๐ป
I find interfaces, personally, only really useful when you want to show intend/force someone to do something in a certain way. Very useful and neccessary for APIs. But in my personal code, I mostly only use it for design patterns.
what do you mean by this?
"force someone to do something in a certain way"
As in the methods a certain class has to have.
So they HAVE to have this method, otherwise my functions won't accept them
but yeah it's really useful for API's, especially when you're dealing with a multi-module project, you can't avoid it.
you can have an interface of something, and need to implement how that operation runs on different platforms.
i see
and the more you use interfaces, the easier it is for people to modify the implementation of your library.
really useful for real
That's why my main point was "intend", cause the dev who is implementing the code has to work with the data I provide. If I don't provide it, well... then they can't do much.
yea
i recently dealt with ajar which had no source, many parts obfuscated
luckily the implementation i wanted to change used interfaces
using reflection you can modify how interfaces are implemented
real handy java feature
reflections are sick. I often just use it with static code analyses or annotation helper features.
yeah
sometimes people urgently wanna use unmaintained software
and ask you to fix it
๐คทโโ๏ธ
gotta do what you gotta do
Or decline; Except if it's for work... well you gotta suffer through that then
was a commission
so yeah i could decline it
but im not complaning, just justifying use of reflection
hard obfuscation messes with recaf recompilation of jars
so i had limited options
Good chat, Ima head out. Gn
good night
brooo wtf is this now
right quick, player fps can be affected by packet volume received right
i mean
depends what kind of packet
but they should all probably eventually lag the player
damn people are not even free to make their own textures in mc now that there are actual rules to it
๐
who's gonna stop people realistically
on another note my chess project finally works,
as a standalone jar
It's a guide not a requirement
hi guys I need to keep a chunk loaded always, how do i do that?
No one at mojang is gonna stop you from texturing kelp weird
funny to see yall that need to boost ur ego lol
Hello,
I am trying to write a ban command and I am using SQLite to store data. The data stores perfectly fine but when it comes to retreiving the data it seems to just wak out.
Here is the error I'm receiving.
[22:01:21 WARN]: java.sql.SQLException: Database connection is null or closed.
[22:01:21 WARN]: at plugin-1.0-beta.jar//xyz.jellyfishhosting.plugin.events.JoinEvent.getBanInfo(JoinEvent.java:82)
[22:01:21 WARN]: at plugin-1.0-beta.jar//xyz.jellyfishhosting.plugin.events.JoinEvent.onPlayerJoin(JoinEvent.java:35)
[22:01:21 WARN]: at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor81.execute(Unknown Source)
[22:01:21 WARN]: at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77)
[22:01:21 WARN]: at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81)
[22:01:21 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[22:01:21 WARN]: at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[22:01:21 WARN]: at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
[22:01:21 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615)
[22:01:21 WARN]: at net.minecraft.server.players.PlayerList.a(PlayerList.java:346)
[22:01:21 WARN]: at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.a(ServerConfigurationPacketListenerImpl.java:130)
...
The line that it is throwing the error at is
statement = connection.prepareStatement("SELECT * FROM bans WHERE player_name = ?");
The full code is
private BanInfo getBanInfo(String playerName) {
Connection connection = SQLiteConnector.getConnection();
PreparedStatement statement = null;
ResultSet resultSet = null;
try {
if (connection == null || connection.isClosed()) {
throw new SQLException("Database connection is null or closed.");
}
statement = connection.prepareStatement("SELECT * FROM bans WHERE player_name = ?");
statement.setString(1, playerName);
resultSet = statement.executeQuery();
if (resultSet.next()) {
String staffMember = resultSet.getString("staff_member");
String reason = resultSet.getString("reason");
return new BanInfo(playerName, staffMember, reason);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (resultSet != null) {
resultSet.close();
}
if (statement != null) {
statement.close();
}
// Note: Do not close the connection here to keep it open for later use
} catch (SQLException e) {
e.printStackTrace();
}
}
return null;
}
Here is the SQLConnector code:
private static Connection connection;
public static Connection getConnection() {
if(connection == null) {
try {
Class.forName("org.sqlite.JDBC");
connection = DriverManager.getConnection("jdbc:sqlite:plugins/Jellyfish-Hosting-Plugin/punishments.db");
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
return connection;
}
public static void closeConnection() {
try {
if (connection != null && !connection.isClosed()) {
connection.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Any help will be appreicated.
ayo what's the latest guidelines on creating entities with custom hitboxes?
still has to be custom entities using nms code for that right
bro fym
he is
using a minecraft textureback
and the models he make doesnt fit everything else
i sent him a guide to help him fit his models into minecraft
if he had like one of those hd rpg texturepacks
then thats different
is it ok if a Repository class loads files
its just that i feel like that's what a DAO class is for
it should
but it depends when you modify the bounding box, since an entity move also modifies the underlying bounding box
again, depends on when you call it. If you call it before an entity move is done, then your bounding box will disappear at the same tick
I guess it's not too hard to just modify the underlying dimensions field
I mean what you can do is constantly change the bounding box, but I do not recommend it if it's not needed
what do you need that for exactly?
ah I see
I'll just modify the dimensions
and the issue at hand is that this method is not changing to your desired hitbox?
I've not attempted it yet, I'm exploring the ways I could do it
I mean you could try to set the bounding box, I do not know how it behaves with custom models
I guess it's worth a try
is Eclipse better than Intelljij
aw man what
some people prefer the file structure of eclipse, but IntelliJ is probably objectively more modern but also more bloated so to speak. I'd recommend IntelliJ 10/10 times
if you want to go crazy, go Vim
thanks
hm should be fine I think for my use
already had Inlellij just wanted to make sure
alright let's try modifying this private field, what could go wrong
is anyone able to help??
yeah I mean if you find a work around that does not involve having to use reflections / method handles to get to what you want it's probably much better. Reflections are kinda slow too, but that doesn't really matter in an environment where you have 50ms between server ticks
if it becomes an issue I'll investigate an alternative but right now I'm just in a prototyping phase, and ultimately this should really not be running that often
I mean you literally have the issue in your code. You throw an exception when the connection is closed. Did you ensure that your connection is not null and got established in the first place?
fundamentally there's only so many custom models servers can handle in the first place
and it's not quite so many
last time I did the math, unoptimized it was about 14k armor stands I think
and that was on a minimalistic setup
Yes the SQLiteConnector.getConnection() is what should establish the connection.
yeah im not into the custom model stuff if im honest, I was really active in minecraft development back in legacy versions and now I am back at it since I have a big and quite sensitive project going on
so don't take my full word on it, I am not soo familiar with the new apis
yes but are you sure your connection was actually established, as in no exception was thrown / closeConnection wasn't called by the outside.
I assume so, going over it in spigot's source it's also for some effects
I assume in the client it is also for animations but dont take my word for it
i mean bukkit is basically a 95% copy (structurally) of minecraft's actual source code
sometimes I wish it was a better copy ๐ฅฒ and sometimes I wish it was a worse copy
Is what it is, I am thankful for it to be similar makes my job for the project I am doing right now much easier
So I don't have to debug Minecraft's source which takes ages to compile
yk what, ill go with eclipse i messed around and make intellij use kotlin and i dont know a tad bit of java im just a beginner maybe ill switch to IntelliJ some time
Yeah I mean I begun with eclipse too. Go for what you feel most comfortable with as a beginner doesn't really matter too much at the end
Most modern tutorials will be written or recorded with/about IntelliJ tho so care for that
@final wharf
im looking at one in eclipse made by Alex Lee
tyhe 14 minute one
iirc if I'm using remapped mojang values I need to access the field without using the remapped name right
I need the obfuscated name?
some people say that protocollib is bad
I'm sure, but I just need the one value
protocollib is amazing
It contains reflection matchers that make it easy to find your target
Also it contains a strong base, but by far not everything
I mean surely you could gain more performance with using more low level stuff like method handles instead of a general introspector kinda thing what reflections represent but honestly it doesn't matter too much in the end
Premature optimization is the root of all evil
A wise man said
Then create a helper function to find your target value no?
I rarely use reflections, if I'm setting a field that is an object it asks for Object obj and Object value, is that first object the original object?
First object is the accessor, i.e. the instance that owns the target attribute
Second is the actual value
so in this instance since I'm modifying entityDimension in entity that first one would be entity?
If you want to set a field for an instance called object, then you want to pass object as the first argument
yup correct
nws
The object is basically the virtual pointer to where the fields lay in the memory, the field is basically the offset upon it but don't take my words for too granted been some time since I used java
what do the cool kids use to check remappings, I remember I saw a link posted for it a few days ago but I seem to have lost it
I know I can get the official mojang ones but they're not great to follow along
oh it might've been mini's mapping viewer
no wait that's for spigot
What do you need exactly
something that will show me how they're getting remapped so I can check what field I need for each version
So I am currently using the following method to get the name of an item stack.
TranslatableComponent(item.type.translationKey)
This works quite nicely, because it successfully translates for example COAL_BLOCK to Block of Coal, but in case of TIPPED_ARROW, it does not get the type of arrow. I'm assuming this is the same case for potions. Is there any way to get the full translation for this? Example of what I mean:
Mhn good question I basically just decompiled every version and checked it manually, didn't know there was mappings public for Bukkit ๐
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
Damn all that work could've been saved
why does my command error?
ik its the target or smthg
but idk how to check with it
even without this, mojang publishes them
Well what's the error
Honestly didn't know that, how cool from them
Wasn't a thing back in legacy time I think ๐ญ
it's a bit obscure, the link to the website page is hidden in the minecraft installation files
yeah it's relatively recent
depends on what you'd call legacy though
< 1.13
mappings were added in around 1.16 iirc and spigot added support in 1.17.1
yeah I've been around since infdev and never really stopped, though not always as a dev
That's when Minecraft introduced a lot of new things at least by the looks of the sources
Xd
shhh we call it legacy here we can't let people thinking using 1.8 is okay ๐ฅฒ
What would that make 1.8--
Honestly so many servers still run 1.8
actually not really luckily
if you look at bstats
I mean surely they just use Via version nah?
hopefully that version eventually burns into the ground
via doesn't spoof that
Ah okay
ViaBackwards is severely limited in what it can support
that viabackwards exists at all is already insane
yeah, it's pain in the arse to make systems that heavily rely on the clients input for all versions
It differs from version to version
I don't think there's any other game out there that has been modded so thoroughly the community has made patches to allow past and future versions to run on the same server
ayone knoiw how to make custom creatures like completly custom including ai, being able to fly, swim or walk (or multible) and everything else a creature needs
Yeah it's quite nice
That's a lot of questions you asked with one
then again I'm throwing my hat into the ring by making a FOSS way to add custom models to the game
Make sure entity classes that extend NMS ones
ik
And then override all the various methods
And then hack them into the registry so they persist restarts
yeah it's really cool, when I first saw custom models it amazed me how the game developed (pun intended) since the legacy versions
Could anyone help with this?
man if 1.13 is legacy what does that make me
It is officially called legacy in spigot forums
that doesn't make it right
That's why I call it that, I've been around since 1.8 beta
if it makes me feel old then it's wrong
I'm not old, I'm a spry young lad
well how you define young is the question
Alright sir ๐
please, sir was my father, call me Mr. Sir
thanks, that was very on fleek of you
No worries my little bri'ish lad
Now you are asking yourself how I knew you were British, well do you know these geoguessr pros? Yes, I am not one of them!
I've always wanted to meet someone who's not a geoguessr pro
we have so much in common
geoguesser isn't streamlined anyway
I have a far more streamlined version of geopolitics where we go back to having a big pangea and just the one country and I get to be the king
it will make things much easier
Yes my mr sir ๐ซก
actually let's update that to Mr. Sire, I'm feeling regal
My Lord I would do anything for you can you please assign me work to finish for my great king of spigot
Btw we should not use this channel for this shit chat feels odd ๐
So I am currently using the following method to get the name of an item stack.
TranslatableComponent(item.type.translationKey)
This works quite nicely, because it successfully translates for example COAL_BLOCK to Block of Coal, but in case of TIPPED_ARROW, it does not get the type of arrow. I'm assuming this is the same case for potions. Is there any way to get the full translation for this? Example of what I mean:
im so confused https://iraz.insane.rip/๐ธ/u1qs0zxb.png
its just a simple print
wtf
oh
im stupid
didnt add string thingy to it
well
this is very weird
my reflections are saying that hte be field does not exist
but I am pretty sure it does exist
so https://piston-data.mojang.com/v1/objects/73c8bb982e420b33aad9632b482608c5c33e2d13/server.txt that's the official mojang mappings net.minecraft.world.entity.EntityDimensions dimensions -> be is what I am trying to access with
public static boolean setCustomHitbox(Entity entity, float width, float height, boolean fixed) {
EntityDimensions entityDimensions = new EntityDimensions(width, height, fixed);
Class<?> entityClass = entity.getClass();
try {
Field field = entityClass.getField("be");
field.setAccessible(true);
field.set(entity, entityDimensions);
} catch (NoSuchFieldException e) {
e.printStackTrace();
return false;
} catch (IllegalAccessException e) {
e.printStackTrace();
return false;
}
entity.setBoundingBox(entityDimensions.makeBoundingBox(entity.position()));
return true;
}
thoughts?
and I am certain it's 1.19.R3
How can i pring 2 lines?
it gives me errors
oh nvm
im just stupid
wanted to send a string
but didnt put it in ""
should I throw exceptions like this?
Generally you should make some kind of specific exception
Or just let it throw the original one
yeah but this is like a
one error fails everything
like it cannot physically recover from it
Try getDeclaredField
Depends, does it break your code? You only throw an exception when code flow is disrupted
nah im saying is it ok to throw out a plain top level Exception
luckperms does that im pretty sure
Thatโs not really good practice
well im dealing with like a abstract database
and so I have
method() throws Exception
Create a DatabaseException then
When you catch that Exception you catch all other possible ones with it
Or depending on context use something like IllegalState
why didnt luckperms do that
@torn badgedo yk if a repository class should handle database stuff
or should it be more of cache
Where do they do that? Let's see the link
1 class should handle 1 thing
ok then would something like a proxy make more sense
if its a DAO
then I use a proxy for it to cache stuff
the reason I used a repository is u register and get stuff from it
and it has a cache at the same time
am i missing something with ACF here? ```java
// onload
BukkitCommandManager manager = new BukkitCommandManager(this);
manager.registerCommand(new ToggleBuild());
// ToggleBuild.java
@CommandAlias("cbreak")
@Description("Toggle custom break logic")
public class ToggleBuild extends BaseCommand {
/* Main Command */
@Subcommand("toggle")
@Description("Toggle custom break logic")
public void onToggle(Player player) {
player.sendMessage("test");
}
}
because /cbreak aint registering
Shouldnt there be a tag for the name as well?
Idk how exactly acf works. Just know alias is not the command itself
alex sent this example earlier and it doesnt seem like it
oh wait
its erroring lmfaooo
my bsad
๐
well im not sure how to fix that actually
the error is related to shading
im getting java.lang.NoClassDefFoundError: co/aikar/commands/BaseCommand right
but my shadowJar config is gradle shadowJar { relocate 'co.aikar.commands', 'net.craft2.seggswhen.acf' relocate 'co.aikar.locales', 'net.craft2.seggswhen.locales' }
and i added build.dependsOn shadowJar
but the build isnt shaded still
and im a bit confused because im also using NMS
so im not sure if the nms plugin can even remap the shaded jar
well actually no it doesnt
how would i be able to make it remap the shaded jar?
ask chat gpt 5 instead
LMFAO
4*
go back to eating ur sandwich
stfu
bro cant even add a toggle ๐
why are u doing it on seggswhen
is it different
WHAT AM I SUPPOSED TO DO WHEN THEPLUGIN ASSUMES THE DEFAULT BUILD IS THE RIGHT ONE
also u broke the noteblocks
yeah i broke the plugin
You would have to do this part of the shading process but before it packages everything
Not sure if gradle can do it. I know maven can
๐
whats acf
Aikairs command framework
I think they were just trying to get the hang of it first
yes but im gonna use acf anyway
Right now yes
Can you have two remaps?
but it still doesnt know to remap the shadowed jar
๐คก: use maven
Anyways got to drive to work
drive safe
Driving unsafe tends to be more fun
Probably wont, people drive to slow to allow me to do such things
fixed it with groovy tasks { remap { version.set("1.20.1") inputTask.set(shadowJar) } }
if u was a real unsafe driver ud drive thru them
wow pro developer
thank u
MY pro developer
im not sure if thats supposed to be a sweet message or a slavery message
its a sex request
dms
lol
ok daddy ๐ฅฐ
you seem to be mistaken
you seem to be hoeless
so, if i were to get you, does that mean you're a hoe? ๐ค
id gladly be a hoe
I sense a disturbance in the force, like mods not being around to moderate chat
mood
I SENSE A PERSON WHO CANT TEXTURE
my bad @torn shuttle :(
@worldly ingot I pinged you, it's your problem now
oh no that's not the reason
are u hiding from me :(
it's because then i have people i don't want to DM me thinking i'm available ๐
then ignore them
that's what i do
i have like 70k friend requests
:(
cha cha real smooth
i dont get that many dms
can i be 70001?
hf
i can be whoever you want me to be
ye thats pretty clear
md_5 should be on my friend list but ye
what even is the max lol
okok accept
1k for me rn
interesting, i'll make sure to forget that fact by next week
ill remind u just to feel good about my self
๐ซถ
hm that should've worked but it didn't
it should just be a private field
Print out the field names
If it's mapped by CraftBukkit then the mapping will stay
Unsure if CraftBukkit maps that field but it's something to be aware of
Best to just open up the compiled Spigot server and see what that field is called
pretty sure everything except the several class names is reobfuscated now on the server
U uh
u gotta put that in a method
the sysout that is, the String declaration can stay where it is
Is there an actual way to determine if a player actually damages an entity?
For example, if I swing my hand (left click) to attack an entity, that's actually an attack
But if I do <LivingEntity>.damage(0.01, <Player>); then the game thinks I actually attacked that entity
What do you want to do?
Just to detect if a player damages an entity by left clicking it
EntityDamagedEntityEvent
And cast to player
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
This method does damage to the entity. Are you actually wanting a way to determine where the damage came from?
Technically yeah, is there a way to tell if it came from a plugin if the damager was set to a player?
Not really. So how you need to do this is make a global list that holds entity uuid. Add the entity to said list when your plugin does damage. And you would check from that list and what not. The better version would be to extend upon that and create a custom event that extends the entity damage event which would make it easier in a way.
Hope that helps you come up with something 
Is there any library for getting player's input from chat or sign?
the line changes well, thank you!
is there a way to set the textdisplay to be seen from all directions?
wtf is a panic goal how does a creature panic
oh that makes sense
how would i make an entity defend it self like a wold
wolf or lama
cant find a goal for that
Well, what goals does wolf have
not sure where to check
this whole file structure is confusing me
many it seems
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal(this, Player.class, 10, true, false, this::isAngryAt)); this maybe?
That makes a wolf attack a player if it's angry at it (i.e. a non-owner player hitting the wolf)
So you want it passive unless you hit it?
That would be it then
got the other two alread<y
Polar bears should have a similar goal
they also get agressive when u hit their kids
HurtByTarget goal is what it uses to take revenge
thx coll
not really sure what to pass in xd
doesnt let me look at it
nvm
now it does
still no clue what it wants
it should work by itself
most goals work that way I reckon, they work independently but like, target goals set the target entity, and then some other goal will read the target entity and do sth with it
nm is net minecraft i know that
server or source iirc
๐ซ
i just call it net minecraft server ๐คทโโ๏ธ
even though most of the packages aren't in nms anymore xD
yh thats why i was confused xd
They used to all be!
just started using nms now and enver saw the old file structure
minecraft does like combined server and client for many things
beast
spigot at their naughty relocations!
my brain is exploding rn
NMS IS SO FUN
i have a bucn of random creaures
are you enjoying yourself
all of them have custom models
so my first plan was to use the same entity type for all
cause easier
because i want to be able to add more entitys in the config
but
now
i need entities that fly, entities that swim entities that walk
AND ENTITIES THAT DO MULTIPLE???
how would i achive that
sounds like you need a little data oriented* development in your life <3
it can be nice to extend ur own entity class
and then translate that into an existing entity type at packet level or sth
and then u'd basically define ur own move control etc
that sounds like a lot of work..
nope
guess what
mojang has written code for it
that works relatively nice
so just merge it essentially
can i just make a normal entity
be able to fly
and walk
like
can i take a wold
wolg
wolf
and give it the ability to fly
I mean at the end of the day its AI is just a bunch of goals
yeah or well the more modern entity behavior api consideres memory (basically a hashmap of states) and activities (basically just runnables and predicates)
well sensor types also (trigger points basically)
well its not too hard to code
I think u'd prob wna write a custom goal for it tho
im gonna cry myself to sleep tonight
this is too much custom for my brain
custom this custom that
i might as well just remake minecraft
true lol
its basically a game engine if you abuse it enough
i think we have been abusing it for quite some time
what difference between target selector and goal selector
if both pass in the same shit
for example you can do custom blocks really nicely with display entities and then register it to the minecraft registry
well
its like having 2 threads
one that actively tries to determine the target entity
one that actively tries to determine what the entity itself should behave like
which one do i use where here
if u wanna set the target
that is lets say the owner
or what entity to attack
then use target selector
else dont
Do spigot has entity goal api or just nms?
nms
just nms spigot has no entity goal API
thats for the better
mostly because it'd be something thats hard to implement into spigot
Eh
maybe some API for that would be nice once it fully releases
as far as i understood the main reason spigot never got is it that it was obfuscated
until recently
anyway drvoss, the target and goal selector system is gonna be removed in the conceivable future as its design lack sophistication regarding more complex entity behavior
yea
well its alr fully released
just hasn't been fully migrated
worlds first conclube PR incoming?????
a lot of entities still use the goal and target selectors, many goals havent been ported to activities
lmao
mayhaps
i wouldnt mind
I need to make better tooling for my spigot fuckery still, but I have a comission to finish first
lol does it?
for example allow making snapshot releases
ugh I just changed it I think lol
i have it so u cant see the file, since many commissions dont want that
understandable
tho this is more of a labrat project :>
but yeah drvosss, gl
id advice u to look at modded entities
since there are a lot of mods that have entities that both walk and fly
nicee
well I think the goal system had a lot of issues that the brain system addresses acceptably
needless to say it isnt perfect
Itโs also only on like 10 entities
not every brain is as simple as yours
well i wouldnt b surprised if its gonna be ported in near versions
I mean they havenโt done it yet
coll we can express you with goals API, but some of us need brain API to function
And itโs been several years :p
yeah, but its not unreasonable for them to commit to such a change
i think the biggest caveat with the goal system boils down to why a target and goal selector specifically, like a target to attack is not the only type of data u'd want to calculate in parallel, other targets such as look target, owner, follow target etc. then other data that is just brain/goal/behavior related
?
who eats blocks
well ill go to sleep now
maybe someone can help me with custom goals tomorrow
uwu
it takes a mob
and it needs the mob so it can announce that the grass eat thingy happened
Sheepies
How can i silently execute console commands? I have a list of commands that i want to execute from a list.
for (int i = 0; i < rewards; i++) {
if(commandList != null) {
for (String command : commandList) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(),
utils.s(player,
//Replace Plugin Placeholders
command.replace("{player}", player.getName())
.replace("{times_rewarded}", String.format("%d", rewards))
.replace("{minutes}", String.format("%b", duration))
)
);
}
}
}
So far i've got it to execute commands but they are outputted in the console
This might be useful https://www.spigotmc.org/threads/executing-commands-through-console-silently.350470/
Get the bukkitcommand object from commandMap then execute "execute(sender, label, args)" method
Method itself does not log
dispatch does
equals of the Inventory class takes into account the location where it is located, right? Will 2 inventories opened in different locations be equal?
I don't think it's compared by the location.
Bro most of replies are filter the log or cancel send message ๐
Performance overhead
Oh, Alr got it
what to do? Why does a click on player inventory have its own location despite the fact that another inventory is open?
I have a system for getting the inventory need based on the location where the click occurs
your implementation is inherently flawed then
sounds like that system could be spoofed pretty easily
this will be very bad for someone who tries to put an item via shift into that inventory where it cannot be put
oh wait by location you mean slot
slot has location? i use inventory location
what do you mean by location
There is also https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/Inventory.html#getLocation() if you mean that
thats what i initially thought they meant
?stash
if that is the case using location to discriminate inventory is a bad idea
Well in that case it all depends on how Mojang implemented IInventory
Chances are it does take in account of the location, but I cannot say for sure
I tried to make the resulting chest inventory unique when clicked, but I didnโt know what to use as an Id, so I took the location
This is why this bug occurred
Are 2 inventories opened in different places but belonging to the same chest block the same?
IdentityHashMap?
I register inventory during opening
But no, do not.
Use virtual invs instead
Which are about as unrealiable, but that should work without breaking in the most unnoticeable way
The listener system was created based on a post from bukkit about the topic โmodern inventoryโ
but the problem is how to make the open inventory of the chest unique when opened
this is why i was use location
cuse how i undestand inventory not can be unique for the same block even if they are opened in different places
And that is why I recommend closing the inv and opening a virtual one instead
and how to get inventory where the player wants to put the item and inventory where he gets the item from
oh wait
I solved the problem
It turns out that the event has "2 types of events"
Oh I guess you could also differ by the inventory holder
I initially get the inventory where the click occurred, not the one that's open.
this is why i not can detect click
what are the advantages of using toml instead of yaml?
and is there something like BoostedYaml but for toml?
toml readability with multiple nested levels is also better imo
time to store data in toml
Will we get a bukkit config rewrite from yaml to toml with automatical conversion?
doesnt need a rewrite
just make a TomlConfiguration that extends FIleConfiguration
no chance
Bukkit is crazyy
does it support auto update?
Create an id system for the inventories, dont set a holder, put inventories in a map. Pick the one you want. They should be unique now with an easy way to identify them. 
What data is saved when a player is whitelisted? Is it possible to make up time in some way?
What does your connection url looks like
display.setItemStack(CraftItemStack.asNMSCopy(new org.bukkit.inventory.ItemStack(Material.GLASS)));
display.setPos(loc.getX(), loc.getY(), loc.getZ());
display.setCustomName(CraftChatMessage.fromStringOrNull("a"));
display.setCustomNameVisible(true);
ItemDisplay display2 = ~~~
send addentity packet ...
send meta packet ...
nmsPlayer.getBukkitEntity().addPassenger(display.getBukkitEntity());
nmsPlayer.getBukkitEntity().addPassenger(display2.getBukkitEntity());```
I made it as above, two itemdisplay overlap and board on top of the player's head.
Even if you put a slime with a negative size between the two displays, three overlap and go up above your head.
How can I fix this?
Is there anything i can refer to?
declaration: package: org.bukkit.util, class: Transformation
plugin devs when math is required โฐ๏ธ
bungee doesn't provide mysql. Need to shade it into your plugin
geometry is poggers
I can do fucking calculus but I couldn't tell you the area of a circle
My life as a geometry hater
calculate it using calculus then :^)
Pie multiplied by R squared
exactly
Geometry is css but in real life
Resident genius in chat
9/10 of us prob failed math
I'm doing just fine I just happen to be particularly terrible at geometry
So like I can do all the useless algebraic shit too :*)
I literally taught myself the maths I know let me be lmao
Trig math: ๐ฅ
enable ligatures and use !=
Thanks
Transformation doesn't seem to make the letters go up
๐ค ๐ค
But isn't it right to go higher if I board with an addpassenger?
player.addPassenger(display2);```
Even if you board it like this, it all overlaps with the player's head position.
Display entities have a size of zero
So they don't add any offset on their own
And I assure you transformation does work
Hi (Sorry for bad english)
What difference between List and Set?
why u not google it
\_/๐ง\_/
Thereโs a few
List is ordered and duplicates allowed, Set is unordered and doesnโt allow duplicates, then you do have SortedSet but thats that
Maybe its called NavigableSet idr
Seems like a dumb implem
Itโs just a List at that point ๐๐ป
idr the name of the interface TreeSet implements :> ยฏ_(ใ)_/ยฏ
I think it can make sense since tree set is basically a partially ordered set to some degree, where you can talk about order in a more relative matter (i suppose?)
Thanks
No
Youโre right
But its the best thing we have in java I believe
how to remove field from configuration section ?
set to null
oh thanks
how i can check when commandBlock is will activated?
event exists?
or this is like PlayerCommandPreprocessEvent
declaration: package: org.bukkit.event.server, class: ServerCommandEvent
oh this
Dont forget about time complexities too
List and Set says nothing about time complexity nor space complexity
Their impls do tho
Well the HashSet is the generaly most used impl ig but your right
Yeah I mean its fair since HS is the most commonly used one
and the command block takes into account whether the person who activated it has permission?
so when I want to take a function or code in general as a parameter I just make lambda expression?
Yeah
No
Thatโs a fair convention
java.util.function ๐คค
๐
so this mean i not can replace for exemple @s to nickname?
Can you retrieve the time when a player was whitelisted with spigot or coreprotect api?
java.util.function sponsors inventory pr 

Probably not? Depends on the cmd
hello, i need help with clicks listeners
@EventHandler
public void onPlayerClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_AIR || event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK) {
if (player.getInventory().getItemInMainHand().getType() == Material.WARPED_FUNGUS_ON_A_STICK) {
Lclicks.Lclick(player);
Bukkit.broadcastMessage("1");
event.setCancelled(true);
}
} else if (event.getAction() == org.bukkit.event.block.Action.LEFT_CLICK_AIR || event.getAction() == org.bukkit.event.block.Action.LEFT_CLICK_BLOCK) {
if (player.getInventory().getItemInMainHand().getType() == Material.WARPED_FUNGUS_ON_A_STICK) {
Bukkit.broadcastMessage("str "+event.getAction());
Rclicks.Rclick(player);
event.setCancelled(true);
}
}
}```
here is the code and down there is a video of what i'm doing (just spaming right click but detecting Left ones)
You
LClicks.LClick is run on right clicks and RClicks.RClick is run on left clicks.
how could he not realize that
me being dumb xDDDD (thx)
i inverted them all that's why i did not realized it
+bad at english
+idk my fking right and left in my own language (skill issue)
? Why
I wanna replace it with my own
I already have the intercepting filter
But each log starts with the player's nickname
And it would also block players who just said "joined with the id"
If I were to set it the regex
if i do something like config.set("players.foo",true) and after that config.set("players.bar",false)
bar replaces foo, how to make it just add field?
bar will not replace foo
you likely are not saving
or you are loading and wiping your settings
after any change you need to save
then something wrong is going on
man this is such a good idea
hope that someday spigot devs would implement it
but im not sure if that complies with TOS
why wouldn't it
I mean all you're doing is running stacktraces through a deobfuscator
If such a thing was against TOS by the same logic so would moj maps
bumping a problem from yesterday:
so https://piston-data.mojang.com/v1/objects/73c8bb982e420b33aad9632b482608c5c33e2d13/server.txt that's the official mojang mappings net.minecraft.world.entity.EntityDimensions dimensions -> be is what I am trying to access with
public static boolean setCustomHitbox(Entity entity, float width, float height, boolean fixed) {
EntityDimensions entityDimensions = new EntityDimensions(width, height, fixed);
Class<?> entityClass = entity.getClass();
try {
Field field = entityClass.getDeclaredField("be");
field.setAccessible(true);
field.set(entity, entityDimensions);
} catch (NoSuchFieldException e) {
e.printStackTrace();
return false;
} catch (IllegalAccessException e) {
e.printStackTrace();
return false;
}
entity.setBoundingBox(entityDimensions.makeBoundingBox(entity.position()));
return true;
}
thoughts?
it's telling me nosuchfield
1.20.2 magma?
the adapter should be running 1_19_R3 just fine
I have a 1.20 version of this code but I'm debugging 1.19.4 rn
https://mappings.cephx.dev/1.19.4/net/minecraft/world/entity/Entity.html other mappings page
version: 1.19.4, hash: ef099a9666
"be" shouuld be right, right?
yeah weird.
hrm
@torn shuttle What class is your entity variable?
return Hitbox.setCustomHitbox(((CraftEntity) entity).getHandle(), width, height, fixed);
import net.minecraft.world.entity.Entity;
What does handle return
hm, craftenitty
