#help-development
1 messages · Page 1304 of 1
It’s a reply to something else
I know
I meant, the whole thing with "violent associations". I was asking if that person who made that comment was joking or serious lol
It’s IntelliJ so who knows?
Why would a software be joking tho idek wym
All good!
How does Spigot generate the patches it applies to the Minecraft server?
got a question, is reading block data in a seperate async thread not recommended in any situation? do I have to use separate block snapshots that are given to the task?
it just uses diff and patch. You can check makePatches.sh and applyPatches.sh in the Craftbukkit repository for how these are used exactly
What do contribuitors modify before making their patches?
Do they modified a patched and decompiled version of Minecraft?
that is explained in CraftBukkit's README, the making changes to Minecraft section
Spigot uses a fork of Fernflower to generate the decompiled minecraft source, as well as a bunch of source patches to clean up the decompiled output
what is it that you're trying to do
that kind of question is generally seen when someone is doing something asynchronous and doesn't want to context switch for whatever reason it might be
depends on what you mean by block data specifically, and there are also quite a few differences in behavior between paper and spigot in this
The contribuitor copies a target decompiled, santised class and modifes it? And then runs make patches to make the patch with their modification.
Thanks for the help!
yep, that's pretty much it
calculate water changes. Doing everything on the main thread drops the tps if the amount of processed water exeeds a certain amount. rn im doing it with async read and it works perfectly, no lag at all even with huge amounts of water. but idk if i can do that without risking world damage.
reading block type is safe in that it won't corrupt the world or anything, being a read operation
but there aren't much in the way of guarantees that what you get is actually there
as a practical example, simple async reads weren't enough for my flood-fill algorithm that tried to map enclosed rooms; occasionally, blocks that weren't air would return their type as air
so i had to manually synchronize on the paletted container of the chunk section to make sure i was getting the correct data
as vcs2 explained, there wouldn't be corruption just by doing reads, it'd just lead to possibly inaccurate calculations for whatever your system is
that being said, if you can abstract out the calculations so that's the only thing you're doing asynchronously, then that'd be ideal
depending on how large of an area you access, a sync chunk snapshot + async processing on it might be a cleaner and safer option
ideally we could get chunk section snapshots, since snapshotting the entire chunk is almost always overkill, but maybe one day
it wouldn't be particularly hard to make an API for in spigot at least, no idea in paper
internals are about the same in terms of a section's relation to its chunk i think
the funny thing is that if we don't include tile entities or heightmaps or anything other than block/biome data in the snapshot, we can actually take the snapshot async
since nms synchronizes over the paletted container for all writes
I would give it a go if I had the patience to deal with the contribution process
having "async" in the pr title is a surefire way to get your pr in forever review limbo on paper
well, whole chunk snapshots seem a bit much, especially if it stretches over more than one. Inaccurate calculations are okay if it is on a small scale, I haven't really experienced any yet. and filling up enclosed rooms works. Im really satisfied rn, only problem is the async read. But if you say it wont corrupt any world files then i believe im good. If not, I would have created a snapshot block class which would have saved important block data + the surrounding blocks for flood check, but that would take a small hit on perfromance. ig, ill keep it? tyvm!
i'm not 100% on this but i think on spigot, checking a block's type on async schedules a task to run on the next tick that gets it and passes it to the calling thread, meaning the async thread can block for up to 50ms if the main thread has just finished ticking
probably want to check if that's still the case and keep that in mind if it is
in the worst case, checking 100 blocks asynchronously can take 5 seconds if you miss the main thread's tick loop on each call
im not sure but that sounds logical. But as of right now, I never had any infinite or large calculations. Seems like request always got an answer. If i ever encounter to a serious problem, ill switch. But right now, im rather enjoying the insane performance.
Looking for a Minecraft Developer (Paid)
Hi! I’m looking for a Minecraft developer to help with my project. This is a paid position, and I’m happy to discuss rates depending on experience and the scope of work.
If you’re interested, please send me a message!
is it a skibidi server
Haha, Beginning smp
whats the dev for
Fixing al plugins!
dm
what's an al plugin
either they meant to say all or something I am completely unaware of
It’s a plugin made by weird Al Yankovich
I am trying to catch the CrafterCraftEvent and go thru the recipe of the crafter item, I am having an issues when leather armor is dye. It seems to not be a ShapedRecipe, ShapelessRecipe, TransmuteRecipe but just a ComplexRecipe. Does this mean it would be inpossible to get what ingredents were used for the craft?
a complex recipe is a recipe where the recipe itself doesn't know what exact items are used in it and what exact result it produces
e.g. attaching a potion to an arrow to make a tipped arrow; any potion could be the input, a tipped arrow with any potion effect the result
if you need to get the specific items involved, you'll have to look at the inventory
In the case of dying armor the input is up to 8 of any dye
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous usernames, global display names, and server...
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
anyone help
im try to reset all my player money
i has try to delete file, or in game command but it's still dont work
Sounds like a question for #help-server
and do specify what files and commands you've used
delete the server directory, that'll probably do it
as well as what economy plugin
essentinals
best way to change the size of an armorstand's hitbox?
Version? And for what purpose?
1.21.5-R0.1-SNAPSHOT so that I can interact with the hitbox but a bigger one
Did you delete the file with the server off?
Use an Interaction entity
declaration: package: org.bukkit.entity, interface: Interaction
oh thanks I haven't heard of that
do you know what event it throws when being interacted with?
because armorstands throw the InteractAtEntity event
Same one
^
ok thanks
is there a way to make an armorstand invis while being able to see its items in its main and offhand?
I recommend using two Item Displays instead of armor stands
What do people use for making animations? I'm assuming its display blocks
depends on the version and what type of animation
but yes display entities are a good idea
1.21.8. So yea display entities
I am already using them to a small extent, but thinking about using them to make animations feels kinda overwhelmingly complicated.
It can be a lot of math
Well what if you wanted, say for example, a large expanding ring
You'd need to make code to make a bunch of display entities all rotated in a way to make a circle, then make the entities go outwards and increase their scale depending on how far theyve gone
already this is a mess
yeah math time
im trying to set a water block using nms, but somehow flowing water always updates itself and disappears in the ground, cancelling BlockPhysicsEvent and BlockFromToEvent didnt work. Any1 know why?
ServerLevel nmsWorld = ((CraftWorld) block.getWorld()).getHandle();
BlockPos blockPos = new BlockPos(block.getX(), block.getY(), block.getZ());
BlockState nmsBlockState;
if (level <= 0) {
nmsBlockState = ((CraftBlockData) Material.AIR.createBlockData()).getState();
} else {
BlockData waterData = Bukkit.createBlockData(Material.WATER, "[level=" + (level == 8 ? 0 : 8 - level) + "]");
nmsBlockState = ((CraftBlockData) waterData).getState();
}
int flags = 2 | 16;
nmsWorld.setBlock(blockPos, nmsBlockState, flags);
}
Why are you using nms
Want to change a large amount of blocks.
I'd recommend just using FAWE's API for that
setting blocks that way isn't going to be any different than doing it with the API
yeah FAWE or work distro
is it that hard to just fix the water from updating?
well as of right now i dont wanna rely on external APIs. If it really is that hard to do for now, maybe, but for the short run I just wanna test if it is even showing improvements. If it is fixable within a method, then i'd be grateful for any advice.
just use fawe
if you really want to figure out why nms does what nms does, plug the server into a debugger and step through the call stack and see where and behind which branch the block gets put into the chunk's tick list
also consider caching the nms blockstate, parsing a blockstate string through bukkit is far from "fast"
yeah wouldn't suprise me if that's slower than doing setType to begin with
👀
can anyone help me understand why systems like this are better than using regular inventory systems such as is described at the start of the form by just checking what slot the player clicked in to perform actions? I read this tutorial like 3 times and I still don't understand what they are doing, why they are doing it, or how to do it at all xD
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
they say the system is better but it looks a lot harder because you have to make a new class for each gui
nothing a little bit of inheritance and OOP won't solve
personally i have some gripes with the specifics of how oop is implemented in that tutorial, but it's still leagues better than filling classes with switch boilerplate
but like you didn't answer any question I had
what is your question exactly
"why is it better" is a bit vague; i see a switch block at the start of the tutorial, is that what we're comparing the tutorial to?
I have many but yes why is it better would be one of the main ones
why is it better than just making an inventory and showing it to the player and then checking the slots that the player clicks
true, but your IDE can generally these days take care of most of the boilerplate stuff if you set it up right lol
yeah it really doesnt take up much more space in the code tbh
its not about taking up more space
this works for one inventory that does simple things, but it isn't very compatible with object-oriented programming, i.e. you can't compose it, you can't extend or override its behavior, and if you need another gui you will end up copy pasting the entire massive switch logic block
what do you mean compose/extend/override its behavior
its pretty easy for me to make new guis and I wouldn't want to copy the same switch statement
instead of duplicating the code, to make it a bit different, you would instead created a class that extends it
and in that class you add the code that is different
leaving what you want to retain in the original class
oh well that seems like a problem if you want to change the original one
overriding is the same concept, but instead of creating new methods, we want to alter the methods that already exist in what they do
but I don't really need to make 2 guis similar to eachother so its fine
right, but they are explaining why its better
later on, you might want 2 guis though
and maybe 3 and so forth
instead of just duplicating code all the time, you could just extend and override as needed instead
well, let's take two of your guis as example
what do they do and how did you make them work?
got a menu that has a bunch of items to go to sub guis I just made a new inventory with bukkit.createinventory and filled it with items then showed the player the inventory and listened for when they clicked
I have a teleport gui that is made the same except for when they click it teleports them somewhere
do they use pagination?
idk what that is so no
what if you have more teleport points that fit in a single gui page?
you'll need multiple pages
same with sub guis
yeah and thats easy to do
this is shared behavior which could be contained in a superclass that the two guis extend
yes but the point is that you don't copy paste the pagination code in two places
DRY; don't repeat yourself
I mean the only thing I would be repeating is creating/showing the inventory and having page turning arrows
@torn shuttle Any tips for optimizing client-side lag with custom models?
We got thousands of props and there's no culling algorithm that'll fix this
and sorting the items from the full list and placing them in the inventory and assigning the slot index -> action mappings based on their ordering
Models are already low-poly enough
it's maybe like 10-20 lines sure, but not having to repeat those 10-20 lines is why it's better
write a layer system that already does your pagination stuff for you
we do pagination at work with titles instead of items or whatever
i'm trying to explain to him why you'd want to do something like that instead of a switch block for every gui
I don't use pagination, and I am not filling the gui with the same stuff anyway so it would have to be different meaning it wouldn't be copy pasted
the same logic can apply to different data
but it shouldn't matter because the gui is being filled with different stuff so I am not just going to copy the old GUI's items
no, but you will be copying the pagination logic
or are you manually writing out the layout of each page instead of taking a list of "all the stuff" and splitting it into pages?
the most I repeat in my guis is just like
registerButton(NEXT_PAGE_KEY, layer::nextPage)
yeah no I am not even doing pages but if I do I then the layout will have to be copied probably
but creating a bunch of classes just to save the layout of a page seems way too hard
load the layout from a config
well no but you gotta make a new one for each gui
in the tutorial I showed thats what they did
in java everything is an object and every object has a class
anything that comes from a config is in a config loader class
having different classes and objects to represent different things is natural
how is this done
I mean yeah this makes sense if you were changing the layout of your pages often
are you saying you would make a class that has the layout or something then use it by making an instance of the class or something
Here's an example
i'll take slimefun for an example, since that has a lot of nested and fairly complicated guis
there is a main category gui that has to paginate
it takes a list of item categories in the game, sorts them by level, and splits them into pages
clicking any category opens another paginable gui (sharing a common superclass with the category gui for pagination logic) that lists all the items in that category
clicking on an item shows another gui with its recipe, the recipes its used in, and the recipes crafted in it if it's a crafting station/machine
clicking on any item in the recipe will take you to the item page for that item
I'd just make that a paginable area where each element is a button that opens a sub menu
that's how it works, yeah
there's also logic for sorting/hiding/decorating items based on whether you've unlocked its research or not
and if you fuck around with titles for long enough maybe it'll even look nice
Here's a teaser of what I've been working on
now, since there are a lot of things paginating in each direction, i represent each paginable area in the gui with its own object that's attached to a list of items to paginate through, and two buttons in the gui to paginate it with
I have a gui that was really difficult to do with traditional pagination so I made a 2d engine for it
that seems like a lot of texture pack work
took me 7 hours to make a system where you can align layers and stuff
life's been easy since I've done that
looks very good for sure
there is also a variant of the entire gui set for the "cheat gui" which rather than showing item recipes will spawn them in
how did you even make it solid like that is that just a resource pack with items with that texture
the item search gui also uses the same gui class for pagination
how did u make the wheels work
magic
it looks almost as good as the shit bedrock gets natively
meanwhile we have to do this or cope with dialogs
any way to change an armorstand hotbox size so that i can detect collisions?
if >=1.19.4 u can use interaction entities (effectively just a hitbox with configurable size)
there's also the scale attribute
your custom blocks are mushroom blocks ? noteblocks ?
meanwhile me, just done autoconfig for spigot lol (annotation-based config loading)
Would you share the code for creating the box outline with particles? (0:33)
Really appreciate you my fren
as for figuring out somewhat different but consistent colors I use a random where the seed is the chunk key or something
or the claim id either works
that way different claims have different color outlines but it's consistent
how do u show texts on guis?
i always wanted to learn about that
those texts
You already know how the background is done, right?
it's basically the same
different fonts for different heights
negative spacing to align it all
so those all texts are on the title?
yup
So I understand that the title doesn't have a character limit, or at least not a small one
how much is the limit to be exact
Okay now pay up
i only have two fortnite bucks
do u do it manually?
fuck no
it should
i always wanted to do things like that guis with that dynamic texts, ill try to do it
bet you didn't notice the progress bar on the first UI :)
not using tags for those %% placeholders :(
:(
I mean nothing's stopping me from doing that
but no
it'd make things annoying because placeholders don't always have names
they're just replacement functions
which lets me just add a PAPI function in the middle and whatever
can also do that with tags tho
shoo
stole it off nexo but you can just lookup negative space character
and make a tag that aliases to lang:space.20
or whatever
I don't have nexo, but I'll look for it. In any case, let's say my negative symbol is "a." If I want to move some text down three spaces, this would create something like this:
"title aaa mybuttombelow"
you need to know the width of every character for every font
title is probably like 24 characters long or something
so you send like
titleshift:-24mybuttonbelow
except every height needs its own font
if i use normal font i need to know it too
yup
is there any website to know about it?
i have a class for that
to use <center>
but i stole code by myself it somewhere years ago
uh i have that one
looks like it is outdated
I'm also accounting for the 1 pixel after each letter
server-side frustum culling, packet batching
that's what I added
frustum culling has an awful pop-in effect
does that look like my problem
I have a minimum render distance of 20, so packets are sent anyway if you're within 20 blocks for the most egregious examples
otherwise it's culling
and I don't update animations for stuff that is culled
alos it's all in async
I'm taking a mixed approach
half of it is shit, the other half is doo doo
render distance based on the viewing angle + ray casting + whatever else
I check if I can see any other corner of a bounding box
works pretty well
if you can't see any vertex of the bounding box / hitbox then you definitely can't see the entity
what if the entity is multiple blocks long and you can't see the vertex but you can see the edge
it's unlikely but possible
the only way you'd get mc to render something like that up close would be to put several entities together through multiple bones because mc models have a hardcoded limit of something like 111 pixels
I have it in my wiki somewhere
so no it is not possible
when you take my minimum render distance into account
what if it's not an open space
and you're seeing through like a slab or between 2 blocks
and you're more than 20 blocks away?
then maybe you should get good and just live with the fact it will pop in when you're closer
wrong symbol i guess
I'm more concerned as to why your entire inventory is invisible
haha is the rp
how do i shift vertically now 🤔
tried searching the symbol on https://docs.nexomc.com/ but no results
different fonts for different shifts
keep in mind that horizontal shifts still apply across fonts
oh so something like this
https://www.reddit.com/r/MinecraftCommands/comments/cbswrd/negative_space_unicode_character/
uhh im not getting it
this does left-right
for vertical, make a font that's a copy of the default font
but change the ascent of it
you can make copies of that ascented font with different ascents for different heights
For example defaultslot1, defaultslot2, defaultslot3
oh so i need to make a "copy" of a font for each slot
for each vertical change yeah
so 6 rows I guess
I have as many as 20 for some more complex stuff
Not sure if this is considered development related or not, but is there a decent documented library that contains premade frequently used things such as colors, GUIs, item stack manipulation, etc.?
the difference between development and server help would be asking for libraries vs plugins
all of those things mentioned are part of the development api so I assume you are looking for a plugin that does all of these so you can do it in game?
Then no, it's as you've said, development-related. I need a library with premade methods/classes that can faciliate coding plugins
I found something called AdventureAPI (and TriumphGUI for inventories)
what are you looking to do regarding item stack manipulation?
Normal things I used to do with meta data, such as changing name, lore, etc.
cant you still do that?
I mean I most likely still can, last time I coded plugins was in 1.8 so no idea, just thought maybe there are things to help make this quicker and reusable
Is /reload still a thing?
not sure, minecraft has its own reload command now
Oh that explains why it kept saying my username and "Reloading!"
but it sounds like you wanna use the paper api xD
it has a data component stuff to edit item data
Shh we don't talk about that here lol (but yes)
Cool, I'll look into that then, thank you
when i worked on something similar for culling slimefun machines with expensive-to-render models, i combined all occluding objects into a single mesh and then shrunk the mesh so that holes in it, like the half-slab, got bigger; this way unless you were moving super fast, things would pop in while they were still obscured by other objects
this was quite expensive on the server side though so eventually i ended up going with a different approach that was more well-suited to the fact that machines were usually concentrated in enclosed rooms, but i'm not sure if this applies to your use case
for entity tracking packets, i use frustum culling with 3 different volumes with different update rates; entities even directly behind the player aren't culled entirely, they just send packets less frequently, making the pop-in effect when turning a bit less noticeable, though you can still see it if you look for it
since you're presumably working with display entities, in terms of bandwidth/packet spam, their built-in interpolation is your best bet at lowering them
it is unfortunately kind of shit and doesn't really support more than two consecutively attached bones, but accounting for these limits when creating the animations themselves can help a bit
Don’t display entities have an option to control how far they render from
they do, so you don't need serverside distance culling
the client also does frustum culling on them for rendering purposes, so unless you're cpu-bound on that, you shouldn't need to do frustum culling on the server side
unless what you want to reduce is the bandwidth from updating their position/rotation
all you can really do on the server side to help the client render faster is occlusion culling, but that gets very expensive very fast, and latency makes it look horrible unless you do tricks like what i mentioned, which make it even more expensive
at the end of the day i just told my players to install the entity culling fabric mod which does occlusion culling on the client side
Fair enough
wow
whats an easy way to create "zones"?
I wish to be able to know when players enter and exit the zones and be able to define/redefine the area of the zone at will
one way is to check the player's position relative to the zone every tick using a function but are there any better ways to do this?
Yup
i was trying to add a custom flag but it doesnt work can someone help me ```
public static void registerFlags() {
FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
final String flagName = "powertrims-abilities";
try {
StateFlag flag = new StateFlag(flagName, true);
registry.register(flag);
USE_TRIM_ABILITIES = flag;
} catch (Exception e) {
Flag<?> existing = registry.get(flagName);
if (existing instanceof StateFlag) {
USE_TRIM_ABILITIES = (StateFlag) existing;
} else {
System.err.println("[PowerTrims] WorldGuard flag '" + flagName + "' already exists but is not a StateFlag. This is a critical conflict.");
}
}
}```
they'll also support complex region shapes like polygons out of the box so you aren't stuck with boxes
Describe "does not work"
And catching Exception is not a good idea
ah sorry i meant the flag doesnt seems to be registering i was trying to make this flag deny but it couldnt find this flag ingame
i dont really know what im doing lol
Iirc, you can only register them during the plugin loading phase
oh
Need to be in onLoad()
ah thanks
i see, thanks!
hmm interesting
yeah and im pretty sure it overwrites the client
i can see the display entity, text entity from way further than what i can render
how to make pearls never go away
change the gamerule enderpearlsVanishOnDeath I think
And update to the yet unreleased Fall Drop 'cause that had some bug fixes I think
oh I'm still pink oops :D
hi i need a hd skin system with my client and bungeecord server. how do you do this system. Can I you help please
but it gose away when i leave the server
What version are you using ?
21
next time provide the number after . as well
But I don't see any changes in the wiki changelog regarding this, may be spigot server specific thing
Don’t they get removed when the player logs out
And then get respawned when they log back on
Hi guys, am I able to ask for help regarding java stuff here or just spigot specific?
hd skins isnt a thing on java
only w clients
yeah u can
as long as its not 🧻
yes the forbidden word after toilet
Anyways
Regarding constructors and Inheritance, if I have a constructor in a subclass am I able to use a this statement in a constructor and a super() in the next constructor?
i have no idea
but im pretty sure
u cant use this and super in the same constructor
Are you trying to run some stuff before calling the super constructor?
Yes @chrome beacon
For what purpose
No purpose, I am just curious because I am a beginner and want to know if I can
It is something that's being worked
Should be come available in Java 25 and is currently available as preview 22, 23 and 24
though for the versions you'll encounter the most 8 and 21 it is not
hmmm
If you want to read more about it it's called Flexible Constructor Bodies and the relevant JEP is 513
Yes
I assume they are saying that the pearls are gone completely even after player relogs
Which would not be vanilla behavior
i think it stacks on top of the client, since you send it as a multiplier where 1.0 is the client's normal entity view distance
Hey, you know with Polymorphism. What's the purpose of instantiating an object of the subclass and a parent class.
For example:
BankAccount | Parent Class
CheckingAccount | Subclass
name | object name
Code:
BankAccount name = new CheckingAccount();
can't wait for flexible constructor bodies
The exact implementation of BankAccount is irrelevant. You only need to know it's a bank account. Not relying on a specific implementation/subclass allows the code to be more flexible as you can pass it other types of BankAccounts and expect it to continue working.
banking oddly relevant to what i gotta work on
Ahh I see
It's good for flexibility
Anyone knows how i can remove the "Applies to: & Ingredients" from the item Meta? I tried ItemFlag.HIDE_ADDITIONAL_TOOLTIP, ItemFlag.HIDE_ATTRIBUTES but it doesnt seem to work
Isn’t that creative mode only stuff
Can see it in survival as well
Can always try slapping all the flags on
addItemFlag(ItemFlag.values())
If that doesn’t hide it then you’re out of luck
Iguess I'm out of luck 😢
Yes i did:
public static ItemStack createItem(Material material, String displayName, List<String> lore, boolean enchanted) {
ItemStack item = new ItemStack(material);
ItemMeta meta = item.getItemMeta();
if (meta != null) {
if (displayName != null) {
meta.setDisplayName(displayName);
}
if (lore != null && !lore.isEmpty()) {
meta.setLore(lore);
}
if (enchanted) {
meta.addEnchant(Enchantment.MENDING, 1, false);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ADDITIONAL_TOOLTIP, ItemFlag.HIDE_ATTRIBUTES);
}
item.setItemMeta(meta);
}
return item;
}```
I removed the all flags again
What’s the formula for horizontal air drag? I wanted to make a plugin to counteract/reduce it but idk how it’s calculated
On every tick, the game does these three steps:
Acceleration is added to the player's velocity.
The player is moved (new position = position + velocity).
The player's velocity is reduced to simulate drag.
We'll start by introducing Multipliers in an effort to make formulas more readable.
Ty
im have client
what client
then buy a hd skin on ur client ?
optifine mpc 1.8.9
- When they said a client, they likely meant one of those PVP clients which has a cosmetic store. Optifine on its own, would not have that.
- Could you further clarify what you mean by a HD Skin? Theres a possibility you're mistaken in what you're asking and we are confused.
- You can't exactly setup a "HD Skin System", each client handles skins differently, whenever you purchase a cosmetic on Lunar for instance, the server needs no particular software to render those cosmetics on other players, their client is what does the magic. There is no cross-platform plugin or service for exchanging those cosmetics between clients or software.
Through their “Mythic API?”
What’s your code look like?
the mobs code?
cuu:
Type: SHEEP
Display: '&dCừu Lv3'
Health: 9999
Damage: 0
Drops:
- cuurung
LevelModifiers: - health 1
- damage 0.5
Options:
MovementSpeed: 0.2
Silent: true
AlwaysShowName: true
Angry: true
this
how to send code like this
use ```java
3x then next to it the languague enter then code enter then 3x
anyone know how to fix?
You're in the wrong channel.
This is for plugin development. #help-server
ok
I am making my own client for my own server and since this client cannot be accessed externally, I can show this as an example of what I call a renderable hd skin: https://tlauncher.org/img/HD-Skin-Masken.jpg
Okay then, so if you're building the client yourself, you'd probably just have some plugin which sends a custom packet if its relying on a custom client either way
wait
i dont send image there
where to upload ?
or try this link
https://i.ibb.co/N6px5mx9/HD-Skin-Masken.jpg
ugly ahh skin
i need hd skin my opfine client
2015 ahh skin
This is like 1.7.3 when everyone had HD resourcepacks
How can I do the HD skin thing?
THATS THE NAME BAHAHAH
so is everyone going to be using your client?
yes
Okay. So for a second you need to forget about the server. The server is used to transmit packets which ultimately, the client needs to handle.
As is, can your client handle HD skins?
Atleast client-side / singleplayer.
How can I do this from 0? I have an MCP 1.8.9 optifine client and a Spigot server with bungeecord.
So are you prepared to make your own client?
like completely, write your own client?
Wait didnt you already say you have a client? I asked, "will everyone be using your client" and you said yes?
yes
but how do you import this skin system my client
Again, I am asking you, do you have a client written?
I am asking, are you prepared to, or have coded a client?
yes i have client and codes and run intelij idea
but where to edit which file
which class
You'll need to begin by actually modifying the client to even handle incoming skins, parsing them, and then actually physically rendering them. Hook into the skin render method, circumvent the part that downscales the skin, but rather scales it. However you do that is up to you to decide. I'd expect you to already have experience with clients. I think the class is PlayerEntityRenderer, atleast in Fabric.
You'll also need some kind of CDN or server where you're hosting the skins, and dispatching them to the client. Then write a plugin which sends the skin to the client.
i dont have PlayerEntityRenderer class only have SkinManager first blocks:
package net.minecraft.client.resources;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ImageBufferDownload;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
public class SkinManager
{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
private final TextureManager textureManager;
private final File skinCacheDir;
private final MinecraftSessionService sessionService;
private final LoadingCache<GameProfile, Map<Type, MinecraftProfileTexture>> skinCacheLoader;
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService)
{
this.textureManager = textureManagerInstance;
this.skinCacheDir = skinCacheDirectory;
this.sessionService = sessionService;
this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).<GameProfile, Map<Type, MinecraftProfileTexture>>build(new CacheLoader<GameProfile, Map<Type, MinecraftProfileTexture>>()
{
public Map<Type, MinecraftProfileTexture> load(GameProfile p_load_1_) throws Exception
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false);
}
});
}
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type p_152792_2_)
{
return this.loadSkin(profileTexture, p_152792_2_, (SkinManager.SkinAvailableCallback)null);
}```
How do I edit this part?
i dont know dude
You should ask in a modding community
i dont even know if there are MCP groups nowadays
The problem is that there are no such groups :(
Should be RenderPlayer in MCP 1.8.9 as I know, you can go to LegacyModding server for help
ta
mal mal proje yapiyon bosuna .d
video olarak çekiyorum kanka millet öğrensin diye
sen biliyormusun hd skin nasıl entegre etçeğimi
emir
java biliomusun briaz
my mob dont deal poison
- potion{type=POISON;lvl=2;duration=100} @PlayersInRadius{r=1}
is there any wrong with that code?
lol
hi
show us more mm config, thats not enough
uhh i need a nick plugin that works with death messages and leave messages
anyone has it?
for 1.21.5
the best one i could find is haonick but when i type in chat it shows my name blue and doesnt really work with death messages
i did change the config a little to make it work with join and leave messages but no idea about the chat and death messages
and it also works in tab
you'll have to listen to the death events and replace the player's name in them
çok az biliyorum
idk if there are any good free nickname plugins
i just need to make it work with death messages
cant i do it with config
listen to the player death event
wdym by listen
in your plugin write an @EventHandler for the player death event
@waxen anchor english only
an event listener
okay
hmm
do u think it ll work with nicked death messages?
get the nick from your nick plugin of choice through its API and then substitute it for the player name in the death event handler
no but if you take a screenshot of your current project layout in your ide or whatever i can probably tell you which class to put it in
im on aternos tho
idk how to host a local
do i need any other plugin other than haonick rn?
i have the nickapi too
sen bana biraz nereyi ne ile değiştiriceğimi söylesen (kod olara değil tabiki yani mesela class söylesen buraya şöyle bir mantık ekle desen eklerim en kötü gptden yardım alırım)
translate: If you could tell me what to change and where (not as code of course, but for example if you told me a class, I would add a logical element like this and at worst I would get help from GPT)
vc?
vc derken
translate: I mean vc
voice chat
ik englisd dw no need to translate
are you not coding a plugin?
this is dev-help
no idk how to code
ok
I'll be there in 5 minutes then.
i dmed u
u need to change the renderer to support 128x skins
or 64x idk
but then u need ur own skin uploading system
cuz u cant upload hd skins into java
so u need to store the players skin on ur client and render it from wherever u store it
can u help me too
how do you do then
i need a good nick plugin that work for death messages
idk u gotta see how mc renders the current skin
go in #help-server
u need to also change the model of the player to fir that
why
sunlight has all of it
because this is for coding help
its not about server
it is?
are you coding a plugin?
yea and i need help with config file
no, that is not coding
but like someone that knows coding can fix it
we cant fix it
ur searching for a plugin
go help server
and i already gave u a recommendation
public BufferedImage parseUserSkin(BufferedImage image)
{
if (image == null)
{
return null;
}
else
{
this.imageWidth = 64;
this.imageHeight = 64;
int i = image.getWidth();
int j = image.getHeight();
int k;
for (k = 1; this.imageWidth < i || this.imageHeight < j; k *= 2)
{
this.imageWidth *= 2;
this.imageHeight *= 2;
}
BufferedImage bufferedimage = new BufferedImage(this.imageWidth, this.imageHeight, 2);
Graphics graphics = bufferedimage.getGraphics();
graphics.drawImage(image, 0, 0, (ImageObserver)null);
if (image.getHeight() == 32 * k)
{
graphics.drawImage(bufferedimage, 24 * k, 48 * k, 20 * k, 52 * k, 4 * k, 16 * k, 8 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 28 * k, 48 * k, 24 * k, 52 * k, 8 * k, 16 * k, 12 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 20 * k, 52 * k, 16 * k, 64 * k, 8 * k, 20 * k, 12 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 24 * k, 52 * k, 20 * k, 64 * k, 4 * k, 20 * k, 8 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 28 * k, 52 * k, 24 * k, 64 * k, 0 * k, 20 * k, 4 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 32 * k, 52 * k, 28 * k, 64 * k, 12 * k, 20 * k, 16 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 40 * k, 48 * k, 36 * k, 52 * k, 44 * k, 16 * k, 48 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 44 * k, 48 * k, 40 * k, 52 * k, 48 * k, 16 * k, 52 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 36 * k, 52 * k, 32 * k, 64 * k, 48 * k, 20 * k, 52 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 40 * k, 52 * k, 36 * k, 64 * k, 44 * k, 20 * k, 48 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 44 * k, 52 * k, 40 * k, 64 * k, 40 * k, 20 * k, 44 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 48 * k, 52 * k, 44 * k, 64 * k, 52 * k, 20 * k, 56 * k, 32 * k, (ImageObserver)null);
}
graphics.dispose();
this.imageData = ((DataBufferInt)bufferedimage.getRaster().getDataBuffer()).getData();
this.setAreaOpaque(0 * k, 0 * k, 32 * k, 16 * k);
this.setAreaTransparent(32 * k, 0 * k, 64 * k, 32 * k);
this.setAreaOpaque(0 * k, 16 * k, 64 * k, 32 * k);
this.setAreaTransparent(0 * k, 32 * k, 16 * k, 48 * k);
this.setAreaTransparent(16 * k, 32 * k, 40 * k, 48 * k);
this.setAreaTransparent(40 * k, 32 * k, 56 * k, 48 * k);
this.setAreaTransparent(0 * k, 48 * k, 16 * k, 64 * k);
this.setAreaOpaque(16 * k, 48 * k, 48 * k, 64 * k);
this.setAreaTransparent(48 * k, 48 * k, 64 * k, 64 * k);
return bufferedimage;
}
}
``` where to edit
we make plugins, we aren't as good at suggesting them as the people in help-server
you'll get better help there
probs all ghose math
since u beed to calculate it to a sifferent resolutin
it looks like k is some sort of image scale and a power of two
public BufferedImage parseUserSkin(BufferedImage image)
{
if (image == null)
{
return null;
}
else
{
this.imageWidth = 64;
this.imageHeight = 64;
int i = image.getWidth();
int j = image.getHeight();
int k;
for (k = 1; this.imageWidth < i || this.imageHeight < j; k *= 2)
{
this.imageWidth *= 2;
this.imageHeight *= 2;
}
BufferedImage bufferedimage = new BufferedImage(this.imageWidth, this.imageHeight, 2);
Graphics graphics = bufferedimage.getGraphics();
graphics.drawImage(image, 0, 0, (ImageObserver)null);
if (image.getHeight() == 32 * k)
{
graphics.drawImage(bufferedimage, 24 * k, 48 * k, 20 * k, 52 * k, 4 * k, 16 * k, 8 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 28 * k, 48 * k, 24 * k, 52 * k, 8 * k, 16 * k, 12 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 20 * k, 52 * k, 16 * k, 64 * k, 8 * k, 20 * k, 12 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 24 * k, 52 * k, 20 * k, 64 * k, 4 * k, 20 * k, 8 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 28 * k, 52 * k, 24 * k, 64 * k, 0 * k, 20 * k, 4 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 32 * k, 52 * k, 28 * k, 64 * k, 12 * k, 20 * k, 16 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 40 * k, 48 * k, 36 * k, 52 * k, 44 * k, 16 * k, 48 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 44 * k, 48 * k, 40 * k, 52 * k, 48 * k, 16 * k, 52 * k, 20 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 36 * k, 52 * k, 32 * k, 64 * k, 48 * k, 20 * k, 52 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 40 * k, 52 * k, 36 * k, 64 * k, 44 * k, 20 * k, 48 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 44 * k, 52 * k, 40 * k, 64 * k, 40 * k, 20 * k, 44 * k, 32 * k, (ImageObserver)null);
graphics.drawImage(bufferedimage, 48 * k, 52 * k, 44 * k, 64 * k, 52 * k, 20 * k, 56 * k, 32 * k, (ImageObserver)null);
}
graphics.dispose();
this.imageData = ((DataBufferInt)bufferedimage.getRaster().getDataBuffer()).getData();
this.setAreaOpaque(0 * k, 0 * k, 32 * k, 16 * k);
this.setAreaTransparent(32 * k, 0 * k, 64 * k, 32 * k);
this.setAreaOpaque(0 * k, 16 * k, 64 * k, 32 * k);
this.setAreaTransparent(0 * k, 32 * k, 16 * k, 48 * k);
this.setAreaTransparent(16 * k, 32 * k, 40 * k, 48 * k);
this.setAreaTransparent(40 * k, 32 * k, 56 * k, 48 * k);
this.setAreaTransparent(0 * k, 48 * k, 16 * k, 64 * k);
this.setAreaOpaque(16 * k, 48 * k, 48 * k, 64 * k);
this.setAreaTransparent(48 * k, 48 * k, 64 * k, 64 * k);
return bufferedimage;
}
}```
will it work ?
how do you try this code ?
which plugin set support hd skin
r u stupid
lol
okay but how do you set my skin to hd ???
Isn't there a spigot plugin I can try instead, like skinrestorer, where I can add HD skins directly?
are u turk?
??? i have minecraft client 1.8.9 optifine but how do you insert to hd skin and how do you join bedrock server on java editon ???
you make a mod for the client
as in you take your client and you change its source code to make it do something else
u cant join a bedrock server on java
the player model is harcoded
u cannot change it with a plugin
u can do resourcepack magic
but it will require all players to use optifine probably
yeah so just drop the silly project and do something else
malsin emir :D
🤡

imkansiz knk yapamassin
sonoyuncu nasıul yapıyor
crashout

ben şimdi
değişltirdim ya hani
skin kodunu
bunu nasıl deniyecem amk
skinrestorer desteklermi hd skini
onu soruyorum
sabahtan beri
dam
its not possible to do it with a plugin
nasıl deni
skinrestorer isnt magic its mc skins
isin rengi degisir
bu sunlight tum sunucuyu degistirdi a
@grand flint kanka adam akıllı yazsana bak şimdi elimde bi mc server birde mcp optine 1.8.9 client var ve ben bu clientdeki kodu değiştirdim ve daha fazla çözünürlük eklettirdim peki ben bunu şimdi nasıl test edicem hd skini nasıl yüklüyecem
su kocaman plugin dunyasında bitane bile sade bir nick plugini yok a
english only
hasbinallah
@grand flint Dude, write smart, look, I have a mc server and an mcp optine 1.8.9 client and I changed the code in this client and added more resolution, so how do I test this now and how do I install the HD skin?
al
translate denilen bir şey icat etmişler
send the hd skin with plugin messaging or something
applying it straight to the gameprofile won't work because texture data is funky
yo
im have
you can achieve hd skins with both a client + server-side mod but none of that is applicable to a vanilla client
he calls is optifine install custom
no
yk any good nick plugin?
im have minecraft mcp 1.8.9 optifine
haonick
thats not your client
how do i make it work with death messages
but open source işm have
or can i
and possble change codes
not my problem
how do you do this
by making a mod
im have all options
you're asking in help-development you should have a rough idea
If you explain to me how to provide client support with a spigot server where I can only use HD skin, the rest is unimportant
Given it's spigot you can't really run any mods
lol
you make a plugin that communicates using plugin messaging to send, to the client, the hd version of the skin
your client-side mod then receives that data and does whatever
dows optifine let u chaneg the player model
if it does u can do it with resourcepack and optifine
wdym
client modding is not my problem
i did checked the config but couldnt figure out some things
we don't do config help here
i said respurcepack
#help-server does
there is literally no one there rn
still not our responsibility to support
bc nobody has asked anything
then go there and wait for someone to be there
tf you mean no one asked anything
i hate turks
its been 17 mins since i asked
i wouldve answered tbh but ur just being annoying 🙏
idgaf about your answering atp🥀
racism
im a turk so jts ok
im european so its ok
that's why greece better
:(
I read that as cheese
Hey guys,can anyone give me an example on how 2D Arrays can be used in plugin development?
just a question out of curiousity :)
Quick question: On a LimitedRegion, if I call getBlockState(x, y, z), what happens if I try to get a block state outside of the region limit?
is it possible to serialize an entity (or more specifically, get their nbt as string) with the 1.12 api
getAsString() does not seem to exist there
im only looking to get a player's nbt as string
You'll probably have to use nms
i dont want that
maybe someone can recommend an nbt api
i was using bananpuncher's nbteditor but it seems to have stopped working on 1.21.8
if you are keeping track of some sort of board with x and y
Ey ppl. How does Minecraft LAN scanning work ?
My idea would be to send some scan packet to all possible ports (which is around 16k iirc)
But that just can't be it
my guess without digging in code https://www.baeldung.com/java-broadcast-multicast
Ye that's enough for me to start. Thank you very much.
morning
how are these cool bossbars made? i suspect its a thingy for sale because i see this everywhere
A bossbar retextured to be invisible and some font magic
i know, but is it something for sale? too lazy to do it myself
because i have seen this exact bossbar multiple times
one google search: https://polymart.org/product/2543/customnameplates
the "Custom Huds" section is what you want
oh hey im not the only weirdo that made a plugin to do that cool
So many great examples to steal for, great!
I mean- get inspired by ;)
I'll still have to do the receiving part too 'cause I'm not actually working with Minecraft here haha
But that should be fine
i probably shouldve cached that inetaddr lookip
omg tysm<3
what did you search exactly? im kinda not good at searching for resources lol
"spigot bossbar fancy text" lol
how to add sound to shop plugin
if it has a config for playing custom sound you can add a .ogg sound in sound folder of your resource pack and then define that sound in sounds.yml. then use the config to play that sound.
if not, you have to code it yourself
wdym
first look for any way to cghange the sound in config files of the plugin
if there is nothing there, you probably cant change it without actually changing the code of the plugin
but there no sound at all
the shop plugin, as if there was only 1
okay, then yeah you would definitely need to edit the code
where
since you ask in here I assume you have experience in developing a plugin?
check to see if the plugin has a github page/ open source
if its not open source it becomes way harder
does anybody know of or able to make a plugin that allows Twitch viewers in a Twitch chat to be able to earn tokens which they can use for chat commands to make stuff happen in a Minecraft server (creeper spawns, teleporting, etc.)?
?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/
u need to make a twitch bot as well
i have one
ill make it for 50£
i might take you up on that let me just ask around with a few people first
tell me ecxatly what u want though
or nvm look
here
free
so is this
the first one seems better
ive seen both of those but sadly they arent what im looking for
i want it to use a twitch bot where it listens to chat messages and commands are worth tokens
creper spawns, teleports
it doesnt listen for chat messages or use tokens though
commands only available through paid means and follows
which would be great except i making 100s of channel rewards isnt really the most efficient
i am an affilliate so thats fine lol
Yeah good
i have a file of an old program that worked perfectly before but now it no longer works
but i think the code might be in a backend
actually i think i found it
i got the old program to work awesome
its difficult if you dont know what you're doing
usually you should use another plugin
but if you have to use this and only this plugin only then you have to edit the code yourself or pay someone to do it
You mean like click sound when clicking in gui?
ya when you buy stuff
You making ur own thing?
Or else what plugin are you using
you can play a sound with Player::playSound
Well since it isnt open source i suggest you drop the jar into recaf gui and add playsound thing, then recompile. If you dont know what ur doing learn java first. Also you would need to do that for every new version of economyshop
Or you could make another plugin that listens for inventory interactions and checks if gui is from economyshop then play sound for player. But that would be nasty and last option thing in my opinion
When I'm sending a block break animation it only shows for a tick - how do I make it show indefinitely? Is there a better way other than using a runnable every triggered every second?
public static void sendBlockBreakAnimationPacket(Player player, Location location, int stage) {
((CraftPlayer) player).getHandle().f.sendPacket(
new PacketPlayOutBlockBreakAnimation(
player.getEntityId(),
new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()), stage
)
);
}
1.21.5
Thx I'll try that, does it stay?
No the player isn't breaking anything, I just want to send the block animation indefinitely
Yea sendBlockDamage() is awesome, how do I do my original question though? Sending it indefinitely until I cancel it? Is a runnable the best way?
the client times it out
if you want it to work across multiple blocks you might need to send the packet with a different (random) entity id each time
Right now it only sends for a tick, is that what you mean by times out? I want to be able to last until I cancel it
There’s a sendBlockDamage that takes a source entity for that
You just have to repeatedly send it on a timer task
Please who can Help me setup the license system for free dm me please
“The license system”?
Whats that
Obviously a thing that doesn't work but people seem to believe it will if they try hard enough
Hi, how can I get the CommandMap? With the paper API it's just Bukkit.getCommandMap() but that doesn't work for spigot.
oh
Yes I can and I am happy about that or is there any reason I shouldn't?
Hmm idk I will test it out for you. The JD dont say anything about this
No
It id
It is
this.getServer().getCommandMap()
Are you talking about spigot or paper now? Because yeah with paper api it works like this or Bukkit.getCommandMap but with spigot api there is no method to get the command map or at least i dont find anyone
Oh i thought you were asking how to do in paper sorry
Well I don't think that works in spigot since spigot just uses getCommand or something
I am new to spigot
Thats the problem. I want users to set the command names themselvesn which doesn't work with getCommand cause the command has to be in plugin.yml then
No theres no method to remove a command via commandmap but you can register commands and I think clear the whole map (1.21.8)
So does anyone know how to get the Command Map using spigot api?
@cobalt drift
Chatgpt:
- Getting the CommandMap
Spigot doesn’t expose the CommandMap directly, but you can access it via reflection:
import org.bukkit.Bukkit;
import org.bukkit.command.CommandMap;
import org.bukkit.plugin.java.JavaPlugin;
import java.lang.reflect.Field;
public class MyPlugin extends JavaPlugin {
private CommandMap commandMap;
@Override
public void onEnable() {
try {
Field f = Bukkit.getServer().getClass().getDeclaredField("commandMap");
f.setAccessible(true);
commandMap = (CommandMap) f.get(Bukkit.getServer());
} catch (Exception e) {
e.printStackTrace();
}
}
public CommandMap getCommandMap() {
return commandMap;
}
}
✅ This gives you access to the server’s CommandMap.
- Registering a command dynamically
Once you have the CommandMap, you can register commands with arbitrary names:
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
public class CustomCommand extends Command {
public CustomCommand(String name) {
super(name);
setDescription("A dynamically registered command");
}
@Override
public boolean execute(CommandSender sender, String label, String[] args) {
sender.sendMessage("You ran the command: " + label);
return true;
}
}
Then register it dynamically:
MyPlugin plugin = ...;
plugin.getCommandMap().register("myplugin", new CustomCommand("customname"));
"myplugin" is the plugin fallback prefix.
"customname" is the actual command name users will use.
- Letting users choose the command name
You could store the user’s preferred command name in a config file:
String commandName = getConfig().getString("userCommandName", "defaultcmd");
plugin.getCommandMap().register("myplugin", new CustomCommand(commandName));
This way, the command name is fully dynamic and doesn’t need to be in plugin.yml.
Google Spigot sommand map reflection
Haha I also asked chat gpt and he says I should get it also via reflection but from the PluginManager class. So I think listening to ChatGPT is not always the best idea
both are fine
ill try
Ah okay, so this would work?
try {
if (Bukkit.getPluginManager() instanceof SimplePluginManager spm) {
Field commandMapField = SimplePluginManager.class.getDeclaredField("commandMap");
commandMapField.setAccessible(true);
return (CommandMap) commandMapField.get(spm);
}
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
not that I remember
okay, ty anyways
theres no event for when a player enters/exits a worldguard region is there
ill just have to check if they are now in said region every time they move right?
for context, i am making a KOTH plugin and want to keep track of which players enter and exit the KOTH area (the area is a worldguard region in my code)
1st question:
Is there any method to get the Main Thread Executor? With the paper API it's just Bukkit.getScheduler.getMainThreadExecutor(plugin) but with this method doesn't exist in the spigot API.
2nd question:
How can I set the texture value of a player head ItemStack? With the paper API I use:
public ItemBuilder setPlayerHeadData(String textureValue) {
if (itemStack.getType().equals(Material.PLAYER_HEAD) && !textureValue.equalsIgnoreCase("null") && !textureValue.isBlank()) {
UUID uuid = UUID.randomUUID();
PlayerProfile customPlayerProfile = Bukkit.createProfile(uuid);
customPlayerProfile.setProperty(new ProfileProperty("textures", textureValue));
SkullMeta skullMeta = (SkullMeta) itemMeta;
skullMeta.setPlayerProfile(customPlayerProfile);
itemStack.setItemMeta(skullMeta);
}
return this;
}
But also that doesn't work out with spigot API
You'll probably get faster help here: https://discord.com/invite/enginehub
mm yes the programmer sock discord
the main thread executor is essentially just api sugar for (Executor)(Runnable task -> Bukkit.getScheduler().runTask(plugin, task))
Yeah Ill just us this then. I just like this one here more:
ConpletableFuture#thenAcceptAsync(() -> {}, Bukkit.getScheduler.getMainThreadExecutor)
Do you know how to set the texture value of a player head itemstack?
on paper yes, god knows about spigot, i don't use spigot and hardly anyone else does either
But please i need someone who can help me with the license system cuz for my plugin will be op
give it to me for free
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
if (!(sender instanceof final Player player))
sender.sendMessage("Only players can access this command");
player
return true;
why i cant access player? idk if i do something wrong it used to work back then but idk i have java 21 in project module
you are not returning
if (!(sender instanceof player)) {
send message foobar
return;
}
Is there an event that is triggered as soon as mobs become angry or target a other player?
thanks
In what case is getTo() Location of the PlayerMoveEvent null?
Since I noticed it's nullable
when the event is cancelled probably
though I wouldn't know for sure
there's probably some weird player state that makes it be null at some point
I don't think it's actually ever null
I assume it's for the PlayerPortalEvent which inherits from it
it could just override the annotation tho
🤷♂️
Guess we need the person who created this event 12 years ago to answer
It is for portal events fired for portals that lead to disabled dimensions
Ah
So, disable nether in server.properties and bam
I need to test if you can teleport a player to a location with a null world, I use location objects with null worlds and assign it later but never tested this case specifically... I would imagine either it bombs or just handles the teleport within the players current world
Fun nullability things 😄
it just throws an exception saying world is null
Bad edge case management imo
Am I correct in the assumption that given a world is null in a location then you should probably just handle the teleport for the world the player currently is in? Or is it truly better to throw here?
I suppose you could argue that it's better for debugging since I guess most cases your world shouldn't be null but in the event this occurs you'd still know the world is null because the teleportation occurred in an unexpected world
youll never be able to program a 100% secure licensing system. its practically impossible the best thing I can think of is to load code from a website, but have fun with it (pretty sure, it wont work either).
the Minecraft community is also 90% open source based, so make your plugin or whatever just open source and everyone gets something out of it
But its paid and i dont Really want the people to get it and just dupplicate and just it go as many plugins
just dont make it paid. people will always find a work around to get the plugin working for free. as I already said, just make your plugin open source. If people think its a very good one and want to support it, you could always make a donation link or something else
Nobody is going to buy your /spawn plugin bro 😭
But i made a free version and this is supposed to be a paid version
Thsi is gamemode plugin
you dont mean /gamemode right?
dont expect too much
No ite new gamemode like lifesteal smp and infuse etc .
then drop the free version and just make the paid one open source
I already did and its in spigot rn
Prolly better to open up a public server to get money from minecraft
I already did alot i have 3 years exp as minecraft staff
And i got 0
yes if you really want to make money from minecraft just make a good public server
or i think it would work out to provide a custom plugin development service
I did it had 20 pkayers daily but with no prophit at all
This really good i got from it 70
there you go
Hello, how do I get payload from CustomClickAction?
using dialogs
Or how can I do something like Consumer when clicking on a dialog button
being a mod for a 20 player server isn't meaningful experience
Hello, I encounter the following error when I try to set the AfterAction to NONE:
java.lang.IllegalStateException: Dialogs that pause the game must use after_action values that unpause it after user action!
MultiActionDialog multiActionDialog = new MultiActionDialog(new DialogBase(new TextComponent("")).afterAction(DialogBase.AfterAction.NONE)*<<---- error here*.canCloseWithEscape(false), buttons).columns(3);
I basically don't want the dialog to close when I press on a button. But this error basically disallows me to do just that. WAIT_FOR_RESPONSE does work, but idk why this doesn't. Any ideas on how to fix?
if I need to stick to WAIT_FOR_RESPONSE, how to respond?
@worldly ingot can you help me?
so basically, when you create a scoreboard usins spigot, you have to like create an objective with SIDEBAR, then you can add scores right? becuase I have been stuck with these ugly looking, required for working score numbers, but when I take a look at hypixel, donutsmp etc, I don't see them, how do you do that with coding? not external plugins
as of 1.20.4 or something, the client supports custom number formattings for the scores
so what you do is you send an empty number format where the score always gets rendered as an empty string
no clue how you do this on spigot
yeah, Score::numberFormat
🙏 ty
For future, please don't tag specific people like this
Just ask and wait for somebody to answer
also ?whereami
welp boys I'm fucking around with influxdb wish me luck
good luck 😭
can someone help me find this exact packet?
?mappings
Compare different mappings with this website: https://mappings.dev/
Does it lock your movements like this?
prob it does i tested something similar before
Well its either going to be that or the update entity position and look
Still unsolved ? :(
HAhaha
