#help-development
1 messages · Page 110 of 1
idk why but on my server worldguard is bugging out ive denied pvp but people can still pvp even tho it says "Hey! Sorry, but you can't PvP here.
and ive disabled fall damage but people still take it
what kind of exception should i throw when calling a method on an object with an invalid state to give any meaningful impl to that method?
the log was caused because I called the message by using this block of code
if(!setupEconomy()){
getLogger().severe("disabled clans plugin due to no vault api");
return;
}
IllegalStateException is like when the object has an invalid state, but it doesnt
Which overload
just getDrops()
Pretty sure thats just if broken by hand
yeah and thats intended
yet it returns a collection with two itemstacks, one expected itemstack and one as if it was broken with fortune
also judging by its random amounts
Very strange
hmm
What sre you trying to do with it
i got like a skills plugin where im trying to multiply and judge exp based on the amount of drops
and with this extra unexpected itemstack people are getting way more crops and exp than intended
myes
Shot in the dark but have you tried getDrops(null)
Not sure if it would work though
im not either but its worth a shot
does anyone have tutorial how to make configurable recipes?
im talking something like this
"A": DIAMOND
"B": DIRT
shape:
- "A A"
- "BBB"
- "BAB"
all i know there will be some looping going on
yeah you're on the right track, where exactly are you struggling
also this doesn't seem to make a difference, the collection still has two itemstacks
strange behaviour but im sure im doing something wrong
It is still white
creating the shape in config
blah
Yeah im not too sure then sorry
i mean its exactly that
you got a list of 3 strings each 3 characters long
so you set the shape as list[0], list[1], list[2]
so i do for row and for column loop?
Just parse material and make it inti a shaped recipe
a shaped recipe is essentially already defined by the parameters you got in your config
Shaped recipe takes 3 strings
so its really not as hard as you might think
Do you guys know how to create a delay in a command?
or its pretty flexible
Yeah youd need some
for example someone puts 2 rows
Scheduler, runTaskLater
Runnable
Thanks
i mean it depends on how you do it but you likely have to do some safechecking yeah
if you're doing it like i did with the list[0] list[1] etc. then list[2] would throw an error if your list is only 2 elements long
isnt 2x2 valid shape tho?
sword is 3 rows and 1 column
leave the list[2] out which is where you do the safechecking
perhaps
Hello People!
I have an issue with a plugin called AuthMe on my server. Whenever a player reconnects twice without doing the /login they are sent back to spawn. I think this happens because AuthMe just pulls the coords from the player.dat. Could someone point me into the right direction of how I can fix this issue?
ive had more stable moments in my life
thats a question to #help-server
or authme people
no I mean from a code perspective
How can I get the player target block? The LivingEntity#getTargetBlockExact returns null if the player is facing no block
I run an old AuthMe version so I wont get support from AuthMe people
isnt that intended?
i dont want null
then what do you want
ig if its null return air 😂
What do yoy want
if the player isnt targeting anything what do you expect
how to fix getOnlinePlayers?
isn't it just getPlayers() now
i dunno lol
check why its deprecated
often times it'll suggest an updated alternative
Actually I want to teleport the player x blocks straight
in console annouce error
If he hits a block, it will teleport him to the block
if not, it will teleport him to the max distance
idk why but on my server worldguard is bugging out ive denied pvp but people can still pvp even tho it says "Hey! Sorry, but you can't PvP here.
and ive disabled fall damage but people still take it
i'm use spigot 1.7.10
Thats your problem
uh i dont think its deprecated
ok
@drowsy helm solved the issue, I needed an economy plugin as well as vault
Lol there ya go
skill issue ngl
i want convert plugin to latest version
then use 1.19?
you're using an old api right now, you cant update to newer versions on an old api
you read message again
you use old apis to make plugins for old versions
you want the plugin to the latest version
that is 1.19 yes
or am i mistaken
yes
copilot ahaha
then you shouldnt use the 1.7.10 api
have tbh but i maybe needed it once
thankfully that one can be fixed
i guess
change spigot api version
and change what errors
or got deprecated
spoiler: a lot
yeah updating plugins to such a newer version isnt gonna be easy
most likely
unless its a super simple baby plugin
mwoa most of the time it just suggests shit
inheritance and polymorphism
player instanceof Entity -> true cuz Player class implements Entity somewhere
if you make an interface with a certain method and you have one of your classes inherit said interface, your class will be an instance of that interface
yes i saw with the coin flip in a chain class
but mah custom class cannot implement player for example
why would you want that anyway
why coin flip needed in crypto coins
kacper instanceof Danger
skyluh
whatever that means
its his wife...
waltuh
put ur d away waltuh...
taking this!
put your abstraction away waltuh
i dont wanna deal with polymorphism right now waltuh
kinda is
ye i think i looked up wrong polymorphism
i always forget what they mean but i know how they work lol
EXAXCTLY
i made records without knowing
i mean people learn what words mean but dont know how to apply them 🤔
it just means something like an abstract class can have multiple implementations
i didnt know i do DI but i do
hence the poly
records and di doesnt have anything to do with eo
im gonna slab you with that

guys i found jabba
Its not working still
extending is super isnt it
now make it in minecraft
what the
super() calls superclass constructor yes
crikey
how can I listen to packets from a certain player only with protocollib?
That wont do
is it a protocollib limitation
if so is there a tutorial for packet handling or another api that lets you do that
considering its possible i guess hopefuly
it realy should be
I mean
just like bukkit
how do you listen to a bukkit event only for a certain player?
You have a PacketEvent#getPlayer
so what's the problem
I have something like an intro in my server, listen to move events and such
but every player goes through it only once
i want to unlisten to event afterwards
just have a set of uuids or something
It's negligible
💀
idk its move&rot packets and all
thought it would have some kind of hit at performance
It saves you time
HashSet#contains is like O(1)
Ok then ill ignore it
thanks relaxed me a lot
and packet events are mostly done async regardless
The power of resource pack + plugin
In fact. But as far as I understood it is less memory efficient than an ArrayList. Is this true?
They work in different ways
I forgot to mention blender exists too
memory-wise it's basically the same
HashSet is literally a HashMap<T, Object> where the object is a constant
so you have node objects and all
but it uses hashing for queries and all
which particle is used for the enderman?
yeah it's less memory efficient in some ways. it cannot be forgotten that arraylists double in size when they run out of space so they can be up to 50% inefficient in that regard.
But the meaningful memory based difference is that the array has excellent spatial locality so iteration is much faster than a linked list (and so as a result also the linked nodes of a hashmap)
I've a question. Would it be good if I make a class called Kit and just every class that is a kit extends it? (The Kits have all an custom ability etc)
oh damn exerosis is here
Once in a while yeah
I remember you helped me when I started codin plugins
just here to trash linked lists 😭
linkedlists are useful on that one time
in a million
that you want to actually use it as a dequeue / list
It is true that I rarely used linked lists, when I do make them I generally just make my own nodes.
I think I only used a linkedlist like once
where it was the best choice
instead of just the most convenient
think it was like a size-limited transaction log
I don't even know when it's most convenient, arraydeqeue has similar level of convivence. Queues tend to be blocking/concurrent/channel
where I'd poll the last element and add the first in type deal
so I'd have to shift every single node by 1 element, if it was an array
but with linkedlists it was simple, just remove the last and add the first
Oh well certainly they perform better when you are adding elements to the middle
but when you add to the end and remove from the start you might be tempted to just use a ring buffer, since you don't need to reallocate a fixed sized data structure like that.
listen man I'm just an amateur developer no need to micro-optimize everything for a 20$ commission
True, which is why linkedlist is fairly useless lol
it has convenience as a queue/deque with a get(index) method
pretty sure that's another reason why I didn't use arraydeque
the get(index) part was useful for something
made a boundedbuffer which overwrites old elements hehe
do I really want to waste an hour thinking of the best data structure for a transaction log limited to like 30 elements
what the hell
part of me really wants to make this a real thing
just to fuck with people
like make a custom helmet or something and spin the yaw really fast
maybe go beyond 20tps
nms?
I've got a question. Would it be good if I make a class called Kit and just every class that is a kit extends it? (The Kits have all an custom ability etc)
abstract class or interface yeah
oh right good point.
if u have guava EvictingQueue
reminds me of the time I was optimizng Math#abs to not use any ternary or If statements
how long does an if take
I need to know to stop doing that
🤦
Support What's a Creel? on Patreon: https://www.patreon.com/whatsacreel
Office merch store: https://whats-a-creel-3.creator-spring.com
FaceBook: https://www.facebook.com/whatsacreel/
In this video we look at branchless programming. This is a technique to gain speed in our high and low level programming by avoiding branching code as much as po...
why
Basically
but think of it. At the end you'll be able to add 1 and 1
MYES
I just happen to be a little shit and like to challenge myself
only thing i did today was fixing some bugs and a stackoverflow 🤡
who needs 1 plus one anyway. Its overrated
who needs math anyway
back to counting on your fingers
kids that are too lazy to do their homework
what kind of bullshit is this ahaha
also why does the dude look like a sausage
the thumbs up at the intro is the funny stuff
pov: compliment
hmm multiplying bigdecimals should not give those weird floating point issues right?
im wondering what the overhead is with using a BigDecimal instead of a double
I still don't understand why you're not converting it from infix to RPN and then evaluating RPN
@tardy delta
infix, rpn? whaaat
Maybe I'm mis-understanding what you're trying to do... but if you're trying to evaluate things like ((1 + 9) * 6), thats what you should be doing.
yes
Yeah, if you convert it to RPN then evaluating it while following order of operations is extremely easy with a stack
I just gave levitation and animated the spinning in blender
It actually didn't take that much nms
I bet it would be entirely possible with nms though and I wouldn't need to use blender
You made that video?
That's the point
You succeeded
@tardy delta didn't use much nms bc I used blender to render all the stuff. Mainly just vectors and effects
Just repeating that bc of reaction
lol
Should I remake it in fabric and make it actually playable rather than just for a video
that would be cursed asf
Good
?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/
was there any 1.8 pvp option in the new spigot versions ?
How would i go about loading a 3d model in a way that i can spawn it inside the world
I didn't know that existed
I've been solo carrying an entire smp bc the owner was too lazy to hire anyone else
(Maven)
So I just built my plugin without changing anything relating to Maven and it errors with
[ERROR] Malformed \uxxxx encoding.
According to stack overflow I need to delete all the files containing \uxxxx in my .m2 directory but upon doing that the error reoccurs.
My name has been changed on the spigot forums, how do i make it reflect here?
Talk to one of the staff
How can I trace a ray using the player rotation? The World#rayTrace returns null if it does not hit anything. I would like something like world.rayTrace(location, direction, distance).getHitPosition()
Can’t you just pass the players look vector
wdym
You want to raytrace using the players rotation
So pass their look vector into the rayTrace method
Ah
If you just want to get what’s X blocks in the players looking direction you can just do some vector math
how can i do this
Iirc you just multiply it
Is there a list anywhere of what types of trees are naturally generated in each biome?
eeeeee does anyone know a library that cna convert a blockbench/magicavoxel model into like an array of voxels
Hey! I got this error https://hastebin.com/isenehifoj.shell with this code https://hastebin.com/elejuyetig.kotlin while I did import mariaDb into my pom.xml (https://hastebin.com/uquhodoruk.xml) thank you very much for your help I'm a bit stuck x)
so i can spawn blocks according to the voxels
im seriously gonna cyr
Afaik all rayTrace methods will return null if they don’t hit anything
Who'd have thought
Quick question. I have been trying to add a dependency to my plugin in my plugin.yml. For some reason though anytime I compile the plugin it doesn't have the dependency.
What are you compiling with
does anyone know how to replace a material's underscore with nothing? i am trying to make a /give command. and i am using material.getmaterial
I am compiling using the package function of maven in intelliJ
I have tried clean package
and I have tried reinstalling maven
Have you tried running clean t- welp
plugin.yml
?
I've somehow created a set that has duplicate values
Could it possibly be that that is the type of value rather than the actual value?
This is what's printing, this.getObject() is Gson's JsonObject and keySet should return a Set<String> of all it's keys, which obviously shouldn't ever contain duplicate values
But it does... 
upp
Bump
Did you shade the driver library into your plugin or include it under libraries in your plugin.yml?
i don't think so 'cause i don't know what shade mean
i add it to my pom it's that ?
Is your plugin 1.17+?
yes
Have a look at “libraries”, here;
https://www.spigotmc.org/wiki/plugin-yml/
and set the scope to provided in the pom under that depend
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ty !
Bump!(Also look at the next few messages they will be helpful)
What dependency is it?
ProtocolLib
Unsure if you ProtocolLib allows to be used inside another plugin, but;
In your pom.xml make sure you have shading setup and remove scope as provided from ProtocolLib (if set)
“Quick question. I have been trying to add a dependency to my plugin in my plugin.yml. For some reason though anytime I compile the plugin it doesn't have the dependency.”
“anytime I compile the plugin it doesn’t have the dependency” - which would lead me to believe it is a compile error
or a failure at locating it
Well everything else is properly saved and compilled each time
its only the depend line that is missing each and every time
Can someone explain why states are snapshots?
Coll
Could you send a copy of your plugin.yml via dm
is there an event or something for when a player has fully loaded in
like they've generated terrain and stuff
Don’t think so
It won't allow me to.
Thats my plugin.yml
if you need the physical file I can send that too
ok well im having a strange issue
so im using the player join event and setting a task for 1 tick later where it sets the players resource pack
issue is the first time the player joins after startup the resource pack fails
it gives this message
one sec
does anyone know how to replace a material's underscore with nothing? i am trying to make a /give command. and i am using material.getmaterial
dont you need an address for that
i am forcing the resource pack
no but the thing is
did you put a pack.mcmeta
I was meaning I could send the actual like plugin.yml file here not using mail
ik but physical is physical
the second time it loads properly
loads perfectly fine the second time
why isn't it working the first time?????
wait let me try something
Have you set the load order at all in the plugin.yml?
The picture I sent(included in this message). Is the entire file....
can i make falling block break when touching ground somehow?
EntityChangeBlockEvent
Anyone?
Any idea how I can get an entity move a specific amount of blocks forward?
Using NMS
ok yea still not working
ok i added a 5 second delay with run task later
so it definitely didn't run until after my chunks loaded in
i still got the same problem though
@wise mesa 1.19.2?
It's a bug that has been introduced
Mojang fixed bug MC-252082
but this creates another bug
which is what you are experiencing
is the new bug on jira
Does anyone know why a part of a plugin wouldn't be compiled into the end .jar file? as in a specific part of a file? I'm asking because in my plugin.yml in my IDE I have a line that lists my dependencies my plugin needs. Upon compiling the jar and opening it however the plugin.yml file no longer contains the dependency line
are you using maven
yea
I've done that 6 times
Don't think so, I don't really bother reporting bugs and this is such an edge case
this is an edge case?
afaik it only happens if you don't change the url
ohhh
interesting
yea I regenerate my resource pack every time the server loads
guess i could add a random string to the end of the file
I'm unsure on that you'd have to check
the worst part is the client doesn't send a failed status
it sends success instead
now that seems like a bug
Only "workaround" I've found so far is to check how fast the success status is sent between loading status, because realistically a resourcepack takes at least 1 second to send success status even if it's the smallest one
so just resend it if it's too fast xd
PlayerResourcePackStatusEvent
ah thanks
any idea how to open a demo troll to a player?
Player#showDemoScreen
?jd
ehh... doesn't work
very descriptive and helpful
help my plugin is not working
also very descriptive and helpful...
people are very helpful today
well sam you've actually been incredibly helpful thank you so much
console: https://paste.md-5.net/rinubawoco.cs
https://www.spigotmc.org/resources/demo-troll.2754/ I'm using 1.8.8. I've only seen something about packets but I don't understand exactly what to do
@rocky pond You'll have to find the obfuscated names for this
what do i do when couldn't pass event PlayerInteractEvent
You read the stack trace
don't use 1.8 without knowing what you're doing 👀
alright thank you ill try it
couldn't pass event PlayerInteractEvent
@rocky pond https://nms.screamingsandals.org/ for mappings
thanks
this website is so awesome
yep
i love whoever made it
HELP PLS
hey we're all just a bunch of developers who are here to get help and help others
we're not paid
we aren't support
if we know how to help we will
Anyone know what could be wrong with this? I am trying to move the pig to a specific set of coordinates and b seems to be returning false and nothing happens.
Pig pig = (Pig) player.getWorld().spawnEntity(player.getLocation(), EntityType.PIG);
pig.setAI(false);
Bukkit.getScheduler().scheduleSyncDelayedTask(TowerDefence.getInstance(), () -> {
boolean b = ((CraftPig) pig).getHandle().getNavigation().moveTo(5, 70, 18, 1);
Bukkit.broadcastMessage("b is: " + b);
}, 40L);
Anyone?
Send the full error
Teleport the pig or make the pig walk there?
@EventHandler
public void onInteract(PlayerInteractEvent e) throws InterruptedException {
if (e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (e.getPlayer().getInventory().getItemInMainHand() != null) {
if (e.getPlayer().getInventory().getItemInMainHand().equals(creativewand)) {
e.getPlayer().getInventory().remove(creativewand);
e.getPlayer().setGameMode(GameMode.CREATIVE);
wait(300);
e.getPlayer().setGameMode(GameMode.SURVIVAL);
}
}
}
}
anyone knows how to fix it? it's not working
Trying to make it walk there
no one
Sleeping the main thread
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
They don't cancel the event and that's what screws them lol
Thead.sleep on main thread trust me bro
Whenever TRAP is thrown that's the issue
Didnt ask
Any one?
;-; https://paste.md-5.net/rinubawoco.cs full exception
Y2K do not provoke me
mb you are superior
You're messing with the result of the event causing the execution of it to throw the TRAP exception
how do i fix it
You are deffo superior but dont troll
By canceling it or not messing with the result?
I'd suggest making a post on the forums 🙂
your question, doesn't make sense but someone there could prob help you
I got it, you could tell this instead of saying no one.
:P
can you send me the code?
im new to this
good luck mate I highly doubt anyone here is willing to support code that old if you do find someone porting backwards is hard as hell. Don't forget 1.8 is over 7 years old at this point
Big W on you bro ur the superior
Don't need to. You should know this. Event.setcanceled or just don't mess with whatever the event needs to execute.
okay so if i got u adding this in my plugin.yml :
libraries:
- org.mariadb.jdbc:mariadb-java-client:3.0.6
and set the scope of the dependency to provided should patch my problem ?
That would do it yes
so just add e.setCancelled(true);?
i am actually so glad they added that libraries feature to plugin.yml
Try it and see
i will (hopefully) never shade again
The library feature is pretty meh NGL
shading was just so annoying
Downloading from maven central breaks their TOS
and now i don't have to do it
all we need is for aikar to put ACF in maven central and then we won't need to shade that
And you cancelled it?
simply put you are always running a risk with names though it may be small that player data gets fucked
Remove the wait(300) Use schedulers.
oh but he's on 1.8 things were different then
?scheduling
what is this
again my point above though its a small chance you still run the risk of having issues
see the above link
on top of UUIDs just being a standard good practice
Isn't this in your code?
@quaint mantle
Yeah get rid of that
ill try
wait pauses the whole server
don't stop main thread :)
Wait wait wtf
the scheduler let's you tell the server to run some code on a tick in the future
i would laugh but i definitely did stuff like this back in the day when i was new to spigot
Man i was worser
I've never stalled main thread always seemed illogical to me to stop what the entire server was running on
so put Thread.sleep(300L); instead?
That ^
No bukkit scheduling
I honestly can't tell if you are trolling if you don't schedule a bukkit task the entire server stops
let that sink in
when you wait 300 miliseconds the entire server is stopping for 300 miliseconds
I have very little knowledge when it comes to packets. I'm currently trying to use ProtocolLib so that I can attempt to make an invisibility thing that will do what hypixels invisibility(in bedwars) does(which is make the player and player's armor invisible). I know I need to be listening for the Entity_Equipment packet but I know basically nothing more on how to edit the packet or change it so that the player will be completely invisible when I turn them invisible.
no chests can be open no blocks can be broken for 300 miliseconds
I don't think they're trolling they're just new, and there's nothing wrong with that
OO
i know now
i did a while loop to check when a player did something
i was new to programming as well
i went from scratch straight to spigot
not my best move
Well I suppose I shouldn't use my starting bar as that for others because all learn at a different pace
lol
While my first plugin was a mess it was still fine enough to sell 🤷♂️
I just try not to discourage others who are starting to learn by making fun of them for silly mistakes, it's gonna happen and that's okay
When did you first started spigot coding?
It's all a learning process 
I've been programming for 1 year now been very fun I like making stuff
i am not making fun just funny that i made the same mistakes years ago
I don't think he's targeting you specifically mate
you mean system time in ticks 💀 ?
Oh no I know no one was, I'm just saying in general.
so like in other games
anyone?(bump)
U started java 1 years ago?
for example tf2
they have a running counter of the current tick
when the server starts it is on 1 and it just goes up forever
you dont need packets
i was wondering if minecraft had something like that
@river oracle
yes
Whats your level
Player#hidePlayer
@mighty aurora
idk 🤷♂️
it must've been around early 2019
how would you quanitfy that
I've been told high intermediate but level means nothing imo
The player can't take damage when you use that I've tried that and it DOES not work for my purposes
Man its 1.5 years for me and he is fucking better than me
Everyone learns at a different pace
Prolly you code at least 8 hours in a week and i code 1 hour
hmmm well I code for a couple weeks take a month break than come back usually
only thing that has kept me in it for this recent burst is my job I got for a server
I took a 5 month break from coding in general though thats my longest
I believe you can give invisibility effect and disable all ambient particles
For equipment you gotta use packets indeed
PacketType.Play.Server.ENTITY_EQUIPMENT will be the packet
then you gotta check if the slot is an armor slot and if it is set it to air
you want invisible player to see their armor?
I don't really care if the player sees their armor or not.
No man ur just brain superior
Hello can anyone help me? I would like to have a explosion of "blocks" as "animation". Sorta like the hypixel partypopper gadget. How do create these entities?
Probably falling blocks with velocity set to die when they hit blocks.
i suck at explaining, if you want i can just write it and send you the code lol
ahaha you could say that I appreciate my gifts most have their thing I guess
I would appreciate that
PacketEvents on top
only reason I use plib is its a name I know. Also make sure it works for 1.19
never used it but looks better lol
Cause this is for 1.19
I use maven
shouldnt make a difference at all
@dire marsh should i look at the difference in time between sending the resource pack and successfully_loaded or between accepted and successfully_loaded
what are the benefits of packetevents over protocollib
less abstraction
I believe its just a lot simpler to use
Haven't had a reason to use it yet, but retrooper is good so I know it's a good resource
difference between accepted and successfully_loaded iirc
ok thanks so much
Is there an event for when an entity starts to move to another location?
paper has an entitymoveevent if you're using that
hi, how do i make a custom dimension using spigot api ?
I... dont' think you can technically speaking
I mean you could modify generation to the point where it kinda acts like acustom dimension but there is only so much you can do
idk if you can change sky textures withuot affecting the rest of the worlds though that'd be something interesting to check into
Is there any bukkit method which allows me to check if it can rain/snow in a specific biome?
Just checking before I just make a switch case
no i want to do it like multiverse-core plugin
i have a world folder and i want minecraft to load that folder as dim
iirc, no there isn't.
Okay, is there any other biome where there is no rain/snow except desert?
Tundra, Taiga, & Savanna.
I'm pretty sure weather is handled on the client side with the server providing when its raining and how long.
I am trying to set a creeper as a passenger of a snowball but it is not working. It works for a very small time then the creeper despawns. Any ideas?
Not sure what you mean by that 🤔
Okay, thanks 🫀
I meant it as an explanation why spigot doesn't have an API method for determining weather it can rain/snow in a specific biome.
mb
hmmm well that can actually get pretty complicated I'm not huge into world gen but iirc its very tough to do something like multi-verse without causing lag
There is an nms method for it though 🤔
Just don't want to use nms as it would just unnecessarily complicate stuff
usually i just opt for a bungee setup rather than mess around with stuff like that
Generally I'd point you to looking at how multi-verse themselves do it as they are open sourced
Fair Enough
ignore the music but this is using the same code you provided.
@EventHandler
public void onPLE(ProjectileLaunchEvent event) {
Creeper creeper = event.getEntity().getWorld().spawn(event.getEntity().getLocation(), Creeper.class);
event.getEntity().addPassenger(creeper);
}
/command argument argument how do i get all the arguments as a string like argument argument
yea, I was on peaceful mode 🤡
lel
nvm
what should i use instead
valueof?
it wants string
not int
where are you getting these magic nubmers from
packet wrapper
you can just use the deprecated class and ignore the warning it doesn't explicitly say its deprecated for removal
bet
probably just a warning like there is a better way to do this
so do it that way
if its ever removed you can just map it yourself
replace spawn with spawnEntity and getEntityClass with getEntityType
?stash
String.join(" ", args)
Not possible
ty
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/entity/EntityType.java#247 the Ids of many entities is -1
Already fixed it. I was on peaceful mode
You probably need to referr to either the packet wrapper or the NMS entity registry
Makes sense
It's a no-brainer that post 1.13 entities have no stable ID
The only ID that they have is the packet/registry ID
Bukkit however will refuse to provide those IDs
The PlayerInteractAtEntityEvent is called before PlayerInteractEvent. I have an object with a rightClick method and it is being called twice. How can I make this be called only 1 time?
I have an int array that contains values like
0x00000000, 0xFFFFFFFF, 0xFFCCFFFF, 0xFF99FFFF, 0xFF66FFFF, 0xFF33FFFF
But when I get a value from it
it gives me the integer value, which makes snese
but how would I make it like this again
Integer#toHexString
Thanks sm!
Hello. How do I make FallingBlock entities deal damage?
I tried setting setHurtEntities to true but I believe I have to set the tag FallHurtAmount to non-zero value as well to deal damage. But I have not found a function that does this.
Is stuff like a plus symbol allowed in command args?
dont think anything about command arguments are restricted
alright thanks
Wrong API version to server version?
wdym ?
What version is the server running and what version of the API is the plugin using
server is running 1.8
and my api was 1.19.2
now is 1.8.8
now i cant even compile it
😦
Yup
Yup
whys that
Cause they didn't exist in that version
The API in 1.19 is MUCH MUCH different than to the API in 1.8.8
half the API is not present in 1.8.8 - correct
Yes
then what should i use
magic values
i normally use this way
new ItemStack(Material.HEAD, 1, (byte) 7 /* What exact value you want I cannot say */); or something like that
Actually
You'll want new ItemStack(Material.SKULL_ITEM, 1, (byte) 7 /* What exact value you want I cannot say */);
what am i doing wrong why cant i set name of item in itemMeta
and this still doesnt set player heads in gui @quiet ice
Hello! I cant seem to understand how to make this messy pile of code work, so i am going here in search of answers :P
What i am trying to do: i would like to convert a SQL string into a Location value.
My code: public static Location getMinP(Integer id) throws SQLException { String min = String.valueOf(DB.getFirstRow("SELECT minP FROM event_regionsWHEREid` = '" + id + "';"));
String string1 = min.substring(min.indexOf("=") + 1);
String string2 = string1.replaceAll("[{}]","");
String string3 = string2.replaceAll("(0[.]0)","");
String[] split = string3.split(" ");
return new Location(Bukkit.getWorld(split[0]), Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
}`
I'm sorry if i made you puke because of my horrible code, but i am learning, and trying to perfect my craft :P
Thanks in advance ❤️
EDIT: Code copied to hastebin https://hastebin.com/ewataxesac.php
EDIT EDIT: Code copied to md-5 paste https://paste.md-5.net/kazilodegi.js
?paste
pls
It's on hastebin
Why are you storing the location as a string
What is the type of 'DB'?
Never heard of AikarDB :/
Haha, im not blaming you :P
I believe it’s a library
can't even find that on google
How did I know it was related to ACF.
Alright so what does DB.getFirstRow() return? What type?
Would take that from the javadoc but since it doesn't exist... ^^
Yeah just hover over it and your IDE will tell ya :)
I would guess it returns an object of type "DbRow" based on the api documentation - just making sure.
Cant you send images in here?
only after you are verified
?verify
!verify
Usage: !verify <forums username>
ah ty
!verify superkrokodilen
A private message has been sent to your SpigotMC.org account for verification!
Alright. In that case
DB.getFirstRow("SELECT minP FROM event_regions WHERE id = '" + id + "';").getString("minP");
might work
Right now it by itself gives {minP=EventHub 51.0 11.0 13.0 0.0 0.0}
Use the methods in DBRow
yeah because you get a DbRow. Try calling getString with "minP" on it
Rather than turning it into a string
final String message = getString(path).replace("%prefix%", getPrefix());
message.replace("%player%", playerName);
Result of 'String.replace()' is ignored
Can someone tell me why?
message = message.replace I think
I mean it gets the message from final String message and just replaces again, why would that be ignored
I'm trying to change Chuck's biome beforebe generated - 1.8.8
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
world.setBiome(chunkX, chunkZ, Biome.PLAINS);
world.setBiome is not working
Does it go away when you do
final String message = getString(path).replace("%prefix%", getPrefix()).replace("%player%", playerName);``` ?
I cant get that to work, unfortunatly.
For my test the first one works, while the other one doesnt
First: public static String test(Integer id) throws SQLException { String min = String.valueOf(DB.getFirstRow("SELECT minP FROM event_regionsWHEREid= '" + id + "';")); return min; }
Other: public static String test(Integer id) throws SQLException { String min = DB.getFirstRow("SELECT minP FROM event_regions WHERE id = '" + id + "';").getString("minP"); return min; }
I'm sorry if this is the silliest problem, but would really help out if i got this sorted :)
Yes, but that was not the intention.
Let me show you what I want to do, just a rough start before I figure out a way to do it correctly.
public String colorize(final String path, final String teamTag, final String playerName, final String state, final Time time, final String reason) {
final String message = getString(path).replace("%prefix%", getPrefix());
if (playerName != null) message.replace("%player%", playerName);
if (teamTag != null) message.replace("%teamTag%", teamTag);
if (state != null) message.replace("%state%", state);
if (time != null) message.replace("%time%", time.toString());
return ChatColor.translateAlternateColorCodes('&', message);
}
Remember that Strings are immutable!!
Strings are immutable
I'm a visual person and a beginner, if I don't lay it out I can't figure out how to do it correctly. 🤣
Is someone free to explain that on my example?
Okay I understand now.
So you're re-assigning now?
what doesn't work? Does it compile? If so - what's the result?
I'm just trying stuff in vain. I want to make optional parameters for my Messages#colorize() and Logger#send() methods.
I use Spigot#sendMessage() inside of my Logger#send() method.
You can always make a method but idk it looks like a lot of work for something you don't need
https://github.com/DivineRealms/LeagueManager/tree/master/src/main/java/io/github/divinerealms take a look at what I have currently.
I just made methods that are named the same https://github.com/DivineRealms/LeagueManager/blob/master/src/main/java/io/github/divinerealms/configs/Messages.java and called them but it's not practical and it's ugly.
Hmm, it seems to be working now! :)
Thank you so much ❤️
``` If I have this if statement(disregard the missing } I only need to verify one piece of this)will it run if the packet is correct and the player has only one of the two tags?(sorry if this seems like common sense I just need a sanity check) Basically will it run if the packet is correct and the player has either of the tags or did I put it in wrong
you have to copy the packetType() == to the other side of ||
Or is this the correct way? It's really long and unpractical when using, I just want to put it in one method and perform checks for parameters.
Is that even possible?
Whenever you notice that you're doing a lot of repetition in code you can probably extract it into a function
lmao
to me this looks like that code could be condensed into 50% of what it is
if forgot to do if(!chunk.isEntitiesLoaded()) continue;
lightning spam was happening in chunks where they were unloaded
so every time i loaded a chunk thousands of lightning strikes would occur instantly
I'm trying to change Chuck's biome beforebe generated - 1.8.8
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
world.setBiome(chunkX, chunkZ, Biome.PLAINS);
world.setBiome is not working
dont use 1.8
Pretty sure you gotta change it in the ChunkData
if you want the pvp, use 1.19 + viarewind and oldpvpmechanics or whatever its called
don't have any method to change this in chunkdata
Well I doubt you can edit a chunk from the world if it hasn't been generated yet
im pretty new to java, whats the differences between runTaskTimerAsynchronously and runTaskTimer?
runTaskTimer runs on main thread and runTaskTimerAsynchronously runs on another iirc
Well, most of it
Solved 😪
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
biome.setBiome(x, z, Biome.PLAINS)
The PlayerInteractAtEntityEvent is called before PlayerInteractEvent. I have an object with a rightClick method and it is being called twice. How can I make this be called only 1 time?
is there a way to get a random enchatment? i thought EnchantmentWrapper does that but it doesnt look like it does
Enchantment.values will get you an array of them
Then just select a random element from said array
dont need a random level for an enchant, need a completely random enchant
need to reroll a VillagerAquireTradeEvent
oh wait i get what you mean
@kind hatch Hey, thanks for showing me maven modules. They're extremely useful and I daresay they surpass java modules.
I'm very grateful for it.
?1.8
Too old! (Click the link to get the exact time)
i love that theres a tag for that
if(block.getType().equals(Material.COAL_ORE)) {
block.setType(Material.BEDROCK);
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
block.setType(Material.COAL);
}
}, 300L);
}```
```java
java.lang.IllegalArgumentException: Cannot get data for not block COAL```
anyone know why
COAL is not a Block
oh fuck im stupid
Btw this is a pretty bad approach to respawning blocks
whats a good approach to this lol I remember making something similar like idk 5 months ago curious what a good method to doing this is
First thing you want: Serializability. If the server restarts then you want the blocks to not be gone forever.
Then you should use a PriorityQueue<Something> which is ordered by timestamps and polled every second.
So you poll and work down the queue until you hit a timestamp that is in the future.
This has by far the best performance for this application and can easily handle hundreds of thousands of Blocks.
The stored object should contain
- the BlockData
- a unix timestamp (long)
and implement Serializable<Self>
very interesting
thanks for the idea 👍
are swift sneak and soul speed the only enchants you cant get from a villager?
not spigot related but i assume someone here knows
You can get all enchants from villagers?
can you?
Have you even played minecraft before?
i thought swift sneak was ancient city exclusive and soul speed was bartering exclusive
Oh I misread they don't
wiki moment
Give those 2
Yo 7smile7
thanks
Oi
Are you able to give some insight on your current dev environment?
Hardware, monitor specs etc
I'm just trying to see like
the type of hardware decent developers use
I know you don't care, but I run a lot of minecraft shit xD
i got an i5-12600k cpu with an rtx 3060 :P though don't really use the graphics a lot as most stuff is cpu centric
I don't really care about pc specs as much
mostly just monitor and all of this niche stuff that can really change the experience regardless of specs
I got a 2k 144hz monitor a couple days ago and coding is a lot more enjoyable
Coding in Speeeeeeed
So I'm tryna see what else I can do to make the experience even better
I just have 1 crappy 60hz monitor lol
lol I use a 32" monitor so it can fit more code and I don't have to look too close to my PC
mine's 27 inch but pretty close to my eyes
3x 27 inch is the best for me
I can usually sit 2-3 feet away and read comfortably
Helps when rereading the same line 20 times
That's pretty close
I'm also thinking about buying a m1 macbook because I hate my laptop
6-bit color piece of garbage
anyone using a laptop like me or just desktop?
I transitioned to a desktop like 2 years ago
Desktop with 2 monitors or a laptop with 1 works
I have a 2k 165 Hz main monitor (not sure how big but its pretty big) and a second 1080p 90Hz secondary monitor for
stuff like discord or documentations etc.
I got an i9 9900k @4.9Ghz on all cores (Watercooled :D)
3070Ti Founders edition
1000 Watt psu
Some Z390 Motherboard
2x 2TB Nvme
1x 2TB SSD
2x 4TB Hard drive for backups running in raid 1
If i would change something today then it would be the CPU. Ryzen is probably a better fit now.
i use a laptop when I wanna move around otherwise desktop only
I like to sit outside sometimes
so I use my laptop then
Well now that we're going with specs hmm
I feel weak with my Razer Blade 15 😄
how much data do you need honestly 👀
smile run a server with every commit of spigot ever made 
If you only casually game and have a decent inet connection then you surely dont need more than one TB
-
2k 27" 144hz IPS main monitor
-
1080p 24" 144hz VA monitor for chrome etc
-
1080p-ish 21" 75hz monitor exclusively for discord
-
Ryzen 5 5600x (water-cooled, even though it's a 65w chip)
-
Rx6600 8gb (does medium ray tracing)
-
B450M-A pro max (was like 50 bucks)
-
32gb 3600mhz ram
-
512gb nvme ssd
-
128gb sata ssd for work stuff
-
2x 1tb HDD in raid0, each HDD came from an old laptop, with about 35k hours
Around 4 months ago when i build a pc for a friend the best CPU you could get regarding price/performance was some i5 12500F or something. Let me double check.
things that make coding really handy in my case is my wireless, low-profile keyboard
love it
I mean 12 TB is a lot but.. if you have a lot of things to store like games (GtaV..) or just every lib of the mavencentral repo 🤣
It was 12400F
Damn what's with all the RAID over here
raid0 for performance
xD
I wanted to play call of duty
yet open it within 5 minutes
it's the most fragile raid0 array
Buy a NVME and write it off on your taxes as a work expense
imagine paying taxes
Modded Skyrim with 3 different profiles taking up 312Gb on my drive...
Crying with my 480GB SSD xD
Jesus i miss skyrim so bad
I bought a 2TB NVME for my server and it can only use 20% of the throughput
I could buy some new monitor arms
I know some from a certain company. Only costs you a thousand bucks.
I just can't trust the laptop industry after the disgrace that is my laptop
I already have a decent 100$-ish mic
with a mic arm
that's attached into my monitor arm
not janky at all
my mic is 20 bucks and its peak
also got a 30$ webcam like a couple days ago
Nvme m.2 is the only ssd I have on my laptop with 1 TB, they were in raid but i disabled it
time to open "mine-academy"
totally original name
make crappy videos into how to make ploogins
If you translate it to another language it'll sound cool and foreign
abuse static to keep the video short
I can make the tutorial in like 2-3 languages
have an international presence
I meant the name
For condensor mics i can suggest the Rhode NT1 or NT1A
Got my gf one because she sings a lot. Its around 250€ but you still need an amp for it.
imagine having a gf smh my head
I have one that's basically a modern blue yeti competitor
Hyper X Quadcast?
was thinking on being trendy and getting one of those shure mics
it's a weird chinese kickstarter company
thronmax mdrill one
you should makea spigot tutorial but only use horrible coding practices and bad naming conventions
integrated pop filter n all
I'd hate that given I'm picky about coding style
I'm literally obsessed with optimizing code
Oh and have horrible music in the background and only communicate through notepad
mic on, you just hear typing noises
imma make sure to use my webcam mic
yes lol
Yes!
have a yellow circle around the cursor
And some broken family noises in the background
and every time I click, it makes a circle as well
Bandicam in the corner
no need to stage that one, just happens by itself