#help-development
1 messages · Page 1273 of 1
what does it mean to walk backwards
Sorry if I wasn't clear
what's the best minecraft sound to mimic the sound before we're about to sneeze
like "ah-.. Ah.. ahh- " before the Achoo!
because it seems you're trying to make it look backwards while walking towards certain location from your code
Walking in a direction but facing forward towards the player
Opposite of where it's facing
Same thing I guess, maybe it's easier to implement if I describe it like that ?
then yes, you do want to modify the LookControl
I'm super lost looking at the look control class, I'm editing the tick() method, right ?
yes
if you just want it to always face the player, then you may not have to modify anything though
Even while it walks backwards?
even while it walks towards anything
My problem is when I edit it to face the player, it cancels out because the nav system makes it face where it's walking
Then it slows down
I would imagine it's the movecontrol ? I'm not sure
the navigation system kaes it face where it is walking because that's where the LookControl's target is set at
if you set the LookControl to where the player is, then it'll face the player
so, call mob.getLookControl().setLookAt(...) after calling moveTo and check if it faces the player
Yea that's what I'm doing right now and it does this ^
The check will be false, it's not facing the player
Sorry if I'm a broken record here, but I don't know what you mean
hi guys! how can I start developing plugins or mods to MC? is there any source where I could start learning about it?
I do work as a dev, but never touched MC or game related development stuff
I assume the PathNavigation sets the wanted position every time it ticks so it resets, but I can't exactly find where
I'll ping you when I find where
Awesome thank you
if you have some basic understanding of programming in general then you should pick it up pretty fast
I recommend Jetbrains's Academy Java Course for a quick overview of the language
I don't, but generally if you know one language I don't think there would be big problems learning another one in the run
my thing is actually learning specifically towards game/mc dev, which is totally new to me... I don't know any source or how to start or anything actually 😅
Okay. Well what languages do you know?
Anything object oriented, or less abstract.
Mainly TypeScript, and I've been studying C# for some weeks now, which some friends of mine told me that are pretty similar to Java
Yeah alright. That works.
have had some past contacts with Go and Kotlin too
Go with this.
Learn basics of Java
you can even do it along with learning to make plugins
If they know kotlin and C# I'm guessing they can understand java as well
eh, I've played around with haskell, doesn't mean I can realistically code anything with it 😛
that's just haskell
the logic for most things just repeats in a different way
yeah
game dev and mc dev often use different structures
game dev is a lot more advanced imo
you can't realistically code anything with haskell anyway
@ steel
yeah, thats why I wanted to build something on top of what is already existing (such as modding, servers, plugins, etc)
I was trying to be subtle rad, smh. You're gonna hurt the compsci majors
aka steel
yeah, but I think if you know C# you'll learn and understand java quite quickly
since they're syntactically pretty similar and are both OOP
but where can I learn to make plugins? I honestly just intend to skip Java and learn it on the run lol
you really just set up a spigot project and start making one
you can pick your poison with build tools - maven and gradle, it doesn't really matter which one you use
the entrypoint is onEnable (for the most part), you have to extend JavaPlugin
then the rest is mostly just learning what events are available
How can I get nms dependencies like "import net.minecraft.server.1_12_R1.level.ServerLevel" rather than "import net.minecraft.server.level.ServerLevel"?
the package doesn't have the version number anymore since a few versions ago
the craftbukkit ones still do, but not the NMS ones
ah you're using 1.12
emmm I need all of them,all version
well, if you imported spigot as a dependency, it should just have the version in the package name by default, there's no remapping in 1.12
just import server jar file?
if you're using a build system, then you should be able to import it from your local maven repository as long as you have ran BuildTools at least once for that version
Hey guys!
Now I'm trying to create an addon for weapon mechs
Its behaivour is to apply skin with specific conditions
Probably better to send it directly to wm server
I've already done it, so I want to post it here, maybe can find some help
Here is my basic logic of applying skin(I know about native method, but it seems work without it, and also I've tried it and won't help):
private void applySkin(Player player, ItemStack originalWeapon, String skin) {
ItemStack skinnedWeapon = originalWeapon.clone();
CustomTag.WEAPON_SKIN.setString(skinnedWeapon, skin);
}
I want to create my own custom logic of applying skins in weapon mechanics (last ver. 1.21.3)
When I apply skin it doesn't show in game at all, (only if try to move smth work)
With NBT tags everything is fine (judging by logs)
Although logic works fine if I add an additional event of moving or teleporting
But, in addition, it looks a little bit awkward
I wonder is there any method to apply skin without such behaivour?
I asked AI and his suggestions was to use
player.updateInventory();
//or
player.getInventory().setItemInMainHand(weapon);
Also, he suggested to use some deep logic of minecraft with protocol lib
but I'm a newbie and have no idea in such things
Really tough problem that killed me about a week or more
Seek for any help!
I will try
it seems no version info into classpath after I unzip jar file
why are you unzipping the jar file
how are you handling your dependencies
are you using maven/gradle? Or your IDE's dependency management?
yes maven
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${remapped.version}</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
that isn't 1.12
if you are using 1.20.4, then there's no version in the package name
I am unsure of what you're trying to do honestly, what are you even using NMS for?
yes Im trying to using a multiple version nms
?mvn-multiversion
I'm not sure how to implement this feature
read the article
thanks
how to make player unable to put things in top inventory but be able to do things in the bottom inventory
would i have to check for all cases, shift clicking, double left clicking, dragging manually ?
I mean, for the basic things you just have to cancel inventory click and drag if clicked inventory is top inventory, or it is bottom inventory but inventory action is collect to cursor/all
still can double click to collect them
you mean that its bottom but its double click ?
double or triple click, yes
you can just check the inventory action/click type
but will there be difference between when player takes items only from bottom inv by double clicking (doesnt change the top inv), and when player takes items from top inventory?
if i added unuique PDC to the top inv items it would be sure that they cant take it
but any other way ?
I wonder, how does the server handle collect to cursor, since it is technically multiple inventory clicks at once
does it just call an individual event for each modified slot?
its ClickType.DOUBLE_CLICK
I guess it doesn't necessarily count the collected slots as interactions
Make sure to check if it is InventoryAction.COLLECT_TO_CURSOR rather
whats the differenc
Inventory action will cover more cases I imagine
I do wonder if one can avoid collecting all items from a specific inventory without essentially recreating the action
i just cancelled double click no matter hat
i did this
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Inventory top = event.getInventory();
Inventory clicked = event.getClickedInventory();
// if blacksmith inventory is not open, return
if (!blacksmithInventories.contains(top)) {
return;
}
// player clicked on the blacksmith inventory
if (clicked == top) {
event.setCancelled(true);
return;
}
// player clicked on bottom inventory
ClickType clickType = event.getClick();
switch (clickType) {
case DOUBLE_CLICK:
case SHIFT_LEFT:
case SHIFT_RIGHT:
event.setCancelled(true);
}
}
@EventHandler
public void onInventoryDrag(InventoryDragEvent event) {
if (!blacksmithInventories.contains(event.getInventory())) {
return;
}
for (int rawSlot : event.getRawSlots()) {
if (rawSlot < event.getInventory().getSize()) {
event.setCancelled(true);
return;
}
}
}
packets are still needed for changing a player nametag?
they never have been
if you just want to add a prefix/suffix or colour it, use teams
if you want to completely edit it or use more than the 16 legacy colours, you've got to use a text display
add it as a passenger
and hide the nametag?
teams have an option for that
alr will give that a try thx
is there an event for water freezing
how do I detect it
when water changes to ice
naturally
BlockFormEvent iirc?
btw PlayerProfile wont work?
?
PlayerProfile api
public interface PlayerProfile extends Cloneable, ConfigurationSerializable
that will not work?
@blazing ocean
TextDisplay nametag = player.getWorld().spawn(loc, TextDisplay.class, textDisplay -> {
textDisplay.text(nameComponent);
textDisplay.setBillboard(Display.Billboard.CENTER);
textDisplay.setShadowed(true);
textDisplay.setSeeThrough(true);
textDisplay.setViewRange(64.0f);
textDisplay.setInterpolationDelay(1);
textDisplay.setInterpolationDuration(5);
textDisplay.setAlignment(TextDisplay.TextAlignment.CENTER);
});
player.addPassenger(nametag);
nametag.addScoreboardTag("nametag_" + player.getUniqueId());```
well, are you adding them to a team that hides their username?
don't use lunar client then
does Inventory.setItem(int, ItemStack) clone the itemstack ?
changing the amount doesnt work after i set it so ye
I was conserned about the text display being down on my head
thats from lunar ik
add a vertical translation
i have the juiciest plugin ever i need someone to make it for me you can do whatever you want with it just give it to me you can even sell i dont care i just rlly want it done
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
@near furnace if u could help it would be nice just dm me
wdym
.
im broke
man i can't even develop my own plugin, let alone yours
are you gonna pay though?
i got 0 money
what's the plugin about, i may be able to 'help'
Where
im in the presence of masters this is crazy
idk what u guys are even talking about
😂
No, but yes at some point if they leave and rejoin etc.
uhm so why changing the amount doesnt work after i add it to niventory
@Override
public void setItem(int index, ItemStack item) {
getInventory().setItem(index, CraftItemStack.asNMSCopy(item));
}
i mean, you answered to your own question in the first place
but yes
Oh!
Never knew
i have the juiciest plugin ever i need someone to make it for me you can do whatever you want with it just give it to me you can even sell i dont care i just rlly want it done
what it do
Dm
Me
I did
Whuy
Cause that’s what ?services are for
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Hey, I'm trying to create a ClientboundPlayerInfoUpdatePacket using the mojang mapping. I did this but I didn't find how to change the UPDATE_LISTED boolean to false :
Action action = Action.UPDATE_LISTED; EnumSet<Action> actions = EnumSet.of(action); ClientboundPlayerInfoUpdatePacket packet = new ClientboundPlayerInfoUpdatePacket(actions, serverPlayers); playerConnection.send(packet);
I think you don't understand, I want the UPDATE_LISTED action to be present, but I want to put its value to false.
Because, it will make no sense because there are actions that doesn't take boolean
I do understand what you mean
And as I said it not being present means it's value is false
It's all sent as a (fixed size) bitset
How does that work for the actions that take stuff other than a Boolean
The data for those actions are sent after
you can take a look at this for the format
You can see what the constructor is in their code
It takes an enumset of the actions you want
and since they do not want the update listed action all they need to do is not put it in the set
They do want the action
They want to set the value to false to remove the player from the list
Yes, that's it
ah I see now 🤦♂️
That's my bad
ClientboundPlayerInfoUpdatePacket#updateListed
That's the method you're looking for assuming you only want it for one player that's already known to the client*
Yeah but do they have any methods for that
Or would you have to construct the bytebuf manually
There's a consturctor that takes a list of entries
which essentially is the player data
I see
Yes, I would like to have this command, but it doesn't exist
What version are you on
What library should i use for UIs?
requirements: supports dispenser UIs
also it's a static method
can always make your own to suite your needs
Personally I'm not aware of any that do 🤷♂️
how do I use the registery to get a list of all potion effects?
Registry.EFFECT.stream().toList() is an option
I found it i think
lmao 2 days ago I asked the same question and you answered me as well
There’s several other methods you could use but it won’t make a huge difference
I'm on the 1.20.1 version but I don't see this method in the last version of Minecraft : https://mappings.dev/1.21.5/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.html
oh no don't tell me Paper added that to nms 💀
:sadge:
(Just go steal their implementation)
or if you're depending on the Paper API you can just use the API directly
Assuming it's there in 1.20.1, no idea how old that method is
Do last saved chunks load before plugins initialize? For example: i stop the server, then restart it. I have a ChunkLoadEvent in my plugin, but it doesnt seem to do anything, since the chunks I left in were loaded, they dont register in my ChunkLoadEvent? I dont really understand...
Depends on your plugin.yml and if the chunk is a spawn chunk
I need a compromise, mix of both. My goal is to reinitialize custom behaviour that i modify using NMS. It works when i spawn the mobs, but i dont have a method of making the behaviour persistent.
Do you have any suggestions?
will that affect the ChunkLoadEvent? My apologies, your answers dont seem to be quite clear enough for my monkey brain.
also, need I transfer the registering of the Listener to the onLoad() function? or is in onEnabled() fine?
just for clarity
the event fires as it would normally
the only difference is that now your plugin will be enabled by the time it loads
so registering the Listener in onLoad() wont affect my goals then
plugins by default load at POST_WORLD, i.e after worlds, and hence the ChunkLoadEvent is fired before your plugin is enabled
changing it to STARTUP means the world will load after, and the events fired will be heard by your listener
ah, i see, thanks!
alternatively (and this is my preferred approach, because it makes the plugin work with reloads) you can get all worlds and iterate over all the loaded chunks in onEnable, and do whatever you would do in the chunk load listener there
Inventory#contains(ItemStack item)
Inventory#contains(ItemStack item, int amount)
both of these check for entire ItemStacks matching (including amount - equals())
Inventory#containsAtLeast(ItemStack, int amount)
checks for actual amounts (isSimilar())
is that true? making sure
@Override
public boolean containsAtLeast(ItemStack item, int amount) {
if (item == null) {
return false;
}
if (amount <= 0) {
return true;
}
for (ItemStack i : this.getStorageContents()) {
if (item.isSimilar(i) && (amount -= i.getAmount()) <= 0) {
return true;
}
}
return false;
}
looks like it
it looks for similar stacks, subtracts their stack sizes from amount and returns true iff amount reaches zero
i.e. returns true if and only if all the similar stacks combined amount to amount or more
yup so if i wanna check if player actually has an item, i do containsAtLeast(item, 1)
if you want exact similarity, yes; for searching for custom items you probably want to just check the pdc or something, isSimilar can be expensive depending on how heavyweight the compared items are
uhm so loop through this myself
?
oh yeah..
actually
someone could rename the item
that wouldnt work
what are you doing
need to check if player has an item with the pdc key
but i forgot isSimilar wont work
Can anyone help me? I have a github access token and I used it to link Intellij with my github account but I can't access the repository that I want to access. I was able to do it before but the token expired and now I can't remember how to get it to work
Loop all items and check the pdc
do you have a command line you can use git from?
I'm not sure I know what you are asking
on linux i do ```bash
gh auth
I have Windows
from a terminal to authorize the global account
this is the tool i use https://cli.github.com
Is that necessary?
you can authorize the global github account this way and intellij should pick it up
no it shouldn't be necessary
I already have my github account added in Intellij
its not an account thing its a token your github account gives out to allow for it to do stuff
ill find the page hold on
gh?
their cli
hmm
its not complicated it in a terminal you just type gh auth and it opens up a page for you to authorize it
I suppose I can try that
sorry for not a great solution.
i use git solely from the terminal and i think a lot of others do too, its a good skill
not saying you should, should work with intellij after
i quite like intellij
Is this a Linux superiority thing? Lol
idk github was designed by the guy who made linux so it checks out
I didn't know that
settings > version control > github > add github account (plus looking button) > log in with token
Git != Github
github is a front end UI to display the data of git which is backend
Nope, but fun-fact, the creator of github co-founded a brand new Web Browser written from Scratch : LadyBird and he gaves $1M for the development of this web brower
interesting whats the incentive
So these two people are both making huge things
It's to have an independent web browser that doesn't depend on Google
I did that
doesn't seem as popular as i anticipated
isn't that just called Firefox
Firefox is pretty dependent on Google
Yes, they get money to put google as their default search engine
ddg 
I personally use Ecosia, a weird search engine based on Bing, a Microsoft shit. But I never thought to change my search engine, so I didn't change it lmao
Is that the tree one?
yes
It's fun that's because of google, I stop using Google for Ecosia. A long time ago, I was on the google play store and the google play store suggest me multiple web browser such as ecosia. It's fun to see that Google is ready to pay billions of dollars to web browser to make their search engine the default, and at the same time, featuring other search engines.
aren't they forced to pay the competition?
I still cannot figure out how to get this repository to work, it just keeps saying that it’s unauthorized
Do I need to authenticate the token some other way? Or do something with my local repository?
What repository?
Git repo, maven repo?
If it’s git just use an ssh token, they’re way easier to work with
lol back to my suggestion
It's a Maven repo but I'm using Gradle Kotlin to access it
How do I do that
Thanks
I finally find how to do it :
Collection<ClientboundPlayerInfoUpdatePacket.Entry> entries = new ArrayList<ClientboundPlayerInfoUpdatePacket.Entry>();
for(ServerPlayer player : players) {
ClientboundPlayerInfoUpdatePacket.Entry entry = new ClientboundPlayerInfoUpdatePacket.Entry(player.getUUID(), player.getGameProfile(), false, player.latency,
player.gameMode.getGameModeForPlayer(), player.getDisplayName(), (RemoteChatSession.Data) Optionull.map(player.getChatSession(), RemoteChatSession::asData));
entries.add(entry);
}
EnumSet<ClientboundPlayerInfoUpdatePacket.Action> enumSet = EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED);
ClientboundPlayerInfoUpdatePacket packet = new ClientboundPlayerInfoUpdatePacket(enumSet, new ArrayList<ServerPlayer>());
try {
Field field = packet.getClass().getDeclaredField("b"); // "b" is the obfuscated variable for "entries"
field.setAccessible(true);
field.set(packet, entries);
field.setAccessible(false);
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return packet;
}```
Thanks you for the help
so uhmm does anyone know if I have to shade ProtocolLib dev build into my project or is there a way to put the ProtocolLib dev build jar separately and then somehow add it as a dependency into the project
You don't shade plib, you have to add it itself
And also you include it using the maven/gradle declaration they have shown on the github
Is there a way to increase the amount of items you can see in a bundle? It only shows up to ~12
I don't see it in BundleMeta anywhere
Probably client side then
Oh yea I see the BundleItem class shows
can I edit that?
If I extend it or something?
Does that mean it doesn't actually apply, just looks like it does?
guys do you need some kind of ancient skill to be able to contribute to a project?
i really like to contribute to some projects but i dont know what it takes
just the basic stuff. git branching and stuff is like enough to fit in a team?
like i can write personal plugins seamlessly but i really want to take it up another level
I mean yeah, some people will just like if you are willing to engage and learn on the way by just showing initial interest, like start with some small contribution and then take on more as u learn more about the project, but also as u learn more tools etc
no need to have ancient skill ^^
Just vibe code it all!
but if you are serious about that, then learning about deeper Gradle/Maven, CI/CD, Git (maybe Docker?) etc will be useful
Yes, communication skills
anyone know how people render the player head image texture in GUIs?
resource packs?
would've better if you can show a screenshot of it or something
can anyone help me make my server? its 1.8.9
and yeah with resourec packs
font character with huge image
the player head is a player head with a custom scale on the custom model data, playe and beta are items, as well as all the buttons
then the armor is just done server sided, get the players armor and put it into the UI
the rest of the menu is a font character like pulse said on the title
which is done with oraxen / itemsadder or the one and only great fucking nexo
can you even use font for buttons in GUIs
well, I guess you can just name an item something with that font
what is so great about nexo i hear a lot abt it haha
but how were they able to render the player's skin?
what?? how can u click the button LMAO
its dogshit
its oraxen
the dev stole the code and uploaded to nexo but don't discuss
player_head
has that ability
Invisible item
bro
where would u put the font explain
in the same menu title?
In the title and offset it
why
😭😭
or u can simply make it a button and reuse it most the time
It’s more flexible
how
any wiki page i can look at to get a hint how to
also idk how but origin realms doesnt have this
no buy one from mcmodels
nuh uh
huhhh 😭
You can reverse engineer the rp and look
most of the ones i seen uses the items
origin realms?
Yes
ye they use items??
xheck the paper
it has custom model data for all the items
not that i would have the rp and know
ion give a shit about that
origin realms puts it on the item
and i prefer it bc of the animation
False
what false
i cant reproduce the animation when its in the title
also u need to offset it differently for every menu
its not reliable for big packs
with item i just define position
with title i need to setup offset for every single gui differently
Yep
I do wonder what is the benefit of doing it the convoluted way
I've seen people do it before, but I don't understand why you wouldn't just use the item either
Like I said, when you shift click it doesnt glitch and items dont work well for multi slot buttons
Can also animate buttons without buggyness
I'll trust you on that, all of the resource pack stuff is just a blur to me, I never actually sat down to actually learn whatever magic people do with them
they weren't as popular pre custom fonts era
the only thing id use it for is animations
origin realms fixes this somehow
neither does it really matter to me
its just a client side limitatjons not really a problem in my opinion
anyone? 🥲
Hello good sirs! If I wanted to get the job site block and location of a villager, how would I do that?
I assume I can just grab the villager profession for the job site block, but what about the location?
Could not find a field for that on the villager
good morning gamers, can anyone remind me what the max file size is for a plugin to be uploaded on spigot
i think u dont quite understand wat im trying to say
apologies
i said im using dev builds
u have to manually download the jar for that
you have to put the jar in your server though, it isn't shade-able
if it is a version that isn't in their maven repo, then you can just add it from your local repository
what version did you build?
Are you using maven or gradle? In gradle you can just use files to specify a jar dependency
im using maven
or you could install it into your local gradle, but personally i just do the former
file dependencies 🤮
for something like a development build that's constantly changing, imo its easier to just do that then run a command everytime because you have to drag a new file in
but for things that don't really change
i agree
#747
if version is always changing, then you can use something like gradle's latest.release in your version declaration
but if you've set your maven publication properly, then it should be easier to just run mvn install/gradle publish and then just have it automatically be updated in your dependent plugin
are there any API changes in that version?
well 1.21.5 support
yeah but did the API change
because if it didn't, then there's no need to depend on that specific version
you do have to run that version in your server, however if the API is still the same then you can just depend on whatever version is available in their maven repository
idk. i mean they added alot of new stuff in 1.21.5 there should be some api changes
is it anything you're going to use though
i might or i might not.
Looking from here https://github.com/dmulloy2/ProtocolLib/commits/master/ I don't see many things
yeah, looks like just some fixes
if there was any significant API change, they'd have released a minor version at the very least, given they didn't then there mustn't have been any yet
welp then if i do need to same thing some other plugin in the future wat am i supposed to do
i need to know this for future purposes even if i dont need to use the dev build
if you just have a jar file, then you can do what Pulse suggested
add it to the buildPath
You can either install it to local or include it in deps
it doesn't build tho after that. it just says syntax missing
Show build script
ye but can you do that in a online hosting
yes?
you mean like, in a CI server or something?
this is what you get for assuming apparently
don't worry I thought it was development too 😛
you don't seem to be depending on protocollib at all
a online minecraft hosting that only gives u access to the file system and minecraft console
You would just download the protocollib plugin into the folder
I am not sure what that has to do with this
why do you shade gson when spigot server provides it?
once you've built your plugin, you'd just take the built jar and pass it to the host
And then you drag protocollib into the plugins jar too
it didnt appear apparently while i was writing the syntax
that isn't what I was asking
huh
you are shading the dependency into the jar when it isn't necessary since spigot server provides it
Yes
done
unless you have a specific need of a version of gson it just isn't necessary to shade it in
In my experience I don't think I got anything breaking with Gson different versions but maybe some things are different from version mismatch
thats all
2.11.0 apparently
ye but the things is. the plugin isn't compiling
its already put on depend in plugin.yml
and added to the buildpath
you need to put it in your pom.xml
I mean, you don't have protocollib listed in your dependencies block so if you have anything that uses ProtocolLib in your code it isn't gonna work
ye but wat am i supposed to write
5.4.0 doesnt work
am i supposed to put a system scope
and specify a path
probably could
You can either do that or install it to local like what Javier suggested
however though if its in the local maven repo
you don't need to specify anything
maven defaults to local repo first before searching it in the ether
5.3.0 is the latest one
ye i said dev build man
and I told you that the dev build doesn't matter
you need to depend on ProtocolLib's API, not its implementation
ye but i cant specify it in the pom.xml unless i put system scope with a path
then how is it gonna compile. it doesnt compile
you need to depend on the protocollib version provided by dmulloy's maven repo, which is 5.3.0
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.3.0</version>
<scope>provided</scope>
</dependency>
Make sure you have the repo too
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
thats just gonna use the repo version
And that's fine
You can use an older version of plib
You are only using the API
The API hasn't had anything breaking in 1.21.5 version
thats not why im here for man. i need to know this. if i have to do this in the future i will be screwed
You don't have to be forced to use the developmental build if you are developing 1.21.5
better to know now than never
What's your main concern, like possibly it breaks?
Personally, I wouldn't be concerned at that happening. If it works and everything is fine, then it will work
there are no main concern. i might have to work with something that is not even listed as a public repo anywhere
there is somehow a 5.4.0
Yes because that is a developmental build
yeah but that isn't published on the repository, so you don't have to worry about it
Mhm
alr man u dont get wat im saying. i need to learn just for the sake of not knowing how to it
i wont be able to sleep if i dont know how to use that dev build
without shading it
into the plugin
there are two ways to use a dependency that isn't listed in a public repository
one is compiling the dependency yourself and deploying it to your local maven repository
if the dependency is using maven, that's as simple as compiling the dependency with mvn install, and then it'll be available as a dependency with the specified group and artifact IDs, as well as version specified in its pom.xml
I'm sure dmulloy will soon publish the other plib artifacts onto his repository. But there's nothing wrong or you can't do if it doesn't exist on the repository. You won't be screwed
alr man thanks. THATS ALL I NEEDED TO KNOW
if the dependency is using gradle, and if you're lucky they've already setup maven publication for you, so you'd just have to call ./gradlew publishToMavenLocal
and then it'll be available in your local maven repository the same way as before
if they haven't setup maven publication, then you'll have to set it up yourself, for which you can read about it here: https://docs.gradle.org/current/userguide/publishing_maven.html
either that, or you can just install the jar file directly into your local maven repository by using
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<packaging> \
-DgeneratePom=true```
Hmph u wrote that faster than me
in this case for example, it'd be something like:
mvn install:install-file -Dfile=ProtocolLib-747.jar -DgroupId=com.comphenix.protocol -DartifactId=ProtocolLib -Dversion=5.4.0-DEV -Dpackaging=jar -DgeneratePom=true
I had it copied already 😛
Cheater
chat does this look redundant
(ie. could i just do setItemInMainHand(helmetItem) instead of everything else)
Probably
Yeah probably
for sure, even if the helmet item is null, youd just set the mainhand item to null, which you are already doing anyways
just blame your past self, we all have moments
it really was my past self SadCat
@torn shuttle could you explain a little how to write code in plugins that effects the custom minecraft model?
i am so confused.
ur using Vencord's FakeNitro Plugin for emojis, which would suggest you dont have nitro
but how tf do u still got the animated banner
discord gave out free nitro apparently
spigot requires boost for custom emojis
hi there. im using freeminecraftmodels to make a custom model, and im trying to code a minigame around a model. i want the player to die when close to custom model, and i have the following code but it doesnt work
ive also tried to make the model invincible but that doesnt work
Why have you defined entity twice?
trying to get the correct syntax
the same with modeled
sorry, have taken that out
i fixed the problem if anyone was going to help
Any minecraft server developer?dm me paid also
is anyone able to help me with nms? im trying to make a custom model pathfind to a player, and i have no clue where to start
What do you need nms for
Entity#target
?services That is the correct place to ask, not here
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Either use NMS or use a library that does it for you
its neither, close enough.
there is EntityTargetEvent tho which is interesting
declaration: package: org.bukkit.entity, interface: Mob
oh its Mob
i know MHF heads exist but arent updated for new mobs, how can i get warden heads etc?
Create a skin with the head you want
Upload it to an account (or use the fancy schmancy website)
use the texture it gives you as you would MHF head
what kind of question is that
well its just that doesnt seem very efficient
there is no other way then uploading a skin to the MC servers if you want to use custom head
That is literally how MHF heads work too
except Marc created an account for each mob.
yeah but theres a minecraft-heads website
that works in the way I said
which gives a texture url
Yes, you get the texture url by uploading a skin to an account
the fancy website can do it for you if you just give it a skin
alright thanks
I don't remember the website tho
mineskin
Is it smarter to use 1 server and have 5 bedwars instances or have 5 weak Servers 1 bedwars instance each ?
depends
- are your matches very heavy on the server?
- are your servers shit?
- do you wanna have a big hole in your wallet?
usually you do a couple matches per server though
I dont really know 😔
So 1 strong server?
well, how many matches are you trying to run concurrently?
(that was also one of the questions sorry)
I dont know i was wondering because I'd have to Design the Code around thqt
horizontal scaling is something you should look into once you need it with minecraft
So 1 machine running 5 Servers is worse than it just running 1 cool one ?
not worse per se
Horizontal would be having 5 weak Servers?
Instead of multiple instances per server
Yeah so having 5 weak Servers with just 1 instance is better?
again, it really depends on some things
Do you know what hypixel does?
Yeah but they probably know whats best cuz they are the largedt
who was use entity component system architecture even once?
✋
🤚
- does the system interact with entity or only with components ?
- Is it a good idea to combine ecs with OOP ?
- are there other kinds of classes in the architecture besides those listed in ecs ? For example I am using a library with ecs in Java where the entity has no id but I need to store and hash the entity objects somehow.
Is it even worth it to strictly adhere to this architecture in general or just take the basic idea
(i create mini game)
Which library are you using ?
I've had experience with two
I'm no expert but I'll still try
- with components
- I wouldn't really do that
- well you can always give them the ID yourself, I personally just give entities a UUID object
Insanely fast ECS (Entity Component System) for Java - dominion-dev/dominion-ecs-java
this lib what i use
In this case I either need to do a wrapper, or consider everything that is not a component or entity as default system classes to store the entity with their id if needed
Don't :D
I've tried using dominion for so long and it has one fatal flaw https://github.com/dominion-dev/dominion-ecs-java/issues/195
I've found a way to reproduce this on my machine with 5 components. Simply adding them in a different order crashes the thing.
These entities do have an ID, you just have to cast to IntEntity to get it.
Anyways, I found Ashley better
it's not possible for hypixel to use vertical scaling at their level
its not possible for a new server to use horizontal scaling with no players
just buy a machine and upgrade as u need to
u learn from experience
is setting itemstack's amount to negative number safe?
....why though
making a youtuber only server but need a plugin, when you die you get banned and you drop a head and if u place the head a gui pops up and if u click on any dead player u can revive them, if you are willing to help for free please dm me
yeah thats the goal
i think you should go to #help-server
ill just do math.max
okay thanks
if a component is a data object without logic, then any dependency of one component on another is already a behavior, and therefore not a component, right? (ecs)
Should I treat such an architecture strictly?
uhm what u talking about 😨
entity component system architecture
uhm okay good luck
@smoky anchor
Sorry, I have no idea
I can't speak design
https://paste.md-5.net/efakayuyug.java how can I stop text displays from getting stuck when a player teleports
Either use a different method of teleporting player, one that does not dismount passengers (I don't believe one exists in the API)
Remount the display entity after a player teleports.
so use a teleport listener
mhmm
Hello! I've noticed that a bossbar my plugin adds disappears once the player relogs, has anyone else encountered this issue and knows how to fix it? 🤞
you should apply it constantly
It needs to be re-applied each time they log?
but its usually the other way around. the bossbar dosent disappear🤣
probably
I'll try it! Thanks
you wrote a custom bossbar plugin too? no way. i feel like this is one of those things that needs a one for all solution without the need to write a whole plugin for each case
Nope, not an entire plugin, just a thing for my plugin to show a per-player value
(Its basically just energy that each player has in my plugin)
I think they mean based on certain values
this still exists
TAB does bossbars
id guess like dynamic bossbars or such which are not that nice to do with the cmd altough its not complicated
tab does that too
🤷 what does it matters anyway, let people make whatever they want!
whats tab?
don't really see a point there ngl
its good for learning i suppose
TAB plugin
just register a placeholder if u need and animate it with tab 😎
never heard of it, sounds like a one for all solution to me
no, i write basically everything myself
thats so weird i hate people with this mindset
i was like that like i wont be rude
but its not worth it and u learn it too late
if i need something i either do it myself or if im lazy i download a plugin
these plugins are made for production
not for a 2 player smp
its stupid if u make everything by ur self just to make a small minigame server or an smp
there isn't much you can get wrong with bossbars
u should always make ur main plugin by ur self ofc
plus you learn how the thing you want works
its just my logic is my logic, i dont want to add a plugin with 300+ featured if I really just need like 2
thar just wouldnt make any sense
yeah thats CMI not TAB
there's places where it's really unnecessary but for tiny stuff like this
CMI litearlly adds worldedit for no reason
TAB is just for your HUD, actionbar, player title, TAB, scoreboard, bossbar
CMI adds all that, plus essentialsx, it adds worldguard, lobby plugins, worldedit
its stupid asf i would never use a plugin like that
point is i dont know it cause i never needed it personally
if I need to use boss bars in my plugin, I won't add a dependency on TAB?
that's just unnecessary
excactly my point
yes
in general I hate plugin dependencies
i said if u got a value u want to show
u can just make it a placeholder
and show it anywhere using TAB
like actionbar, bossbar, scoreboard
instead of coding it into the bossbar
then being unable to use it anywhere else
without coding it
five seconds ago
ok point to it
also, i looooove coding so its fun to do it myself any maybe challange myself once a while with new stuff i aint familiar with :)
well im just saying its not worth it
if ur actually tryna host a server
and get players on it
the only way thast ever reliable is if u already got the player base and the profit for it
depends on your usecase
otherwise its just a fun side project
Point is I only need a few of all these features such all in one solutions offer so It wouldnt make sense for me to get the plugin itself
im just saying its a free plugin that has multi uses for all ur HUD
imo its super useful
its always updated, bug free to my testing
But for stuff like permissions I use luckperms because why should I code it myself if its alr everything I need without unneccassary stuff i dont need?
well like no major bugs and basically none minor ones
ye thast what im saying
for me bossbar would be the same thing
i can just register a placeholder i can use anywhere
so why should i code the bossbar
there's a lot of api for it
jep
Here's my setPlayerDataTag method using nbtapi
@SuppressWarnings("unchecked")
public static void setPlayerDataTag(OfflinePlayer player, String tag, Object value) {
NBTFile nbt = loadPlayerDataFile(player);
if (nbt == null) return;
if (value instanceof String str) {
nbt.setString(tag, str);
} else if (value instanceof Integer i) {
nbt.setInteger(tag, i);
} else if (value instanceof Double d) {
nbt.setDouble(tag, d);
} else if (value instanceof Long l) {
nbt.setLong(tag, l);
} else if (value instanceof List<?> list && !list.isEmpty()) {
if (list.get(0) instanceof Double) {
List<Double> doubleList = (List<Double>) list;
NBTList<Double> nbtList = nbt.getDoubleList(tag);
nbtList.clear();
nbtList.addAll(doubleList);
}
} else if (value instanceof NBTCompoundList clist && (tag.equals("Inventory") || tag.equals("EnderItems"))) {
NBTCompoundList nbtList = nbt.getCompoundList(tag);
nbtList.clear();
nbtList.addAll(clist);
}
try {
nbt.save();
} catch (IOException e) {
plugin.getLogger().severe("Failed to save player data for player: " + player.getName());
plugin.getLogger().warning("Error message: " + e.getMessage());
plugin.getLogger().warning("Stacktrace:");
for (StackTraceElement element : e.getStackTrace()) {
plugin.getLogger().warning(element.toString());
}
}
}
Here's the method to set the ender chest items for the offline player:
public static void setPlayerEnderChestItems(OfflinePlayer target, ItemStack[] items) {
NBTFile nbt = loadPlayerDataFile(target);
if (nbt == null) return;
NBTCompoundList newEnderItems = new NBTContainer().getCompoundList("dummy");
for (int i = 0; i < items.length; i++) {
ItemStack item = items[i];
if (item != null && !item.getType().isAir()) {
NBTCompound nbtItem = NBTItem.convertItemtoNBT(item);
nbtItem.setByte("Slot", (byte) i);
newEnderItems.addCompound(nbtItem);
}
}
setPlayerDataTag(target, "EnderItems", newEnderItems);
}```
And here's me calling that method and passing the items:
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Inventory inv = event.getInventory();
if (!plugin.enderChestViewMap.containsKey(inv)) return;
OfflinePlayer target = plugin.enderChestViewMap.get(inv);
if (target.isOnline()) {
Player onlineTarget = target.getPlayer();
if (onlineTarget != null) {
Bukkit.getScheduler().runTaskLater(plugin, () -> onlineTarget.getEnderChest().setContents(inv.getContents()), 1L);
}
} else {
// Save changes immediately for offline players
PlayerData.setPlayerEnderChestItems(target, inv.getContents());
}
}
@EventHandler
public void onInventoryDrag(InventoryDragEvent event) {
Inventory inv = event.getInventory();
if (!plugin.enderChestViewMap.containsKey(inv)) return;
OfflinePlayer target = plugin.enderChestViewMap.get(inv);
if (target.isOnline()) {
Player onlineTarget = target.getPlayer();
if (onlineTarget != null) {
Bukkit.getScheduler().runTaskLater(plugin, () -> onlineTarget.getEnderChest().setContents(inv.getContents()), 1L);
}
} else {
// Save changes immediately for offline players
PlayerData.setPlayerEnderChestItems(target, inv.getContents());
}
}```
Couldn't figure out why it wasn't working, went to grok. Pretty sure he messed it up even more
Now I don't have any idea what's going on
I want to modify the offline player's enderchest using /viewechest <offlineTarget>
The gui gets created successfully, but when I move things around. It does not get registered onto the real ender chest, and when I re-create the gui it goes back to the way it was
might be due to the compound list being called "dummy"
im gonna cry 😢
just a thought
i have no idea whats going on man, i got a mild fever and this grok ai is spinning me in circles
using grok is crazy
yea chatgpt messed it up even more
my only hope is you guys
so:
- GUI gets created, and the offlineTarget's ender chest items are added using getPlayerEnderChestItems
have you considered not using AI and instead using your brain
really helps sometimes
- onInventoryClick(), it sets the contents using the method setPlayerEnderChestItems
setPlayerEnderChestItems takes the target's inventory and itemStack. Creates a NBTFile or whatever and passes it through setPlayerDataTag(target. "EnderItems", newEnderItems);
and idk what happens afterwards
that helps too🤣
firstly what i would do is making a class for each event. that way i would be more focused
im not a clean coder at all but im pretty sure thats the SOLID principle
make a seperate class for the Events? alright
the functionality would not change but it would be easier for you to read
and thats it usually if you truly understand whats going on in your code you would not encounter problems
well, mostly
no
if anyone wanna help, dm me :)
sounds like you're asking for a fun time
im dead💀 😭
ok 😉
👨❤️💋👨
?paste
well, it might be your fault, but it isn't your code that is causing it
butterfly effect n all
:Clueless:
how do i know
so that's why my vanilla server has this happen so often, good to know
cursor ai or any other "coder" ai seemingly have no idea what SOLID principle is
they all try to fit everything in one class and that pisses me off. that goddamn system prompt cant have this simple prompt in it?
it's the training data
doubt
or maybe idk
specifically, it's trained on individual classes
converting a multiple class structure into something sensible isn't trivial, but a single class is generally a single file that can be fed in serially
- the training set includes 100,000 cases of stackoverflow and other interactive mediums where someone asks for a solution and is given a code snippet or a single class in response
thats also something
I use copilot with Claude
Never tried any other ones
So far it’s alright in terms of design
but i think it can be done so that it also keeps these into account. like another ai agent refining the code or something
i use cursor its pretty good
personally i think the training and deployment of ai in programming spaces is being done backwards
e.g. first define the contract and only then the implementation; and only keep the contract in the context set later on
currently the approach is "make it bigger" which is why e.g. gpt4.1 has like 1 million or something context length, so you can fit the entire codebase along with all of the boilerplate and impl details in it
i prefer using my brain
What’s a brain
codex worked out for me but its expensive
It cost me about $3 to start a java backend web deployment in less than a day. Too pricey for me
!?whereami
?whereami
i mean paper is still spigot??
its a fork. its spigot
a hard fork
by this logic you are a mushroom
🍄
the animal kingdom hard forked from the shrooms quite a while ago but there is a common ancestor
i am not a mushroom i am on mushrooms
You're a cannibal 😱
shrooms are weird
does anyone know anything about the coralprison plugin?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I'm looking for a developer to create my Minecraft server. I can pay for the dev.
Salut
?service
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
can anyone help me with this java class?
ive been using chat gpt and i dont think its very good at this
im trying to make a custom model pathfind to a player
should i be using gradle or can i keep doing this with maven
Either should work
do i need to add an extra dependency for nms?
just use spigot instead of spigot-api
im using paper
thx
?whereami
I'VE WAITED MY WHOLE LIFE TO DO THAT
Easy, start using spigot ;)
I might have to for this project
It’s so annoying tho, I’ve made it all except for making the entity pathfind to the player and that part is making me crash out
pathfinding usually requires you to do nms
Is there any NMS dependency without reflection that can use directly? It is really hard to build and keep update a nms lib manually.
And should I write code again for "minor versions" like 1.20.4-R1 and 1.20.4-R2.And how can I choose "minor versions" in buildtools provide by spigot?
sounds like an old version
if you can help it you should not write code for old versions
I am trying to write minigame plugins for the old version
also I hope that my plugin can support as many versions as possible
But like why
This is basically: few latest versions and 1.8 (for some reason still)
you shouldnt be bothered to write for minor version on older versions especially
There is a MobGoal api for paper afaik, you could try looking into there if you're alr using it
but for custom models i dont think thats actually going to work
Spigot only uses R1 afaik
I see,thank you
is there a way to alter the player's bow draw speed?
paper actually has an api for pathfinder goals tho
Cool, I have never worked with paper
And this is the Spigot server
lol did you mean to be cold
what
im getting this:
Unresolved dependency: 'org.spigotmc:spigot-api:jar:1.21.5'
with this code
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
even though i have runned the buildtools locally
its a maven pom.xml file
it's 1.21.5-R0.1-SNAPSHOT
oh ok
thx fixed it, where can i know all these versions from?
it's always just -R0.1-SNAPSHOT
ohh like with any version at last you have to add that
yeah
okay thx
Is it possible to make item display entities 'glide'? I'm trying to make them go from location A to location B over the course of a couple of seconds.
I've tried giving them translation transformations but that moved them immediately, I also tried setting their velocity but that didn't move them at all. Any info / help would be appreciated 👍
Found it, thanks! I was trying to do it from the wrong variable
im getting this error
package com.mojang.authlib does not exist
with this :
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
its when packing the maven project
?nms
now this ```
'repositories.repository.id' must be unique: spigotmc-repo -> https://hub.spigotmc.org/nexus/content/repositories/public/ vs https://hub.spigotmc.org/nexus/content/repositories/public/
then don't add the repo twice
is shadowJar not compatible with java21?
update to gradleup shadow
is the last word supposed to refer to me or the plugin
Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries
because john shadow has abandoned it
goooler than forked it and continued working on it, updated to java 21
then it got moved to gradleup
set a duplicate strategy
how, exactly, is this possible?
zip format :)
they do not differ in name
correct
so it doesn't care?
the zip format is very fucked
zip format :despair:
but its a jar
jar is zip
I guess uh
with a different name
its same
jars are just rebranded zips
by specification, a jar file is just a zip file
never knew that
wait, so I can have my own project files override files of any library with this?
yup
:3
do you think it would be useful if you shared your buildscript or logs or something
I was just laughing at the build script giving the :3
it started working again, I am confused
it's IJs kts indexing not working properly for buildscripts sometimes
opened a different project and came back, and shadowjar no longer throws
I'm assuming it was the beta shadowJar was responsible or gradle 8.14
since they don't seem particularly stable
