#help-development
1 messages · Page 388 of 1
Yes, because literally nobody would buy their minecraft integration plugin anymore: https://www.spigotmc.org/resources/head-database.14280/
The API is free to use, but they rely on the fact that it's a pain in the ass to use their website and their search algorithm, which is why that would blow everything they offer out of the water.
anyways, I am working on my plugin and want to do some minigame using player Statistics, now the question I have is how would I make a system that can keep track of a certain statistic for each world per player of the game. my first solution is to use a map of the players current progress and their actual statistic progress as determined by the server to compare them and get the progress for the game, but idk if there is a better solution
and if there is a way to reset a player's statistics
depends on how you store them.
lets say I have a task like mine 10 stone
then the player might already have an existing amount of stone mined on the server from another source, so I dont want to count that
You're going to need to track your progress separately anyways.
just listen to block break events?
thats just an example
If you want to scope them per world, you're going to just have one progress listener per target world, which stores the progress on it's instance. You can later persist these.
but how do I listen for progress on a statistic
Hey, Many Servers have signs in the lobby to join a specific Minigame. But how do they comunicate between the minigame server and the lobby about the amount of players and when the game starts. Do they do that with Webhooks and if, is there another way to to this?
Listen to a big amount of events, :))
I want to able to use all statistics, and the event is not sufficient
there are many ways of doing that though, not just one.
and it doesnt help thats its not documented what statistics it does and does not keep track of
minecraft servers do display the amount of players currently online when you ping them.
I am talking about teh PlayerStatisticsIncrementEvent or smth like that
You're talking about this? https://minecraft.fandom.com/wiki/Statistics
yes those statistics
you know in the server list for your client where you can see the number of players online per server?
Man there are so many brigadier goodies just locked outside from bukkit api
what is that?
mojang internal command api
Bukkit api wraps it so primitively
but its for backwards compat
Yeah, those are scoped per world already, if I read that correctly. So you'd have to define some t0 point in time, from which you count, so you know what to subtract later on. Then, you'd just need to listen to the PlayerStatisticIncrementEvent.
idk how does minecraft know what nether and end belong to which overworld
Maybe they just misuse "world" for all worlds, don't know, you'd have to test
is PlayerLeaveEvent called when the server shuts down? if so, is there a way to detect that?
Huh? There's a nether and end per world on your server? xD
maybe it is something like <name of the world folder>_end and <name of the world folder>_nether?
and on top of that , this event does not post all for all statistics
well yeah lets take singleplayer for example
it would just have statistics for all 3 worlds in the same menu
but I know in singleplayer it might work a little different
Test it out. But you know in onDisable() or the PluginDisableEvent that all Bukkit.getOnlinePlayers() will have to leave soon, if that's not triggered.
Uhm, are you sure? The name kind of indicates that...
well its wrong
in the docs it says it doesnt post for stats like distance walked
which makes sense
since its measured in cm
Otherwise, you could check raw GameEvents
meaning it would overrun the whole event system xD
no gameevent doesnt have all cases
well I guess I will make something complicated again xD
here I go with my "simple" ideas
I thought you were crazy, but I really judged to quickly, xDD.
Hi, I've got a question, I'm placing a blocking using setType(), the problem is: since I'm in legacy and I need a Fern Itemstack, I've to set the material to LONG_GRASS and a durability in the ItemStack constructor to get the Fern, but if I change the block using setType(fern.getType()), he would get LONG_GRASS as type
yeah ikr
Hey, so I used your code and it work pretty well, just that I can't break blocks because the slime is little bigger than the blocks, and when I try to change the size, it's a too small, is there any way to fix it ?
I think the solution is in the block state, but I never done that so idk
oh wait is that the source? so that means these are the only ones not tracked by the event then
Yeah, that's from the craftbukkit source. No idea what version, something recent. I'm just searching around for a way to get a hold of these statistic changes.
Okay, I would know of a way to get callbacks for these statistics, but it's so dirty that I have a hard time even writing about it, lol
Remove the slime as soon as the player starts digging
well I decided to use a timer to check for them periodically as I dont need it to be precise to the same tick or whatever
I already use a timer for the game itself that ticks every second
Why not use a shulker?
and I dont need to check all stats for every game, just a subset
I hope that periodic check is executed asynchronously, as it's gonna be a shit load of iterations. Basically all statistics for all players, xD.
Oh, okay
at most its 36 statistics per player
and most probably being the ones that can be tracked using the event
Dont they have the same hitbox? Also their head is sometimes visible.
But yeah he could change 2 lines and try out a shulker box
Hmm, alrighty, whatever works for you! :). I think I'm going to try out the hook real quick, just out of curiosity. That would very likely be more efficient, but again - more dirty.
Nope they do not have same hitbox, but we see the head for a little but tbh it doesn't disturb
How can I check if someone has made an rod crit to an player (im on 1.8.9)
For anyone that doesn't know what an rod crit is, its bassicly an player rods another player, then instantly switches to the sword and give the enemy an crit hit. This will then double the damage taken to the enemy.
I see, thanks for the help though 😄
but I also saw something intersting, isn't it possible to do the same with colored marker ?
Then change the entity type in the spawn packet and remove the slime size from the metadata packet
Yup I already did it before sending the message ^^
Any hint?
?1.8
Too old! (Click the link to get the exact time)
That's a lot
btw I'm using 1.12.2, 1.8 def sucks
You need to set the item data of your block and not the ItemStack
Can I just 100% disable world gen?
Make your own world generator that returns empty chunks
Yeah but I just need to disable the minecraft:world gen
Or if you don't want more chunks set the world border
Wait, wdym
In legacy versions blocks have magic values. Some int which defines which variant the block is.
I think you need to set this value to something.
That's what I was looking for, now it's googling time for these "magic values"
I didn't even know the existence of them
Well, that would work: https://paste.md-5.net/gibabiziko.java
Output: https://paste.md-5.net/qaqiyukefi.css
I'm really wondering what would be more efficient, polling every n ticks or using this as a means to get interrupted whenever a statistic changed. Honestly, I think your solution will be better, just wanted to check how often these statistics are actually updated, for curiosity's sake, xD.
Because it's really spammy. I kinda underestimated that, xD
yeah I figured
less spammy than the move event
Even that has a threshold, so it's not that spammy
well...
Interesting idea injecting a proxy map to fetch when values change
I'm trying to remove it but I don't know how to get it since it's a packet 😅
Wait isnt there a StatisticChangeEvent already?
I feel so dirty for doing that... :(. But sometimes it seems like the only way, if you want real time notifications. And it wouldn't matter how many plugins do this, they just chain up proxies, xDD.
It doesn't call the event for spammy statistics.
Well, that's just my own notation of <parent>__<member>. Ideas for improvement are always welcome, :).
How does this work internally because this looks hella expensive
What looks expensive?
It just checks for the invoked method name and extracts the required information from the args if applicable, and always routes back to the vanilla map. No idea how the proxy works under the hood tho.
The anonymous class you pass there
That's the java.lang.reflect.InvocationHandler, which in essence is an interface with just a single method.
Well all you can hope is that the JIT compiles your method invocations fast...
Oh, you're talking about the overhead I add to calling methods on the map because of the reflection "relay"?
As well as getting the method handle in the first place, which is not cheap
Not sure if I understand what you're getting at, because both method handles are known. The proxy (very likely) caches those, so the only overhead is using reflect to call methods, instead of "native" calls.
I think InvocationHandler uses java lang reflect Methods
They are reflection methods, not my wrappers, as the proxy only operates on java lang stuff. My wrappers don't add any cost either tho, they are just singleton wrappers which add separate features
Good thing for you that reflection now uses method handles internally
Oh, so you're talking about something entirely different
But for older versions that is a performance issue irrespective of whether they are cached
Cached methods still have an overhead
I myself generally make such proxies through just a wee little bit of ASM
Man i really need to jmh benchmark method invocations in newer versions
All I can say is that I expect the Proxy to behave as efficient as possible, and that I don't know of any other way to get called whenever a map is being modified, xD.
I don't think the overhead is of any significance, but I guess a little timing wouldn't hurt.
Yeah, that's... the next level solution, :)
Well method invocations in java 8 could be from anywhere between 20x and 100x slower
*Pre JIT
The thing is that I'd guess that they do quite some optimization under the hood. It's not like these are two dynamically fetched methods, both of them are known and this is the application for a Proxy.
I wouldn't be too surprised if there aren't any optimisations for Proxy
Looks interesting! :). It surely isn't hard, but it requires quite the knowledge of java bytecode. I still have some learning to do on that part, :-:
the worst thing is one knowing how a method descriptor works and knowing that doubles are longs are of computational category 2 and thus occupy 2 slots in the local variable table
(doubles and longs are the worst thing to happen to JVM bytecode tbh)
Bson not being built into plugin jar
Is there a method to grab how much time of ban left from the banned-players file ?
banentries
2.789042ms
10.712125ms
First is 1M calls without the proxy, second is 1M calls with the proxy just rerouting, not doing any additional work. I guess it would be fine for what I used it for, but it's really hardly optimized.
hello, someone unaware of me changed my e-mail address and password
How do you spawn a FakePlayer using nms? in 1.19.2
do bungee and spigot share any object of message receiver (something like commandsender)?
How do I get the direction the player is facing using spigot

How do I get the direction the player is facing using spigot
As a vector or as a BlockFace?
as a vector
getEyeLocation().getDirection()
player body or head facing?
yeah, jmh takes an eternity to complete
Benchmark Mode Cnt Score Error Units
ReflectionBenchmark.callMethodPublic avgt 5 0,987 ± 0,003 ns/op
ReflectionBenchmark.handleMethodPrivate avgt 5 3,851 ± 0,006 ns/op
ReflectionBenchmark.handleMethodPublic avgt 5 3,908 ± 0,210 ns/op
ReflectionBenchmark.reflectMethodPrivate avgt 5 16,220 ± 1,851 ns/op
ReflectionBenchmark.reflectMethodPublic avgt 5 15,788 ± 0,993 ns/op
Well not as bad as i expected honestly. This is small sample for java 17.0.2 and only 1 fork but still a visible diff.
Hi, i want count all items from custom itemstack in inventory, java public int amount(Player p){ int amount=0; for (ItemStack is : p.getInventory().all(coin.coin()).values()) { //gets all Stacks with the specific Material //checks, if the damage is correct amount = amount + is.getAmount(); //adds the amount of the stack to the counter amoun } return amount; } this every time returns 0
that is a humongous difference really
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Although, I guess that even in the real world you won't reflect that often. The method bodies themselves will make up most of the difference
Usually you dont want to reflect at all... At least not like that. Only for meta programming and you would use a lot of Annotations for that.
But yeah 15x is still quite a bit
all() will only consider items where the items NBT and the amount match
someone link me bukkit schedulers
?scheduling
thx
So, how to count ItemStacks? i have defined ItemStack with custom name and lore, and i want to count all of this in player's inventory
Iterate over the inventory and check every slot with isSimilar on your coin item.
Then add the amounts.
okay, thx
Inventory#all(Predicate<ItemStack>) where \👀
Parent.Child.update()
should I do something like this? (Rather than calling it ParentChild.update())
Just for style points tbh
what context
It's mostly a utility class
well utility classes
And I have one utility that adds to another
usually utility classes if thats even a thing, dont use inheritance
Yeah they don't
static classes
just wanted to know some naming for better context
rather than doing Parent.updateChild()
I usually have an update method on the child
Mainly because Parent already has like 6 methods
don't want to make it responsible for Child as well
then dont make it a parent
Would anyone be able to point me in the direction of generating custom ores or even just changing vanilla ore generation? I have been trying to find anything to get me started but I cant seem to find anything.
since parents are responsible for its children
I mean it's not exactly a parent, I just figured giving more context to a subset of methods would be sort of making it a parent/child thing
Where the methods are still technically of Parent, just wanted some better naming for em lmao
well then I would need to know the actual context since its a preference thing anyways
if only it worked like this irl 
it should xD
some of these children get no parenting and it shows
Well I figured naming it ParentChild would work better
but just like bad code it can fail
When mined STONE it drops an XP orb but the xp orb does not give me any xp. What to do?
https://paste.md-5.net/puvotalayi.java
but whatever
You need to set the orb's level
any link?
again, without context I cant give a better answer
world.spawn(location, ExperienceOrb.class, orb -> {
orb.setExperience(20);
});
You can use the spawn method to apply things to the entity pre-spawn
thanks
also
please store player and inventory into a variable
easier to read
and
@tawny remnant
FYI don't use lore to store enchantments
?pdc is a better alternative
you can still display the enchantments in the lore, but you should really query from pdc
Anyone got any idea on this?
yeah but i like it this way 😅
Trust me, it'll be easier to read later on lmfao
did the same thing as you
your loss
Sadly I don't really, never seen anybody do that tbh
maybe you can check some mc source and see how they do generation
people have to fail at it to see why it should be changed
then apply that in a chunk generator
declaration: package: org.bukkit.generator, class: ChunkGenerator
Might work
How can I deobfuscate nms so the method names arent a() or b()
?buildtools is the way
add --remapped to get deobfuscated
?nms
also that
Thanks ill try to figure soemthiong out
https://github.com/DerFrZocker/Custom-Ore-Generator you can also check this maybe @graceful oak
not made by me
uses NMS though
an easier way is on chunk load, if the chunk doesn't have a pdc key, set it and replace some part of stone with the ore
that way it only gens once
and is a bit easier to do
though it ain't the best way imho
declaration: package: org.bukkit.event.world, class: ChunkLoadEvent
oh wait yeah you can just use isNewChunk()
no need to store pdc
wait nvm
@graceful oak sorry for pinging again lmfao, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/BlockPopulator.html
declaration: package: org.bukkit.generator, class: BlockPopulator
this is the thing that is meant to do block generation
you can use it to generate ores
ok thank you for all of this
Why do cats get affected by scoreboard teams prefixes/sufixes?
Cats or other tamed animals I guess
Probably because the code is checking livingentities and not just a player
Do you have a snippet of the code?
I'm out right now but I can send in like 2 hours 😭😭
Someone sent me this from my server
they belong to the player
the technical reason why this happens is that the prefix relies on getting the team from the player using OwnerUUID NBT tag. The only way to prevent tamed animals from being affected is with packets
?jd
does that still work for 1.19.2
check out the javadocs and search using the search bar
how do I change the damage of an item
like the attack damage
instead of just asking
you mean attributes?
there is api stuff for changing attribute modifiers
instead of 7
ok I guess you can do that
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
going to have to play around with the attribute modifier stuff
thank you
that isn't the only thing in regards to what I link
just a link to give you something to go in the right direction 😛
meta.setAttributeModifiers(); I got this but I'm not sure what I put in for the item damage
meta is the ItemMeta for my item btw
Is there any variable to get all the Online Players? (I'm trying to send a Title to all players)
Bukkit.getOnlinePlayers
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("my_modifier", 2, AttributeModifier.Operation.ADD_NUMBER));
Something like this, I guess.
yep
thank you
yeah
because I used that cmd to run the buildtools but it still is obfuscated
why is your cat called serb 😳
Yes it's cultural appropriation 🤓
?paste
Can anyone help me with this? I want to create an item with which you can determine whether you can make double jumps or not. However, when the player enters the server the double jump is always on and I don't want that. Here are my classes. InventoryManager: https://paste.md-5.net/lunoruniro.cs InvPlayerInteractClick:https://paste.md-5.net/otetudomik.cs DoubleJumpManager:https://paste.md-5.net/abagugaseh.java InvJoinListener:https://paste.md-5.net/dohadodisi.java
Plugin load and unload events?
Is there an easy way of finding the changes between two inventories?
nvm, solved it
is there a way to remove the displayed damage of a diamond sword
like so it doesn't say +7 damage
when I hover over it in inventory
You can only hide all attributes, don't think there's a selective way to do so
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
how do i send a title to all players?
https://paste.md-5.net/ogonoyufud.coffeescript
Bukkit.getOnlinePlayers().foreach(player -> {
player.sendTitle(stuff);
});
forEach
Or just don't obscure your code and use the real deal, xDD
i havent touched a ide in like a week
. My idea is kinda like this so when a name tag is right clicked when holding it activates a command for example it creates the use who pressed it a tag
what theme is that
Huh? It's the meme of overcomplicating simple things.
he is asking about your ide color theme
That's halcyon
ah thanks
what kind of monstrosity i've made
i've managed to hook brigadier to bukkit api
so basically to have a hybrid of both lmao
it doesnt use minecraft fallback prefix as you can see
wow
var x = 100; this is legal java declaration
since java 10
so basically i've had auto type from cpp and i didnt knew anything about it
I did something similar once, only difference being that I didn't go through hooking into brigadier, I just wrote my own little highlighter, xD.
Tbh, it's not really helpful anyways. You're basically giving up some of the strong typing a language like Java offers.
i dont like em
Of course not, but the compiler - your best friend - won't complain anymore. If you call a function and store the result in a var, the only thing that matters is that all call sites using that variable still work. The underlying object could have changed to a point where it's not even assignable anymore. It obscures things, there's nothing good about it. I wouldn't look up to cpp features, as cpp is a steaming pile of shit and a huge featurecreep.
...
it does compile the same as if I wrote it
if i had an compile time error
auto would also prevent that
at least in cpp
public class particleAnimation {
public particleAnimation(Location loc, Player player){
player.sendMessage(String.valueOf(loc));
Location chestLoc = loc.add(0.5, 0.5, 0.5);
Location particleLoc = chestLoc.clone().add(0, 2, 0);
Vector direction = particleLoc.subtract(chestLoc).toVector();
double distance = particleLoc.distance(chestLoc);
for (double i = 0; i < distance; i += 0.1) {
Location particle = chestLoc.clone().add(direction.clone().normalize().multiply(i));
ParticleEffect.FLAME.display(particle);
}
new crateRewards(player);
}
}
Why the hell does this make particles fly to the moon, and not just two blocks?
im not sure if that's the problem, but maybe because your i starting point is 0
and multiplying each of the components of vector by 0 would return you a normalized vector of (0,0,0)
although im not sure
Well it says the starting point is at 104
and particle loc is 107
106*
For some reason it sets the distance to 362??
what i mean is that your for loop starts at 0
hmm could be lemme try something else
you're multiplying by scalar value of 0
If a vector is multiplied by zero, the result is a zero vector (0,0,0).
I started it at 1 this time, still flying to the moon
Also it worked before when i didnt have it in its own class
what's the distance
can you output it?
can you add the java keyword please, so itsbetter to read?
Yep i output it it comes out at 362..
yea i just realised that the zero multiplication would work just fined here because you clone the objects
There you go
thank you
well then something is wrong with code above particle code
its really better reading now
Didn't even know you could do it
Yep cant see what tho
You can do it for many:
java, javascript, typescript, C#, Rust, etc
yaml, xml, json, toml
Also one recomendation for better coding, classes must be named using capital letters. Its specified on Java conventions and its pretty recommended to follow them
what is the size of i?
In for loop?
do you mean distance? its the distance that's at fault
I know it is
but it helps to know what the size of i
is
because if its a large value that would explain why its going crazy
Yeah thats true, lemme just check
also you don't check for negative values
Yep thats the problem
Negativ values like?
-100 20 200
no shit sherlock 😄
no need to bully
soz
Arh, but yep i goes crazy
Vector direction = particleLoc.subtract(chestLoc).toVector();
when subracting vectors, you can have a negative vector
idk what im doing i had a too lang night i must be currently sleeping, i code whole night and didnt even go to sleep
What ive said ¿?
🤣
kind of, but not quite
right
Seems like an average day for me
Anyways, in either case, first should start with knowing what values it is obtaining
good thing i have uni lectures tomorrow at 12AM
But I know what im doing when coding at like 4am lol
otherwise how else you suppose to check if the math is correct if we don't got any numbers 😛
yeah that its the devs lifestyle, working too much, hard and sleeping few hours, sometimes not even sleeping
good thing I have school at 6.30am
Yeah me too ofc, but i have been coding for 9/10 easly without counting time for drinking, eating, toilet
Well I gotta get up at 6.30 and go to school at 7.05
How would i fix the "i" problem?
The what problem??
i felt like i was rotting from the inside
In my for loop, the i for some reason reaches 362..
Show me your loop please
oh weird, i used to get 5m before classes because the school where i used to go, is less than 2 blocks from home
Here
And whats wrong about the loop?
well my school was 2km from my home location
It adds .1 each iteration and compares it to the distance
and i always went to it by foot
Oh wait, i meant how would i fix the distance problem.. it should only come out to 2
I am going 2km by foot too
can anyone make a rainbow animated text into a hex for me please?
And back
my man
the magnitude of the vector is the velocity
When the distance is 2, its gonna iterate 20x in total
Dang im stupid it had .multiply at the end of the location "Particle"
i thought this want intentional as if you were trying to make the particle "accelerate"
Hahah nope just me being stupid...
Is there a .add instead of .multiply, because .add isnt it..
how i can set an item to unstackable
How do I make items like a snowball have a rainbow animation running to the left
How do i make the server to listen to this all the time?
https://paste.md-5.net/xuyefavowe.cs
hey im having a small problem with the buildtool, where can i find help about it ?
?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!
How to I make animated rainbow hex?
How do I make items right click to run a command?
how i can make that you can't have more than an specific quantity of an item
You listen on the PlayerInteractEvent and then call whatever you wanna do
I’m really new to developing could you possibly help or link a tutorial please?
I do not know any tutorials on things like that specifically, but its just simple events so yeah
Please note that Copy-Pasting that won't make it work automaticly
Is it possible for example deluxetags if I made separate name tags and right clicked on different ones they will run different commands but not effect the main name tag?
Yes
Is it okay if you can show me an example in DMs or something please
No example for it, just gotta identify the nametag(idk how you specificly wanna do that) and run it based on that
Yes but I don’t want to effect the actual name tag
effect what?
So for example deluxetags I wanted to rename a name tag and then when players right click it runs a command giving the player the same name as that name tag
Then once right clicked disappeared
Wdym
Alright I’m new so I don’t even know where or how
Lmao
In the InteractEvent I told you
Thats me spamming maven compiles hoping it'll work someday
Your gonna know the answer lol 😂

Kinda it depend on how hard it is more hard it is I would pay
Oh
Wheres that lmao
Is it okay if someone made it for me?
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/
Okay so i'm running the buildtool for 1.12.2 on java 8 with git bash on Win10 and im getting this error (look at the error's pastebin : https://pastebin.com/ipT8xGMW) and i checked the help post about it and it gives a solution for Linux users (see picture) but, the twist is, im on Windows and i can't seem to find anything about it for my situation, Im sure it's a dumb error but i cant find a solution hope you guys know smth about it
Does it seem like a bad idea not to use a database for storing custom data for a player, such as their rank and wealth? Although it’s easier not to use such a system, are there dangers in using other methods?
Could you dm me link to the page when it’s uploaded?
Well if its a private server, I'd personally always prefer using a database because of things like access from other services, easier management and administration
This would be for a public server, so probably using a database would have even more advantages in that case, right?
My deluxe tags won’t work with essentials chat for some reason
By private server I mean a server that is privately managed and not some system that will be uploaded and used by different unknown servers
Oh, makes sense.
Thanks
For things like ranks and wealth I would definitely use a database(in that case some SQL-engine like mariadb)
You can easily scale that and access data from different services like different servers, or even integration from lets say a discord bot or a website easily
So how easy would you is it to create rank papers for example
What is rank papers
So say just a paper saying like Rank Note: Owner for example then once right clicked it runs lp user group parent set but on the places that right clicked only
Another 5 minutes of work lol
Ah right I need to learn that will there be any tutorials on how to do item that when right clicked runs commands cause I searched it and it just comes up with like right click counter on Minecraft and stuff
You are supposed to learn java and then the bukkit API
Not randomly try out stuff you read by copy-pasting something someone wrote on some forum
tbh splitting it have some pros
it allows decoupling of the separate instances
you can disable these events anytime you want just by removing the specified class listener
but i would use GUI api anyways
Wohooo, first proper use-case of my parser, lol
Is it possible to print out custom mesagge for missing dpendancy
not soft dependency
get dependency api .. If null print message
whats that meant to be
I would assume hearth
a heart has more than 4 holes?
:(
is my anatomy that bad
actually it's 4 holes numbnuts
the three vertical ones in a row are tied to the same artery
is that top thing not 2
only when you play dubstep
is there a way to spawn custom particles from a resource pack via the spigot api?
you can animate with bloch bench
does any of you know how brigadier colors work
i've been trying to research those but to no avail
ik they're somehow tied to parse type of client
but i cant replicate it
Hi. I know that this is probably a very common topic, but is there any plugin or other simple solution to keep entities active in a specific chunk? Something like /forceload x z, but to keep the entities loaded.
It can even be a fake player BOT placed under a farm to keep the nearby chunks entities loaded.
The way with BOTs and ProtocolLib seems quite complicated NGL. Something ready to use?
Thanks for help!
@remote swallow
is that model based off a rabit
no, it has no base
i see a rabbit
cooked one
anyone?
ngl making models is quite fun
Detecting when a block gets powered
wish I had more time to do that
any ideas if it's possible to show custom particles somehow?
anyone looking for a plugin developer?
?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/
this would be a weird place to ask it for considering almost everyone here is a developer
or at least trying to become one
well if 90% of people that are in here are devs, here would be a good place to come for developers
i'm looking for customers
anyone??
i cant replicate the argument coloring of brigadier no matter what
uhmm
com.mojang.brigadier.tree.CommandNode<CommandSourceStack> bchildnode = Commands.literal("gg").then(Commands.argument("", DoubleArgumentType.doubleArg())).build();
root.addChild(bchildnode);
results in
when native minecraft command /attribute achieves this:
i always get the cyan color no matter what
is it like param number colouring
i cant seem to grasp what's wrong
because the cyan is first on both
you see in attributes double is green
which is the best way to delete a world and reload it again (in case i edit the world's folder) cuz i have issues with load chunks, and the tps is so bad
btw, i can provide some code also
while in my example its cyan
wdym
its not basing it off the type
its basing it off where the arg is
if you add another arg to that command you might have it end up being yellow
but shouldnt player be gray then?
the first is literal
so its not a param they choose
it exists for them already
like how the get is gray
so its indepedent from arg type
yeah
im guessing there might be packets or some internal thing you have to modify for it to change
just hope its not client sided
Keep entities active in specific chunk
that's the thing, there's no field that i currently know inside wiki.vg that specifies anything like this
i initially thought this was controlled by their types
thanks for your help
you saved me lots of hours of research that would turn into nothing
🥲
i'm facing issue with my tps, when new world loaded the tps dead cuz of chunks
any can help?
preload them
Im trying to figure out how to change things with Minecraft chunk generation and im starting with just putting trees around the world. The reference video I found was from 10 years ago and I think im doing it correct with the new methods but I keep crashing I believe because I am trying to get a block that isn't generated in yet.
I am using populate and adding it to the worlds populators here is what I have so far
Im not sure exactly how the populate works but even if I add a way to check if the chunk is loaded in wouldn't the populate not run again since it would of had to run to crash in the first place?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
how?
worldborder plugin allows you to do that
pregenerated chunks would take more disk space, but cheap to compute
@mortal hare then i'm gonna ask is that normal?
is this will decrease the performance?
did you check for lag machines
yep, the issues comes from the world chunk loaded
the details for the lag spike
If anyone knows anything about this that would be helpful
in range between 17 - 20
and i'm lagging so hard
its cuzing tp also
is thats not a development thing? cuz it happens to me when i try to copy a folder and load the world folder to spigot
so uhmm yep
Is it because of a plugin you wrote?
i guess no, i can provide you a code 1 minute please
new BukkitRunnable() {
@Override
public void run() {
try {
for (World world : getServer().getWorlds()) {
if (world.getName().equalsIgnoreCase("sglobby-v1"))
continue;
getServer().unloadWorld(world, true);
}
for (Arena arena : arenas) {
if (new File(arena.getMapName()).isDirectory()) {
FileUtils.deleteDirectory(new File(arena.getMapName()));
}
}
for (DeathMatch dm : deathMatches) {
if (new File(dm.getMapName()).isDirectory()) {
FileUtils.deleteDirectory(new File(dm.getMapName()));
}
}
} catch (Exception e) {
e.printStackTrace();
}
GameStatus.set(GameStatus.LOBBY);
}
}.runTaskLater(this, 20L);
``` this code will run in onEnable func
sglobby-v1 this map is the lobby so i need him
public synchronized boolean cloneUWU() {
try {
FileUtils.copyDirectory(new File("/minecraft/servers/SurvivalGames/maps/" + this.getMapName()), new File(this.getMapName()));
World world = Bukkit.createWorld(new WorldCreator(this.getMapName()));
if(world != null) {
world.getSpawnLocation().getChunk().load();
}
return world != null;
} catch (Exception e) {
return false;
}
}
``` this function make the load and copy the world folder (skip the name please)
and i have a hard lag, and tp issues but i don't know why
I don't know if I can ask here but is the most related, how could I get the player list of a server through a request?
when you reload the server in the server list you send a request for getting the player list, how could I replicate that?
do u mean an api request?
I want to send a request to the server directly
and tbh I have no idea how to do this
I would like a link or some resource if possible
imo, i can just make a socket server and fetch the information from it
Does anyone know if the BlockPopulator works with the newest version of spigot I might just be dumb but every time I keep trying to do something I am crashing / freezing my server does anyone know how to use it that I can ask questions to?
You can simple send a ServerListPing packet to the server. Thats what the minecraft client does:
https://wiki.vg/Server_List_Ping
You can take a look at the packet format here:
https://wiki.vg/Protocol#Packet_format
thanks
ill check it out 👌
Your JavaPlugin class?
This creates a new instance of your JavaPlugin class. That is not allowed. There can only one instance for this class
and its created by Spigot.
seems like you should try it 🙂
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You need to pass around the instance you have in your onEnable method.
either pass the instance or make a static method thing
either or works
typically should use DI though
Hi I am starting to make plugins, I just wanted to try to make a hello world plugin, but the import extends JavaPlugin on my main class isn't working. It doesn't give me an option to import. I have spigot 1.18.2 added as an external jar
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Im trying to learn how to change world gen with the populate and the depreciated one just comes with a chunk but the newer one comes with chunkX and chunkZ and I dont think im getting the chunk to change blocks correctly would anyone be able to help me out? Im just getting a frozen console when I start the server. I have more information here if anything doesnt make sense let me know https://www.spigotmc.org/threads/i-cant-get-blockpopulator-to-work.593659/
I tried using 1.19 aswell with the same problem, is 1.19 bootstrap aswell?
uhh how does supporting multiple versions of mc for a plugin work?
the post work for every version since 1.18
ok, ty for the help
You need to make use of the provided LimitedRegion and the methods it contains (setBlockData, setBiome, etc)
Depends if you are using NMS or not
I dont want it to be limited right now thought I want it to affect every chunk would I still need to use it?
well it doesnt need any nms as of now
So I would just need to check if it is in the region and if its not just return or am I dumb?
Then it’s generally as simple as putting the lowest api version you want to support in plugin.yml and using that versions api when developing
Spigot is generally forwards compatible
Although if you want to support pre 1.13 and post 1.13 you may want to consider a library like xMaterial
Sorry to keep bothering you but im still not quite understanding I see that I can use getBuffer to get an x and z coordinate but how would I use that to compare if I can change something in the chunk becuase if this is being ran wouldnt that mean the chunk is being generated also meaning that it would be too late to do what im doing?
You need to run BuildTools and grab the jar from your local repo. You will have the spigot-api jar in there which
you can just add to your project as an artifact.
getBuffer tells you how far from the X and Z passed to the method you can safely modify
Well, how far away from that chunk actually
So I would multiple the chunkX and chunkZ and compare to the buffer to check if its safe to modify?
The chunk at those coordinates should always be safe
The buffer tells you how far outside that chunk is safe
Show SwitchChild class
No @EventHandler annotation
(On the method)
don't extend GMSwitch
GMSwitch extends JavaPlugin, of which you MUST only have one
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Hi, i try to make a placeholder %wommr_country% thats display the mmr of a country (assaultPlugin.getStorageManager().getMMR(country);
)
https://paste.md-5.net/iwazigajif.java
But this isnt working ig
Im still lost here am I just forgetting to set a value or am I still reaching outside of the chunks I need. I get that I need to use the buffer to make sure im editing chunks but I just dont see what im missing
https://pastebin.com/2PgbTAmW
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
You can’t use the Chunk class
For a chunk that is being generated
You need to make use of the provided LimitedRegion and the methods it contains (setBlockData, setBiome, etc)
Oh so everywhere I set blocks I would use limited region instead of using the chunk and instead of getting the block I would use limited region to check it?
Yes
when I try to export my plugin, it asks for me to select an export wizard, but i don't know which one to do
there is team, java, run/debug, etc
what are you using? IntelliJ?
eclipse
I can help if you use intelliJ lmao
damnit
I'd say try run
that's what it is for intelliJ
export? ez
oh
i'm an eclipse user
whatsthe best way to create arena's but not save them if the server crashes or stops mid way through the duel also the best way to save the players inventory incase of a crasjh
you can code it as such then the battle is over it saves your stuff
not incase of a crash
im not 100% if onDisable is always called
i've heard rumors
You can serialize the inventory to yml easily enough
But something like a database is probably better
@young knoll Sorry to keep bothering you with the @ but im so close I appreciate all the help I am able to move around in chunks but I have my isInRegion not checking correctly would you be able to help me out with the bounds I can seem to get it right. Either I only make it the first chunk because when I multiply by my x and y the first one is always 0 which is the first chunk. Then why I try to use 16 for the chunks it crashes when I move at all
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
do you know how much space a base 64 string takes up?
probably depends on the length of the string i think
String#contains()
These are among the first few methods you learn when learning Java
I don't know what you mean "it only accepts chars". It accepts a CharSequence iirc which includes a String.
If you want to check if two strings are equal to another, you have equals() and equalsIgnoreCase()
If you're wanting the similarity between two strings, there are algorithms for that
I was able to figure out where I went wrong I corrected my math with the coordinates
iirc its about 120% of what was encoded
Quick question to check my math if I was scanning a chunk from top of world to bottom does this look correct for x and z coords?
int Xcord = (chunkX * 16) + X;
int Zcord = (chunkZ * 16) + Z;
X and Z are just in loops going from 0 to 15
The main reason I am questioning this is because when a chunk loads in im clearing out all of the ores and replacing with sponge just so I can visualize it and im noticing some ores aren't changing so im wondering if I am maybe skipping some blocks
https://pastebin.com/5CFYfieS
This is my full code if you need it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Im not really sure whats going on if it is scanning through all of the blocks because im ending up with this underground and while a majority of the ores are sponge now I still have some not changing
https://i.thick.at/kV6gD9Ex.png
Hi, i try to make a placeholder %wommr_country% thats display the mmr of a country (assaultPlugin.getStorageManager().getMMR(country);
)
https://paste.md-5.net/iwazigajif.java
But this isnt working ig
How are you testing if this is working?
Is the placeholder called?
wdym ?
Which of the placeholders methods are called?
I assume you debugged them
Add a debug message at every method here and tell us which methods get called, if any
i add a console.log (things like that) ?
ok i try this
I think i see the problem already. params does not include the placeholder itself.
how do i fix this ?
Print out params in the first line of your onPlaceholderRequest method and you will see
ok i do this soon i need to finish somethings first
I mean does it take up a lot of space to encode hunderds of itemstacks with base64?
in mongodb
Why would you worry about space in mongodb?
With a decent hard drive you can probably store data of millions of players in there.
Is it possible while using the populate I am beating Minecraft to putting the ores in the chunk because I checked the logs after printing out every block the plugin is replacing and the ores that don't get replaced are showing as stone when it checks them. If thats the case how can I solve this because im not really sure what I can do. I tried to add a delay but apparently I cant populate outside the tick it starts or something like that
Is there a way to save object in db?
This is Caused because chunks can also change blocks in neighbor chunks. Let A und B be chunks which are next to each other. First Chunk A is being populated with vanilla featers than your block populator removes all ores. Now Chunk B gets the vanilla features, it generates a ore vein at the chunk border between chunk A and therfore extends the ore vein into Chunk A, which you already checked. After this you populator gets called on Chunk B which only limited the search to chunk B. This is how you end up with some blocks not converted to sponge.
because the plugin isnt for me and I don't want to limit usage to people who have a large mongo for example I use free mongo's from mongodb cloud
Do you happen to know a easy solution to this or am I going to have to try and figure something out
`@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
Location loc = new Location(Bukkit.getWorld("Crystal"), 86, 77, 312);
p.teleport(loc);
if (p.hasPlayedBefore()) {
e.setJoinMessage("ꑂ");
e.setJoinMessage(ColorUtils.color_1("&f bcf41&lBENTORNATO"));
e.setJoinMessage(ColorUtils.color_1("&f &f➥ ac920Bentornato &2&n" + p.getName() + "&7 su &e&lJuice&d&lPvP"));
e.setJoinMessage("");
String nuovo = "lp user " + p.getName() + " permission set suffix.0.ꑅ";
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), nuovo);
} else {
String free = "lp user " + p.getName() + " permission unset suffix.0.ꐮ";
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), free);
e.setJoinMessage("ꑂ");
e.setJoinMessage(ColorUtils.color_1("&f bcf41&lBENVENUTO"));
e.setJoinMessage(ColorUtils.color_1("&f &f➥ ac920Benvenuto &2&n" + p.getName() + "&7 su &e&lJuice&d&lPvP"));
e.setJoinMessage("");
}
}`
someone can help me to fix that?
don't send message onJoin
Yes there are many ways to save any object in any DB
How can I do that?
Is the listener registered?
Depends on your object and depends on the DB you want to use
ye
Any console errors?
Im using mysql
First of all: Dont teleport peopl onJoin. Use the PlayerSpawnLocationEvent for that:
https://hub.spigotmc.org/javadocs/bukkit/org/spigotmc/event/player/PlayerSpawnLocationEvent.html
declaration: package: org.spigotmc.event.player, class: PlayerSpawnLocationEvent
Are there messages from another plugin which overwrite your messages?
essential i think
Did you work with storing data in Files before? Because thats what you should start learning first.
Yeah. I always used yamlConfiguration
So I thought about serialize object to byteArray and save it
Well you already have your event priority on highest which means the other plugin has its priority also on highest (Which is completely stupid for join messages)
So if you really want to force it then you need to either disable the other plugin, depend on the other plugin (so that your listener is registered later)
or use the priority MONITOR which is a really bad way.
But I couldn't find save byteArray in mysql
That would be a blob, which is ok but then you cant execute queries on that.
oh ok thanks
Just Base64 encode your byteArray and store it as a String (If you really dont want to query any parameters on that).
Best practice would be: Serialize the object to json using a library like Gson and then store the json String in your DB.
But everytime using String encoding doesn't slow?
Working with serialisations and IO (Databases or Files) is very slow. You should not do that on the main thread anyways.
does it mean use Async?
Yes, do it async
ahha Thx 🙂
You can check if the Block you are replacing is at a chunk border and if so check also neighbor blocks and consume the ore vein.
I ended up just seaching 8 blocks into the neighboring chunks to check if the vein spread over thanks for the help
like this ?
or i use ?
We need a plugin for ore like in Rusta
Stone, Iron, Sulfur (it’s not growing, but I have yes)
They appear on the surface of the earth. Not in the mines. And when poking, it decreases
You don’t need to get them by breaking them, you need to click on them
From a wooden pickaxe is extracted 2 pcs per click, with stone pickaxe 3 times, with iron pickaxe 4 times, with diamond pickaxe for 5
Who can do it?
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/
Yeah
ok i try
Do you know what this warning mean
[WARNING]
[WARNING] Some problems were encountered while building the effective model for fr.worldorder:WOMmrList🫙1
[WARNING] 'dependencies.dependency.systemPath' for dev.joones:joones:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/WOAssault.jar will be unresolvable by dependent projects @ line 89, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
This should not be in your resources folder. Everything in resources will be copied into your jar
I put it where ?
Ideally you dont put it in your project at all but install it as file in your local maven repository.
But if you insist on keeping this in your project i would at least use a folder like ${project.basedir}/libs
Never manually add libraries if you are using maven
So how i do this ?
How do you compile your plugin?
mvn clean install
Just put it in a libs folder and depend on it for now...
Perfect. Now go figure it out. Not too hard to see what you did wrong now.
?
What is params?
the things after _
In case of wommr_Canada this will result in what?
Canada ?
And does it make sense to split "Canada" at "_"?
Yes. Unless a country name contains spaces
mmr like in ranked games
oh
*Originally from chess btw
thought maybe it was something to do with MaxMinds, since ur getting a country
Nah its for country war
(MaxMinds has a geoip db for getting location from ip)
If a country win an assault he won elo/mmr
all name are stickon
like UnitedStates
Hi does someone know how to update the Player Entity metadata through NMS after spawning a NPC to allow the second skin layer to show up? They messed up with the packets on 1.19.3 and the old method used isn't working 😵💫
Show your old method
@opal sluice
Anyways here is the equivalent for changing Armorstands. Metadata now uses List<WrappedDataValue> for synchronisations.
private void prepareMetaPacket() {
this.metaPacket.getIntegers().write(0, this.fakeID);
WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
WrappedDataWatcher.Serializer chatSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
WrappedDataWatcher.Serializer boolSerializer = WrappedDataWatcher.Registry.get(Boolean.class);
List<WrappedDataValue> dataValues = new ArrayList<>();
Byte flags = 0x20;
dataValues.add(new WrappedDataValue(0, byteSerializer, flags));
Optional<?> optChat = Optional.of(WrappedChatComponent.fromChatMessage(this.text.replace("&", "§"))[0].getHandle());
dataValues.add(new WrappedDataValue(2, chatSerializer, optChat));
Boolean nameVisible = true;
dataValues.add(new WrappedDataValue(3, boolSerializer, nameVisible));
Byte armorStandTypeFlags = 0x10;
dataValues.add(new WrappedDataValue(15, byteSerializer, armorStandTypeFlags));
this.metaPacket.getDataValueCollectionModifier().write(0, dataValues);
}
You need to do the same with your meta packet for players. Just with different flags ofc.
Sorry was on the train had to change when I was writing the answer, but basically you could build each DataWatcher object and chug them into a list that could be send over the serializer to send it through the packet
Thx for the example, gonna make it fit to the player entity 😉
I ran BuildTools with this cmd, but nms is still obfuscated
java -jar BuildTools.jar --rev 1.19.2 --remapped
Be sure to use the classifier inside the pom
Otherwise you'll use the obfuscated jar
You need to look into your maven repo to get the mapped jar
What do you mean by that
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
You missed the classifier
Add <classifier>remapped-mojang</classifier>
ok, thank you
And it will pick up the right jar for you
Also: You are missing the special sources plugin...
Did you read the NMS article??
?nms
Yup without it, the conversion will not be made and the code will not work 😊
Is it possible to make a plugin for a landing?
Landing?
Is there a way to save String to mysql without length limit?
When I serialize some object to string, It's length is so long.
String is server name right?
I imagine so. You can always try it and see
TEXT shouldn't have a length although it opens it up to exploits
maybe use LONGTEXT?
Hopefully they don't have to use LONGTEXT
What does exploit mean?
Means that someone can use it to do bad (in theory). As long as whatever you're storing is known by you you're fine. If, for example, you store any object and someone makes an extremely large one they can take a server down my filling the db very fast.
Ahha I got it 🙂
As a result is it the best way to save object in database?
Well it really depends what you're saving and why. It's a matter of "do you really need to save XYZ as a whole to the db"
The best way imo is to encode I to b64. Not losing data and fairly short text
Ofc, if you can avoid saving useless I formation that's better
But if you want to store full ItemStack objects for example, b64 is the way to go
Use TEXT only if you absolutely need to you shouldn't need anything bigger. If you do then you're storing too much in one TEXT
Is there a way in MythicMobs to identify a drop?
I'd like to make a "Shop/Exchange" using those drops.
Can I associate them with something like a Custom PDC?
Write code
Help
Help
Good luck
Players don't have that kind of hitbox. You'd need to do a lot crazy things to make that. It'd be so many hours of work.
You can’t just climb on your head
You can try it but it's not that simple
Get a friend turn on creative and see for yourself
You could make a player "jump" on another by placing a barrier at the feet of the jumper but it'd be imperfect
Especially for anticheats
The forums is the best place to ask for someone to make plugins
You should probably figure out exactly how you want it to work since the picture isn't clear either
Yeah they are. That's what PDC is
Can you do it? I’ll describe it to you in full, please
I don't have the time atm
Please
?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/
Are you saying that
PDC == NBT
?
PDC is a sanitized version
So, if MythicMobs supports custom NBT tags, I could identify a drop by reading the nbt tag.
Am I right?
It prevents plugins from conflicting
WOAH, that's pretty cool
Yes assuming mythic mob mobs drop custom items
i think mythic mobs would use a namespaced key though
If you need to rip raw NBT that's a bit more work
Shouldn't need to tho
You can fake a namespace key if need be anyways
I don't know...
In their discord channel there is no one to help you, unless you pay 40 bucks, obviously
get raw nbt
No as in figuratively rip
Like get the raw NBT for an item. That's like NMS and gross
md_5 upset level of gross
He'll show up and start hitting you with a stick
i mean you can get namespaced key with an instance of mythic mobs
but you need to know the name of the tag
Maybe creating an Util for reading NBTs could be more useful before proceeding writing that thing
uoah
Wait
Do I need a nsk to read a NBT?
nah if you watch to serach an nbt with pdc you need the namespaced key
which needes an instance of the plugin
or you can manually parse the raw nbt string
Maybe figure out how to make a plugin that has compatible drops with MythicMobs
Help
The idea is to make a shop using those drops
@quaint mantle stop
Ok
no one is going to make a plugin for you, if oyu want to pay go to the services forum
90₽
So, raw parsing should be the easiest way, right?
Will it be a clean line or smth like "rq39oitjq0-tj0qp-iktoqik3tyoiqjntyoiqn3iTEST"?
I have 90₽
raw parsing is probably hardest
since its so variable
but ig if you do it right it could be easy
pre sure nbt is in json format anyway
NBT tag is in json? wtf?
Your best bet would probably be to use MythicMobs items and figure out how it stores the internal names
^
decompile and have a look
My guess is the Internal_Name
I can definitely see how they are stored but I cant do anything about it...
I'm not sure that I can compare items in that way
Wym can't do anything about it?
They should contain unique data somewhere that MythicMobs uses to identify them
You can see that data too
The only problem would be linking them together but that should be easy since the ID should be what you put in the config
Bruh
package io.lumine.mythic.api.items;
import io.lumine.mythic.core.items.MythicItem;
import java.util.Collection;
import java.util.Optional;
import org.bukkit.inventory.ItemStack;
public interface ItemManager {
Collection<MythicItem> getItems();
Collection<String> getItemNames();
Optional<MythicItem> getItem(String var1);
boolean isMythicItem(ItemStack var1);
String getMythicTypeFromItem(ItemStack var1);
Collection<MythicItem> filterItems(Collection<MythicItem> var1, String var2);
}
Fancy
Will build artifacts in Intellji use build.gradle file? I mean build artifacts of Intellij as same as using gradlew build command?
No
public boolean isMythicItem(ItemStack item) {
return ((MythicBukkit)this.getPlugin()).getVolatileCodeHandler().getItemHandler().getNBTData(item).containsKey("MYTHIC_TYPE");
}```
Micheal
?
Can you make plugin please?
Only geol can
In all the time youve been crying you couldve learnt how to work with the api
Dont
Future
yo
Can you make plugin please?
Yesn't
Make a forums post you've been begging all night
https://paste.md-5.net/wililefuge.js
Hey Mike, how do you think I could improve this code?
Yes. There's better ways to do it than that's it's 3am and I'm going to sleep so maybe I can help tomorrow if I remember
Good morning all
Context if you want another opinion plz
GUI Shop
public Component sell(Player player, Sellable sellable, List<Map.Entry<String, Integer>> priceDrops, int amount, int slot) {
//Amount isn't used yet, but it will be used in the future
if(!doesInventoryContain(player, priceDrops)) {
return Lang.YOU_DONT_HAVE_THIS_ITEM.replaceText(TextReplacementConfig.builder()
.matchLiteral("{items}")
.replacement(formatItems(priceDrops))
.build());
}
removeItems(player, priceDrops);
ItemStack item = getItem(sellable, slot);
item.setAmount(amount);
player.getInventory().addItem(item);
return Lang.YOU_BOUGHT_THIS_ITEM.replaceText(TextReplacementConfig.builder()
.matchLiteral("{items}")
.replacement(item.getType().name())
.build());
}```
