#help-development
1 messages · Page 995 of 1
I got like 826 haters on this server but dusk at least hasnt made a homophobic statement about me yet, so that's an absolute win
I think I made it several months ago
how would i make a class be enabled on the OnEnable Listener?
i've been able to make make a GUI open when i have it on the main class but not when i have it in its own class how can i make it so it can be accessed via another class.
?spoonfeed
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
Oh no someone gave me an answer because I asked a question
That's great! However, this server and the forums have had the message said countless times that fundamental knowledge of the java programming language is a prerequisite that needs to be fulfilled.
oh so your only made homophobic comments about me months ago? well in that case, at least you stopped doing so
So riddle me this, why no one Ive met except for this place is so butthurt about it
Well then gatekeep server behind some kind of exam if you want to enforce it
Otherwise stop complaining about it
???
Honestly not the worst idea
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
"class be enabled"? wdym?
Good luck
you make a class that implements the Listener class, then in your plugins onEnable, call this.getServer().getPluginManager().registerEvents(this, new <TheListenerClass>());
you're the one complaining
Yall are complaining about me not knowing basics
Its not my problem
But it is
nah we're just expressing facts
You don't understand the difference between the two
ill try that thanks
I am satisfied with my knowledge
clearly
Rest is maths and spigot quirks
If that's the case, why are you here? 💀
If I would complain, I would do so by pinging choco or md or sth. Simply saying that you're reluctant to learn is not complaining, it's just a fact
Rest is maths and spigot quirks
That sentence has no sense
"uhuhuhuhu nobody helps me here, how do I get nearby entities? Oh I won't look at that link mfnalex sent for World#getNearbyEntities because mfnalex sent it" <-- that is complaining
It's really just childish
Haha I knew you took that personally
Cool
I don't, I find it quite funny.
You wouldnt commit so deeply into it if you werent hurt by it
however finding it "cool" that you think your "insults" are actually "hurting people" is some sign of mental disease
?code
?paste ?
you must have a really sad life. meanwhile I'll go to bed soon and cuddle with my boyfriend :3
then tomorrow I'll wake up and he'll make me breakfast, then I'll go to work where I make more per hour than you in a week, because you're probably 13. And you will then still be here, trying to argue with people lmao
brb having a smoke
Ad hominem and irrelevant information to make urself feel better about urself
Classic from you, I havent seen it today yet
ad hominem is also the only latin phrase you know right? You've used it 4 times already and none of the times did you use it correctly
"I make more than you therefore im better"
Don't forget my happy relationship and the breakfast he makes!
i tried what you said and its requesting an argument but its not clear what the argument is
oh, i wonder if i completely misunderstood what u asked LOL
I know de juro, de facto, et cetera, ad personam, and others
my boyfriend cooks bacon better than your non-existant SO
The argument is whatever you put in the constructor
SO?
significant other
What does it have to do with anything
sorry what constructor? this is the code https://paste.md-5.net/yilowujihu.cs
Blud claims one to be childish and then takes 3rd party people who arent even here to compare them
Okay
sorry can you guys please take this to dms or something
so true bestie
stats_gui is your class. (Should be UpperCamelCase for convention sake, but it is what it is for now)
Your class has a default constructor.
You have overriden that default constructor.
You need to pass in the parameters when initializing that class now.
the argument is the main class
this is development help not relationship help
so you just put new stats_gui(this)
you know what? I do indeed think that I'm better than you. Because I'm not acting like a stupid bully here for 3 full hours now. But you do you. And don't worry, I also once was a stupid jerk but then I got older and learnt from mistakes and meanwhile I think, that I'm at least a half-way decent person. Now see you later, I'll go have a smoke, bb
its very possible that i was just rly stupid and didnt understand what they originally asked looool
that doesn't work
what's the error??
Not ego inflated, hah
Who am I bullying now
me
From what Ive seen you and your friends take turns on me
now i see, are you editing the plugin?
my friends? none of my friends are on this discord server lol
You arent obligated to help
I need nitro.
I have better reactions that I can't use.
what do you mean by that
none of my friends even know what spigot is lol
like, thats not your own plugin code
What specifically about it doesn't work?
the argument
its cuz you are using the wrong sintaxe
tbh we'd love to but there's too many people involved into this shit-show
But you keep doing that and get offended that I dont bow down to you after you give me help
Whole 2 atm
I'd opt for @worldly ingot to simply timeout @storm crystal . If you want, time me out too, because I too participated in this shit show a bit too much in the last 5 minutes
Sorry, from what I see, it should.
Your Main class is the argument you need to pass in
this.getServer().getPluginManager().registerEvents(this, new stats_gui(// requires an argument \\)); was supposed to this.getServer().getPluginManager().registerEvents(new stats_gui(this), this);
The this keyword should rectify that
Plugin no workie please help.
@sullen belfry
^^^^ join please
Yea, that makes sense
Also gotta follow the correct parameter order.
:p
Fair enough
okay thanks
if you're bored @storm crystal we can still continue to talk in DMs lmao
Or, you could look at the BTGUI thread and tell me if I'm dumb
@tender shard @storm crystal Flexing their yapping levels
you're not THAT dumb
Same timezone
It is indeed 3:25 am
?paste
here is 22 pm
oops, i always forget the parameter order for that method lol
that was my fault for what i told them
ok guys, @kind hatch @remote swallow and idk who else had blocked @storm crystal , just a tiny heads up for everyone:
Dusk and me talked with DM, we were both a bit too snappy especially at the end and apologized to each other. I explained to him how this channel works and that when you ask questions and someone gives you an unsatisfying reply, it's better to say "sorry, I don't understand, can you please gimme a concrete code example" instead of just "yeah no!!!1".
I'd urge everyone to give @storm crystal a second chance, he promised to be less snappy and try to ask more concrete questions. How does this sound to everyone? Can we turn this into a happy ending pls? :3
The Good Ending
The good ending??
No we cannot, someone HAS to replace marco 😛
Maybe a good ending
haha dw, I'm sure cmarco will come back unter a different name soon lmao
Doubt it
We need a new troll
Something refreshing
hmmm I can try to troll
But we all know the u u it's too late
but tbh I doubt I'd be very good at it
God I hope, I need to make some more medicine drink but I forgot the recipe!
oh yeah he deleted all his messages
I can be a good troll
sadge
all I remember is that medicine drink consists of 66% recipe and like 0.5 sulfuric acid or sth lmao
Yeah but I need the 66% recipe as well
yeah I know, you really trolled me on basics
"yeah I will PR soon"
"yeah I'll do it tomorrow"
"bla bla basics bla bla"
For a rather explosive medicine if you will
infinite recursion
It got real. lmao
Hmm
Lmfao
Ill.pr soon
Got busy sorry
talking about basics - 701 commits and I bet 695 of those are mine -.- COMMUNITY PROJECT we wanted to call it guys, cmon 🥲
Now you know how md feels.
Community helped… for 6 commits
https://github.com/spigotbasics/basics
everyone's free to contribute!
This is supposed to be a "modular" essentialsX alternative, in better. It misses a bunch of modules though (basically, one module = one command (more or less))
I mean
it's written in kotlin but modules can also be written in java.
it also uses its own command parsing system with its own kotlin DSL to parse arguments and stuff 100% automativally - for example, look at modules/tp
Its time
here's an example of how the "command dsl" in basics works: https://github.com/SpigotBasics/basics/blob/main/modules/basics-tp/src/main/kotlin/com/github/spigotbasics/modules/basicstp/BasicsTpModule.kt#L44
it is time for you to PULL REQUEST
May is national basics month
yes
@remote swallow may is national basics month
and as said: modules can also be written in java! (for all the kotlin haters)
I made epic use kotlin
He's an enjoyer now
that's great!
but tbh I'm really proud of basics, it started out so quickly and became so big within no time, but then unfortunately it died very quickly
also @rotund ravine
may is basics month
I miss Jan🚚
public void applyWinterEffects(Player player) {
if (playerToggleVisuals.contains(player)) {
return;
}
winterTask = new BukkitRunnable() {
@Override
public void run() {
if (player.getWorld().hasStorm()){
setWorldStormFalse(player);
}
if (isPlayerInWater(player)){
return;
}
spawnRandomizedParticles(player, SeasonsList.Seasons.WINTER.getParticleEffect());
}
}.runTaskTimerAsynchronously(NormalSeasons.getPlugin(NormalSeasons.class), 0, 10);
...
public void cancelAndRemoveTasks(){
if (winterTask != null) {
winterTask.cancel();
winterTask = null;
}...```
Is this appropriate?
No that's nsfw
@staff
no pls no ban hammer
@ adele
That's nsfw
Your redi..
Bet it's jam packed with hypixel secrets
Yeah chocos only fans
my... redis server?
dude if you know the name of my actual nsfw reddit name then stfu about it lmao
Oh boy
there is a reason why I got 2 accounts lmao
So is this valid way of removing tasks from memory?
You made me laugh so hard my nose started bleeding lol
why don't you directly extend BukkitRunnable and override the cancel() method ?
Jeez man drink some water
Cuz I've got like 6 dif runnables in here lol
I get dehydrated easily
I know that SOME people here know my "bad" reddit name... I must have been drunk once cough
I forgot it lol
sorry 5*
public void cancelAndRemoveTasks(){
if (winterTask != null) {
winterTask.cancel();
winterTask = null;
}
if (springTask != null) {
springTask.cancel();
springTask = null;
}
if (autumnTask != null){
autumnTask.cancel();
autumnTask = null;
}
if (randomParticleTask != null){
randomParticleTask.cancel();
randomParticleTask = null;
}
if (randomAutumnParticleTask != null){
randomAutumnParticleTask.cancel();
randomAutumnParticleTask = null;
}
}```
I'd keep em in a list<Runnable> or whatever but well, if you never gonna add more, I guess this is fine too
Well
or a Map<SeasonType,BukkitTask>
The tasks are gonna get split up into different levels of effects eg: light, mid, heavy. That being said there will be like 3 tasks per season
tl;dr your current way is fine but not great in terms of OOP
well youll need a better design
Yeah somehow I read the java book twice and retained nothing D:... time for the third
I think if you've read it 2 times that's enough it's kinda hard to get down
You'll get it eventually
my best advice is: create a class for (literally almost) everything
Oh snap
I still remember the day OOP clicked
Have a SeasonType class, can be enum WINTER, SPRING, AUTUMN, SUMMER, RANDOM
then have a another enum for HEAVY_MID_LIGHT
https://paste.md-5.net/yojiwesedu.java
Sigh but consolidations D:
then have only exactly one class that extends Runnable (or BukkitRunnable?) that takes in the appropriate winter,spring,... and HEAVY, MID, LIGHT stuff and then does stuff accordingly
That class is in the middle of a structure redesign so dont hate
alternatively make an interface WeatherRunnable and then you can have one WinterWeatherRunnable that extends WeatherRunnable, whatever
Slightly off topic but don't use switches for particles enums times are numbered so be weary
then you keep track of all of them in a Map so you can get rid of that "spaghetti" code
To be fair, I wanted to switch off the enum based seasons system as well
tl;dr you can never have enough classes. only too many instances
Or as my grandpa used to say. What the fuck is this java you're talking about
has she never been to indonesia?
We used to drink java, and now these damn kids are writing with it
My grandpa was a man 😭 i never met my grandma
She died young
Oh the sorrow
oh sry I read grandma
How incentive fuck you or something
I GOT PERSONELL FOR THAT
https://paste.md-5.net/lebavaqosu.java
If you can guess why I want to redesign the seasons list...
Owo
Also is it odd practice to encapsulate the enum as I'm doing?
wdym exactly?
Rather than just having the enum class, I put the enum in a class
Enums trash use registry so plebs can register their own seasons /s
imho switching over enums is rarely a good idea
Idk depends
Like what else are you doing
it kinda violates the OOP idea of single responsibility and stuff. except, maybe, factory classes or similar
If the object is just a Wrapper for the enum value get rid of it
hmm
I wanna put the repo up here but idk if you guys are that interested
It's more of a performance dilemma currently
I can't look in bed
wtf is that a mixture between macgyver and jim from The Office?
Jim carrey man cmon
https://github.com/NukeCaps/NormalSeasons
Also if you want to help with my atrocious use of runnables :p
THAT is jim carrey?! ok I would have recognized it in better quality maybe
Perhaps, yes that is him from the second pet detective
yeah anyway - anyone who does not contribute to Basics in may is a La-who-za-her too
Are you trying to say that you want me to contribute
Me and everyone else who hasn't
Because sir, I find that extremely offensive!
Wait thats not even up to date (now it is)
I feel like I made it a lot farther this time with compiling ImageFrames thankfully, I got all the dependencies compiled, or so I thought. Do I have to download anything for " net.minecraft.world" and etc import stuff? Like a jar
No, you just need to run BuildTools for whatever version you are writing for.
Oh
Does anyone have any experience with reading data from jigsaw blocks?
I can access the orientation of the block (which is in documentation).
But I can't seem to find a way to get the data that the block itself contains.
Target Pool, Target Name, Turns into, etc.
Oh ok, well is there like a specific option I need to pick?
This is the data I am trying to access from spigot
The only one that may apply to you is the remapped option.
Thanks Shadow! I did had one last question. I didn't make this ImageFrame Plugin, so how would I know what version it is made for when it is has multiversion support? Would it normally be the latest. Would I just buildtool remap every version it supports? I am sure it is obvous, but it isn't clicking in my head.
First you cast the rod then wait for a fish to bite 😛
You’d probably want to check the parent pom. Usually they have the lowest version in there for what they want to support.
If not listed there, then you can guesstimate based off of the module names and see what the lowest version is.
And, yes, you will have to run BuildTools for every version that it supports.
Ahhh thanks again!!! ( :
Oh wait I should probably ask, will I have to choose a compilation option when I compile it?
Only for anything above 1.17
1.16 and below didn’t have mappings
So the option won’t really do anything
Oh ok sweet, so if no need to select an option like craftbukkit for a remapping?
Nope, all you really need to do is just select the version and press compile.
Thanks!!
Your issue is that plugin uses CraftBukkit as well as teh Spigot-api.
pretty sure it doesn;t use remapped
yes, if you install them to maven as you did the others
Ah ok
?bt for me
did you install CB to the correct place? it goes under org.bukkit
Idk my friend sent that screenshot
How can I get PersistentDataContainer from Block?
there is none, only in blockentities
😭
Okey, thanks...
wait, no
wdym no
give me a sec
which 1.20.x requires java 21
i mean you can set persistent data on block withour nbt containers
how
we can no longer build 1.20.5? it seems to build 1.20.6
idk
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/metadata/Metadatable.html#setMetadata(java.lang.String,org.bukkit.metadata.MetadataValue)
block implements this interface so you can set custom values on it
there is no reason to use 1.20.5 though
it worked for me and doesn't change block
yeah, its for someone elses nms modules
i mean it changes block some way but if you would do this using nbt it would still change the block
did anything change between .5 and .6 in nms then?
probably not
how do i move a display entity in a straight line. why there no helpful documentation or tutorial anywhere 😭
They are fairly new so no tutorials
wdym by that?
how does moving them in a straight line not work?
what have you tried?
ItemDisplay displayItem = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
final Vector direction = player.getEyeLocation().getDirection().clone().multiply(0.5d);
displayItem.setItemStack(/* sets to whatever itemstack instance here */);
Vector3f translation = new Vector3f(
(float) direction.getX(),
(float) direction.getY(),
(float) direction.getZ());
Transformation transformation = new Transformation(
translation,
displayItem.getTransformation().getLeftRotation(),
displayItem.getTransformation().getScale(),
displayItem.getTransformation().getRightRotation());
displayItem.setInterpolationDuration(20);
displayItem.setInterpolationDelay(0);
displayItem.setTransformation(transformation);
no move
)):
i think the easiest way if u actually wna just move it in some direction might be to add it as a passenger to another ent
but why doesnt this work though
it just doesn't
sits there does nothing
right I was just asking conclube
like the passenger method works, but im wondering why this doesnt
his solution is a little silly ngl
im not sure if u can just move it through the transformation
like after all its a linear transformation
or am I wrong?
a linear one
yes but these kinds of homomorphisms map 0 to 0 always right
im not sure
me neither
imo if something has a translation of 1,0,0 it would be in a different place compared to 2,0,0
damn my school in the recent statistics was rated 42th worst school in my country
thank god i've finished it already 😄
im surprised how i did survived in there because it was really bad, but i didn't realised how bad it was
now im in 3rd best university in my country 😄
so mojang added an entity that isn't capable of moving smoothly in a straight line with the tools provided
idk
like I was just speculating
i havent touched display entities at all
but I know someone who has
@young knoll
Whatttt they are so fun
we dont have fun :c
Sounds like a personal issue man D:
Id like to work with them but I gotta fix all the other shit first
You can teleport them along a path
Just set their teleport delay to something non 0 so it gets interpolated
is that heavy on performance?
also I have a question regarding displays
they are server side right? but is there a way to only create a display so a single player can see them?
preferably without nms
setVisibleByDefault and Player#showEntity
oh awesome
thanks
ah and also is it possible to show models of entities?
or is it limited to text mobs and items?
Text, blocks, and items
if you want an Entity you turn off AI and spawn
right I guess that would be the same thing haha
and can you also transform them like displays?
is there any way to scale them
i saw some vids but i dont remember if thats spigot or mods
oh so its super new
I see
time to drop all my other supported versions 🙂
even with a resource pack its probably not possible to combine multiple textures in a single slot of an inventory right?
Hello, how can I remove the color of a player in tab when he's in a team with color?
i dont wanna make an infinite omount of variations
I can't find the related packet for that...
You could try to add the white color before the player's name using https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#setPlayerListName(java.lang.String)
declaration: package: org.bukkit.entity, interface: Player
hmmm
It will still change the glow color based on the team color?
It should
okay let's try and SEEE
nodders
I wasn't a participant, but grudges to the end of time... Never forgive 😄
@EventHandler
public void onSprint(PlayerToggleSprintEvent event) {
if (event.isSprinting()) {
event.setCancelled(true);
event.getPlayer().setSprinting(false);
}
}```
Anyone knows why this doesn't work and what I can do to prevent a player from sprinting?
works but is extremely jittery as it moves along
ItemDisplay ID = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
ID.setItemStack(/* Generate ItemStack here for display */);
ID.setInterpolationDelay(1); // ?
final Vector directionThing = player.getEyeLocation().getDirection().clone().multiply(0.25d);
Bukkit.getScheduler().runTaskTimer(getPluginInstance(), () -> {
Location currentPos = ID.getLocation().clone();
currentPos.add(directionThing.clone());
ID.teleport(currentPos.clone());
}, 0L, 0L);
is setInterpolationDelay() the correct method?
With the raw matrix I managed to make it be translated but I don't know how to use the interpolation thing so it just get teleported without movements
look at the thread dump not the message
But you can make it translate with a transformation
can somebody show me what makes this counter go up and where it's reset?
since I change internal thingies it could've broken that
looks fine to me
no
mb it's duration not delay
does it/can it move smoothly in a straight line similar to normal entities with that setTransformationMatrix()
Well
Yes but no
Translation can offset it, but if you translate it too far it won't render anymore
u can change that with the setViewDistance() metadata tho?
Still not unlimited
If you teleport it like every two seconds or something during the process it will changes its coords and render correctly ? (Guessing)
with a custom font, is it possible to perfectly add an offset that has like a size of 0 so subsequent characters will overlap each other perfectly?
i guess yea like coll said if u push it into an unloaded chunk itll go away, otherwise should be independent
this worked!
the funny solution to making display entities move on a vector smoothly
ItemDisplay ID = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
ID.setItemStack(/* Generate ItemStack here for display */);
ID.setTeleportDuration(1); // important! making this not = 0 will interpolate the displays movement when its position updates
final Vector directionThing = player.getEyeLocation().getDirection().clone().multiply(0.25d);
Bukkit.getScheduler().runTaskTimer(getPluginInstance(), () -> {
Location currentPos = ID.getLocation().clone();
currentPos.add(directionThing.clone());
ID.teleport(currentPos.clone());
}, 0L, 0L);
^ if anyone ever needs that in the future (which they probably will there r 0 guides on this stuff)
ty @young knoll n @frail pilot n @pseudo hazel for u responses
How can I change the number of online players the server replies with?
yeah I know
but since I'm using PE
I don't have a need for the nms packets
I can't provide support for bedrock
packetevents you silly
Ah
is pe some bedrock shurtcut?
I thought PocketEdition
pocket edition
it hasn't been called pocketedition in a million years lol
I'm from a million years ago
PE turned into bedrock
is this the PE source
because it only has the motd
that's how minecraft writes it
yes
I havent heard someone say MCPE in a long long time
that packet only contains the motd it seems
I'll debug and see what it contains
this according to the web
I wonder how long has this format been used for
1.7 or so iirc
I'm trying to change villager profession using GUI, everything was looking fine until I tried changing profession of villager, that never had the profession(it visually tries to change, but cancels it).
@EventHandler
public void onInventoryClick(InventoryClickEvent event){
if(event.getClickedInventory().getHolder() instanceof VillagerProfessionInventory inventory){
event.setCancelled(true);
List<MerchantRecipe> backup = inventory.getVillager().getRecipes();
inventory.getVillager().setProfession(Villager.Profession.valueOf(VillagerProfessionInventory.PROFESSIONS_ID.get(event.getSlot()).toUpperCase()));
//PROFESSIONS_ID is List.of("none","farmer","shepherd","fisherman","fletcher","librarian","cartographer","cleric","weaponsmith","toolsmith","armorer","mason","butcher","leatherworker","nitwit");
inventory.getVillager().setRecipes(backup);
}
}
Console doesn't give any error/warning
Oh.. But it won't reset if villager already sold something, right?
If so, can I do it using code?
Looks like I found way: set villager expirience to at least 1
what does one do against this
on 1.20.6 it cant access particle any more
previous versions are fine
its still public
Did yall registrify particles
nah
The name was probably changed at most
A lot of names were synced with mojang names
It's still there
they're*
It's still they are
yep
thare*
its 🤓
like father taught me
😕 😞
'tis*
i don't think it can do that
krill issue
だろう!日本語話せよう!
I'm a monolingual no understand this
лох
Rocks
yeah i still dont know, invalidated caches and stuff too
yeah it literally just doesnt appear to exist with this dependency
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Are you using java 17
21
howwwww
did you provide any code
fine
I replace the List of EntityPlayers as well as the Map by name and Map by uuid with my own
which do not add the EntityPlayer if he isn't logged in
and I also replace the HandlerList of the events shown here
so that they aren't invoken in the same circumstances
and are only invoked after he logs in
like this
and if I remember correctly the server didn't mind
like everything worked great
quit event is also not invoked if unverified, like shown here
but somehow now the server crashes on each quit
like it stops responding
even tho the main thread is stated as RUNNABLE
...and it only occurs after reloads
what the hell
I do return the original server setup after my onDisable is called tho
and it stopped crashing
wait, it's so weird, it only crashes after an error occurs when I try to login in with a command
uhhhh
alix?
my plugin
You place a beacon
think you gotta use nms for that
i searched on google and they said it client-side only and server-side cannot modiflied
to make a fake beam
No you just need to place a beacon
no bro
and yes it is client sided
A valid beacon will spawn the beam
i want spawn "beam" not player place it norrmally
Yeah you can't do that without a beacon unfortunately
^^
oh no
It can be a fake beacon with #sendBlockChange(), but there has to be a beacon on the client somewhere
weird how it works like that
thank for your support
nah why minecraft can't made a beam packet brrrr
they just limit them self
They just don't need to :p
im gonna ask again because i dont know how to deal with this but spigot 1.20.6 doesn't seem to include the Particle enum and i cant tell if this is an error or intentional
lower version dependencies work fine
invalidate caches
already deleted 1.20.6 from my .m2 and had it reinstall, invalidated caches and restarted, stuff like that
using java 21
block_crack was removed
right ill get to that until after i get my classes imported lol
they replace with a new one?
probably
It's just "BLOCK" now I believe
then just do Particle.valueOf
yeah
invalidated again, no result
use Particle.BLOCK
you dont understand, i cant even access Particle
see if you can manually write the import
cant use a method of something that doesn't exist
i did, no result
"Cannot resolve symbol org.bukkit.Particle"
isn't just Particle btw but also Material so theres something wrong with the import as a whole
?paste ur build file
Take a look at your External Libraries, dig into the Spigot dependency and see if stuff is there
sorry which is my build file again
pom.xml probably
i have a multi module project so if more is needed lmk
this is just the module in which the dependency isn't working properly
How to open a smithing table for a player and put items inside?
the iml of the module wasn't added to git, adding it fixed the issue
why the iml needs to be added to git i dont know though
and BLOCK_CRACK wasn't replaced i guess
rerun buildtools, block crack doesnt exist anymore
wack
nah
wack as in i did that twice now and it aint doing it lol
its possible isnt that what wynncraft does
im pretty sure ive seen it
A bit late but if you want to avoid teleporting the entity every tick, you can do something like that https://paste.md-5.net/ugefemukoq.java
You can also just teleport it farther with a higher teleport duration
They probably just spawn a beacon
in the ground somewhere
i have a problem this Line here
switch (event.getCurrentItem().getItemMeta().getLocalizedName()) {
returns the DisplayName not the localized name with Spigot 1.20.4-R0.1-SNAPSHOT
pls Ping
Trying to cast Inventory i get from InventoryClickEvent#getInventory() to AnvilInventory gives me this error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.AnvilInventory (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.AnvilInventory are in unnamed module of loader java.net.URLClassLoader @45fe3ee3)
I'm 100% sure this inventory is anvil, here is full code: ```java
@EventHandler
public void onTextConfirm(InventoryClickEvent event){
if(event.getClickedInventory()==null) return;
if(!(event.getClickedInventory().getHolder() instanceof TextGUI)) return;
AnvilInventory inventory = (AnvilInventory) event.getInventory();
event.setCancelled(true);
if(event.getSlot()!=2) return;
String text = inventory.getRenameText();
Bukkit.getLogger().info(text);
}
updating intellij did the trick 👍
can you provide more code? + i would recommend you to create gui differently
?gui
Yep, the code there is only usefull to bypass the teleportDuration limit or generate complex movements
wdym more code? full class?
no how you are creating the inv
public void build(){
inventory = Bukkit.createInventory(this, InventoryType.ANVIL, Component.text(title));
inventory.setItem(0, ItemBuilder.buildItem(Material.NAME_TAG, Component.empty()));
}
Not using Spigot API
Follow this guide and ask for help in the Paper discord
does some1 know how many bytes the average item has?
dont cast like this
ops
i think is better you use if(event.getInventory() == anvilinventory) {
This is probably a stupid question but when i try to use Version "1.20.6-R0.1-SNAPSHOT" in my code i loose some bukkit imports like Material. Does anyone know how i can fix that?
update intellij
@EventHandler
public void onTextConfirm(InventoryClickEvent event){
if (event.getClickedInventory() == null) return;
if (!(event.getClickedInventory().getHolder() instanceof TextGUI)) return;
if (event.getInventory().getType() == InventoryType.ANVIL) {
AnvilInventory inventory = (AnvilInventory) event.getInventory();
event.setCancelled(true);
if (event.getSlot() != 2) return;
String text = inventory.getRenameText();
Bukkit.getLogger().info(text);
}
}
oof holders
Hello, I have a question, using the plugin messaging in Bungee and Paper with a channel to send messages or commands, is it possible to execute a command on the paper/spigot server and have it executed on the BungeeCord? by connecting channels?
yes, i think
I mean
I already have the 2 plugins
and its function, at least for my needs, is that
stores the status data that changes with a command in the bungee that has permissions, etc.
/rstatus <server> - does not need another argument as it is like a bool on and off
type /rstatus Bedwars (On) - /rstatus Bedwars (Off)
but what I want to do is
because that /rstatus command is only from the bungee, it does not exist on the paper server
I need the command to exist on the paper server and communicate with bungee and change the value and send that information again to the same paper plugin
I don't know if I understand myself
but why?
Did you ever figure this out? I'm having the same issue rn
use redis
The inventory type check will success but u think the inventory object type casting will success or not?.
as
That worked thx
I have a java file, and if I use Example file = new Example() a lot in my code to create an instance of that class so I can use it in another file, is that going to use a lot of memory?
and if so, is there any alternative to just creating a new instance in every single file
You can pass the instance around
and how much memory it takes depends on the class
but probably not that much
this doesnt work
you cant use anvil inventories to get a name without nms
and if you do find a way, please let me know haha
How can I do a timer? I need to create a timer that will write on hologram how much time left to the end of the auction. I can't do it with bukkit runnable because after server restart the timer will also restart. How can I do it?
just save the data in a file or db while the server stops
and when it enables again
make a new runnable using that data
you could still use a timer and then just take the system time to keep track of the time remaining
could also do that with a runnable
u shouldnt use timers in bukkit
but either way you have to save some time, be it the tome left or the time you started counting, because else there is no way
but it will continue from the last saved time in database
we have runnables
and in real life time has gone far away from that
yes thats what im saying
save the moment in real life time that the timer has started
when u create ur action calculate time the action ends
and then always refer to that time
then you know from any point how much time is left
yes or that
doesnt really matter which way
should probably save both either way it’s usefull data depending on what kind of auctions you are making
yeah I guess
like either save how long it should take or save both end and start time
hey
when i give item to dead player (player who is on respawn screen) whenever they respawn they do not have that item
how do i solve this?
wait for them to respawn
How can I teleport a player after death & remove the respawn screen?
probably cancel the death event maybe?
Cancel? I can make the player teleport to spawn after death but, the respawn screen is just there. Even if you click respawn it won't work.
yeah cancel
so they dont die
and wont see the screen
im not sure if thats possible
the player might get stuck
What if it's a player kill? then the kill won't be counted.
then count it yourself
depending on how you keep track that doesnt have to be a problem
I think
I can use the scheduler to delay the teleport to actually count the kill
and then
use player.spigot().respawn();
If there is a playerDeathEvent (I don’t remember if there is or not) it should hopefully be cancelable so you don’t have to do this
Cancel the event -> when this occurs, you know that would have resulted in a kill so mark that as a kill -> do whatever with the fact you’ve cached a kill
when i do hideEntity and the player unloads the chunk then reloads it, does the entity reappear
Like uh sendParticleEffect kinda thing, anyway just try it and see… if not I can’t imagine that being much more difficult to figure out
Yo im new to forge. I just installed it today and I have an eclipse workspace with code for mods im designing using java import net.minecraftforge.fml.common.Mod; When I load Mincraft with forge and choose mods in the game menu can I just add my workspace directory in my mods ? will that just work? also does spigot have something similar to this java imprt for forge?
yll get more support in Forge dc
Plugins and mods are completely different my friend
im so lost man
You will get a whole lot more from here
Otherwise people will just
?whereami
im talking abt forge support
All I had to do was player.spigot().respawn();
Now it works perfectly as it should
Well there ya go
How do you track the kill?
What do you mean? The player dies then gets teleported.
I thought you were tracking like kills lol not just removing the respawn prompt
can u unload all loaded chunks in all worlds
Probably but why
I meant like I had to add delay the teleport task or the player would get teleported instantly & the kill won't be counted. (In the PAPI placeholder)
public void onPlayerDeath(PlayerDeathEvent e) {
Bukkit.getScheduler().scheduleSyncDelayedTask((XStreamSpawn)this.plugin, () -> {
Player player = e.getEntity();
player.spigot().respawn();
player.sendMessage(util.getPrefix() + " " + util.getDeathMessage());
new Methods(plugin).teleportPlayer(player);
},1L);
}
Idk maybe it’s just cuz I woke up but I still don’t have enough context of what you’re doing with this “kill/death” is it basically getting added to a kill tracker of the player who killed (wtv)? Like a scoreboard statistic kinda thing?
Well cuz if you don’t actually need to anything with the fact the player has been killed or a player killed something, then you could just do the death event, cancel it, and move on. Seems a bit easier than adding a delayed task
Ie: player dies -> you teleport them somewhere could be easily handled with the event
But hey if it ain’t broke don’t fix it
I was about to say that
Haha no worries, just keep in mind for next time. Always try to find the least complex & expensive way to get your function working
Well some code would be cool
[45.025s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.026s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.027s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.027s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.029s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.030s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.030s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.032s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.041s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.045s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.045s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.046s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
it just creates an awful lot of threads
Yeah and based off that, you're not handling cleanup properly or somehow trying to create 3 tasks a second
The threading however,
We need some code to help with that
Uh idk how tf you bombed your mem that hard but lets see the plugin code
he code is simply encrypted
not your plugin then?
multiple threads in a item plugin?
yep
many many threads
yeah good thing there are only 3 threads trying to create a second
creates quite a few objects for the crops and custom food when loading them from the config
pointless threading that
what
there is no point in creating multiple threads just to create items
ONE thread at most
Yes, ask the dev who wrote it to fix it
^ or try that but most cases you're not gonna get ahold of them
This only really applies to plugins that aren't very well known or unpopular , etc. Unless it's explicity marked as maintained or updated, you probably won't get much help from the creator
but I wrote to him and he said he would try to optimize it...
Well look at that you found a decent guy
Just wait for him to do so then
btw its not encrypted. Source is on Github
breh
its a private plugin
its teh package in your error log
if you were charged for it, you didn't get it from the spigot site
it's caused by the plugin because I turned on the plugin and everything went fine but when I turned it on it started to crash
Its not an encrypted paid plugin
nah dont wory be happy 
The back end is paid for, the plugin is free
bro name the plugin its godcore
there is no mention of godcore in any of yoru log
I just disabled godcore and left everything else running and when I turned on godcore it started crashing
they explcitely using pthread or thats an os error?
no clue, its taken ages just to find out what plugin he has issues with
no clasic threads
possible, or somethign else stackoverflowed adn caused everything to blow up
can't create anything if you are out of memory
stackoverflow killing a native thread lol
max threads on the hosting 512
good enough
i mean thats what linux and mac uses for native threads
linux
does the permission get created?
if (p.hasPermission("hxmes.home.14")){}
created?
yea
created?
like if i enter an permission in plugin.yml
Not understanding your question
if i do .haspermission can i give the permission in luck perms
no
how can i do it
I believe you can create a permission object too
Luckperms should be able to detect that
though ideally you'd use the plugin.yml
Hi I am trying to log back into my spigot account. I have been locked out because I lost access to my verification device
Hope you have your backup codes
Is there a way to get the drops from a Material?
e.g. given a Material, is there a way to get what would be yielded if a player had broken a Block of that type?
Why do you want to get it from a material? Is Using BlockBreakEvent#getDrops not sufficient?
I'm making a plugin that makes trees fall when you break any block of them so I'm setting all of the blocks of the tree that you are hitting to air and spawning a falling block for each block from the tree
Then in the entityChangeBlock event (where the falling block lands) I cancel the event and call world.dropNaturally for each block landing
The problem is that the leaves drop the leave blocks themselves cause currently I just use the blockdata from the falling block to decide what to drop
Which is why I was wondering if you can get a Material's drops were that Material a Block broken by a player
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#getDrops() atleast a Block tells you what it drops
declaration: package: org.bukkit.block, interface: Block
I could just use (the kotlin equivalent of) a switch statement and manually assign each Material a drop, but if there is a built in method to find it somehow I want to use that since idrk what percentage chance there is to get a sapling or an apple etc
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#getDrops() sounds sufficient for your last statement
declaration: package: org.bukkit.block, interface: Block
since your starting point is a block anyway
Looking for some help
How would I make so a block(Sign) spwans in the different side
of a chest if their is another block blocking it from spawning
because right now when the sign spwans on the chest and if their
is a block in its way it just deletes the block.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Are you by chance sending a TextComponent message to a player/console with commandSender.sendMessage(component.toString()) instead of commandSender.spigot().sendMessage(component)?
does chat even support components in 1.8?
I don;t remember when they switched
E.g. clickable and hoverable messages have been a thing for a looong while
1.8 is a long time ago too 🙂
okies
?1.8
Too old! (Click the link to get the exact time)
Damn.
It happens when I try to teleport to a world. Instantly crashes the server, when I try to regenerate the world file by deleting the current one, logging on crashes the server lol
Im looking into it. It doesnt give me a crash report, but a ton of info in the console, it will take me a second to recreate the issue.
Clearly you are not writing code so you are in the wrong channel. You want #help-server .
thx
if someone knows transformation matrices and quaternion math and can help me fix this I will unironically pay you cash, I am beyond done with this
?paste
Okay how would I do that would I need to make a if statement for every face of the block ?
Im currently doing this https://paste.md-5.net/fedafoyuku.java
it would be simplest to just put the sign on top of the chest
player is two blocks high so you know its going to fit
thats some crazy duplication
Have you heard of Animated Java? Makes things like this super easy, but it's a data pack
@young knoll free moneys
how do i get all nearby blocks of one type? like all sponge blocks in a 15 block radius, but they have to be the highest block at that cord
like a list of them
Sounds like a job for a for loop
Can you be more specific about which part you're having trouble with?
What code have you written so far to try and do this?
highest block at that cord - with that you mean like height-map highest or?
loop
first get all highest blocks
then check if they are sponge
done
I don't 😢
moments like these make me wonder why 2FA is mandatory now
too many hacked accounts distributing trojans
i know that idk how to do it tho
to loop thru blocks i need to first have a list of@blocks
idk how to get the list of blocks
get all blocks in the radius
its math
nothing more
u only need x and z cords
u dont need all blocks
since u only have to test the highest block
get a map of all
what ever you wanna call them
locations
and then get the highest block on each location
getType
how do i spawn structures? like i have these "spawner blocks" that are basically where trees go in my map. so im detecting all the spawner blocks, and i want to spawn trees on top of them
I know how to set blocks or something but what about structures
like keep a hashmap of all the blocks and their locations?
elaborate
lmao no my own structures
?paste
Im going to go mad trying to figure this out
Im trying to make it so if the user has more than 27 items in their invin it spawns 2 chest
if less than 27 it spwans 1 chest the with players item in it
Iv tried doing it in a else statement tired doing it in two different IF statement
iv tried creating the chest twice in the else statement and IF statement
but I seem to only be able to get one chest so spwan with half the users items in it
Code: https://paste.md-5.net/ojitiqocam.cs
anyone got any idea please would appreciate the help
hm
getContents.Size?
int actualSize;
for (int i = 0; i < p.getInventory().getSize(); i++) {
if(p.getInventor().getItem(i) != null) actualSize++;
}
if(actualSize > 27) {
//Code Here
} else {
//Code Here
}
doesnt that return 36 at all times?
not sure i thought it returns all itemstacks
i dont think getContent returns empty slots
@elder dune
.
lemme check
mhm
I am pretty pretty sure it does
It does
ah damn
Otherwise setContents would be kinda weird
true
true
Why is there a demon cat staring at me
thats bingus
who's bingus??
this cat is
https://catbase.siea.dev/ go to this website and sort by bingus
im pretty sure thats all the content that exists of bingus
sadly
what a shame
i wish I could read more books about baboons
but there aren't that many good baboon books
wtf is a baboon