#help-development
1 messages · Page 1910 of 1
Well stop that and google PDC
^ i did
And then you figured out how to do it?
Forget about messing with nms and nbt like about nightmare
this is probably a dumbo question but i havent been able to figure it out. Random rand = new Random(); int number = rand.nextInt(100 - 1) + 1; if(number == 5) { System.out.println("5"); }the chance is 5 but it runs 95% of the time. i am i doing something wrong?
To be exact, a persistence api for plugins based on nbt. You cannot modify existing nbt tags with pdc
now i have to google what a persistence api is
Finally
it is not a termin, it just means "api to store persistent data"
so is it saved in ram? or like somewhere on the harddrive
oh wait this is like a really fancy hashmap
It's persistent it's stored in the file
It is saved on drive, but cached as well, because performance
so i can ditch my sqlite database?
sql definitely has advantages over PDC
very different use cases
stuff like queries and offline access are pretty much impossible with PDC
im just using it to store the hologram's information, and then each armor stand that displays text
storing large complex data is also not as easy as you might want it to be
I'd even use files for this
idk i already have the sqlite system all working and fine so id rather not
oh that is kind of true
^^ yea pdc is really for plugin internal flags and data
Storing the holograms location somewhere is better than using PDC because otherwise you'll never be able to figure out where they are
this is probably a dumbo question but i havent been able to figure it out. Random rand = new Random(); int number = rand.nextInt(100 - 1) + 1; if(number == 5) { System.out.println("5"); }the chance is 5 but it runs 95% of the time. i am i doing something wrong?
yea i store the location in the x, y, z, and world columns which makes it easier with debugging i guess
ok anyways how is this related to nbt?
does minecraft use pdc to store the nbt data?
PDC is NBT. It's just spigot giving plugin devs a little playground to avoid messing up anything on the item
ok
?pdc
Meh making people work for it is more fun
some people want to watch the world burn
my brain was like leaking out of my ears i didnt understand a single thing that was going on
I mean googling it brings up the same result and teaches you how to google your questions
really unlucky random chance idk
Third time you've asked. Answer is we don't know
nobody answered for 3 times so what am i supposed to do?
wait for someone to answer
i did
then wait
i did
go to the java discord to get help on generic java questions smh
your in the wrong server
ok
this is spigot-api not java
It's a basic java question. I'm going to give you the honest answer of 99% of people look at your code and think "looks fine to me guess I can't help"
I still can't figure out wtf they meant by "server version" I've been trying since I last said something
is it an imported package?
what MIENCRAFT version is your server in SMH
oh it's 1.18.1
I'm starting to not like you
Bruh you were in Here not 5s ago with the PDC throwing you in the ring
Don't throw rocks from glass houses
i throw rocks all the time
^
whats life without risk
how do i check which hand a player has selected in their client settings?
anyway what's my server version have to do with anything?
a lot
Can we throw rocks at glass houses?
I mean I just did so feel free to join me
for instance 1.8 code wont work with a 1.16 server

1.8 code could definitely work with a 1.16 server
..,.\


🤨
not if its NMS 
You mean I can't do my unmapped a.a.b(new c) calls in 1.8 ):
paper moment
5 dollars? Nitro give for free
smh fine ill spend more
huh, all this just started because I wanted to know how soccer could find the answer to the relationship between bow power and arrow speed, a 1:3 ratio
he said "IntellIJ
open random mc-project
write bow and use autocomplete to find the nms class "BowItem"
read the name "releaseUsing" and read "getPowerForTime"
then click the value.name and all other uses will show"
and it didn't work
because you only have spigot api
ok i just got nitro
if you use maven you can just add the non api instead of the api (which also includes the api)
LMAO
I dont use that method because sometime it doesnt show the current versión of the server
Sometime it only say running CraftBukkit/Spigot
we have the same role
ok I'll get maven
🤡
I don't need nitro to prove you wrong
smh
You can buy a bucket of icecream for 10$
You can buy a bucket of icecream for 10$
You can buy a bucket of icecream for 10$
You can buy a bucket of icecream for 10$
You can buy alchool that its more delicious



im sorry i cant hear you 



whisky for 5$ ^^
What kind of swill can you get for $5
the best ratio of drunk and efficient
Or some baijiu
like Stroh80
Stuff goes up to 140 i think
is there an event for when blocks get broken?
BlockBreakEvent
@spiral light okie I have maven, do I add a dependency in the pom file? is that how I get the same thing you got?
i guess if you add the right thing
yay
no
what
better #help-server
in code that would be something like class CustomBow extends Bow
well ok
myeh, doubt it
to some degree it makes sense to ask here
you want to use an custom item you created by extending a nms item to be define the texture ?
but just to 3°
That is impossible
i think that too
what are you doing?
the client dont know custom items you create
a texture pack
so the custom items?
and i want that a bow that have the custommodeldata of 1
have the texture of a fishing rod
ItemMeta#setCustomModelData
yes but
that should be possible
it is already in
wait lemme take a look at my pack
How would you check if a block is broken?
i have things like this
Blockbreakevent only happens when a player breaks a block...
Ohhh
Wait, then it wouldnt be broken
Cause only a player can break a block?
So is there an event for if a block changes to air or smthng?
i think there is a BlockChangeEvent
nah
so i would need only to change the overrides
BlockFromToEvent ^^
is that path referring to a json?
i think it needs to be in your models folder
nope
so the client looks there i guess
Only applies to liquids
so set a vanilla fishing rod file in your models folder (i think other packs do it the same way) and change your path obviously
for what do you need to track all blocks ?
Idk, im trying to help someone on the forums, i just asked them that lol
O.o
I made a bow that shoots a very tight grouping of 12 arrows, when I shoot at an entity and it hits, only one arrow will hit and the other 11 bounce backwards like they hit an enderman
does anyone know the explanation for this strange behavior?
@golden turret create a new fishing rod json file and set it in your resourcepack / models / somewhere and refer to that file instead of the vanilla fishing rod one, i think this will work
its not weird... its vanilla
why does it happen?
whenever you get dmg by something you have a specific time of no dmg
very interesting, thank you for explaining
you can set the nodamage-ticks to 0 after 1 hits if you want
entity # setNoDamageTicks(0) should work (maybe ?) you can also try to take a look at ProjectileHitEvent or EntityDamageEvent (maybe its just canceled)
If I cancel the creaturespawnevent if the entity type is instance of WanderingTrader, will that prevent wandering traders completely, or will it still allow the llamas to spawn?
Pretty sure they only spawn if the trader does
Thanks
I want to ask a question here, I want to do multiple BungeeCord setup, but I am currently stuck, trying to figure out how to do it so when you connect to the main Ip it sends me to the BungeeCord, and finally to the spigot server..
ports ?
wdym?
i think connecting to bungeserver needs another port then the actuall server
then read the docs and dont ask for help here ^^
Sheeesh so rude
ok I apologize.
i am absolutly sure you did not read them before asking here or at least you were google them xD
i am also sure that you will need different ports but i am not sure if you configured everything else right
Why would I care about another port?
as far as I am concerned, that is not the problem here.
#help-server Unless you are developing a plugin
I am developing this
I want a solution to a problem i have.,
which is if I redirect the player to a bungeecord, the bungee doesn't have his IP and has my load balancer one.
Ok so you want to have multiple BungeeCord instances with each instance linking to all minecraft servers?
yes.
Then you should use something like nginx reverse proxy setup with a round-robin configuration
I didn't get it..
One moment
alr
did you draw that ?
First of all let me ask you: Why do you want to have multiple BungeeCord servers running?
y
Chuckle I am in danger
I want to try to make something very, uhhh..... "hard" to get some experience with this type of things.
do you learn rly learn this if you need to ask something that difficulty ? xD
And pointless
There are a lot of things that you will need to tackle way earlier than handling several tens of thousand concurrent connections.
no only 5
"only"
There are a lot of different approaches to load balancing. Round robin is a primitive but often effective approach.
well I might as well ask, is there a way to do this in Java itself?
or maybe I'm dumb.
If you want to write your own proxy
That balances the load
On the different servers
can't be that hard.
Sure. You can do everything with java. But this will be really hard and time consuming.
Dont reinvent the wheel. There is SO much that can go wrong when forwarding connections.
Would be a fun summer break project, if you want to have smth pointless and hard
good
Because I would have an own programm, in front of all those bungees
Like a super bungee if I understand correctly
I would go for only 1 bungee, but I want a way to prevent "bot attacks"
But then you are better off learning Docker and Kubernetes for container orchestration, scaling and load balancing.
There are other things for that
I've tried anti bot attack plugins, all of them failed..
So your prevention is just to put more compute time into connection handling...
how would I do that
How can I set the attack speed of an item?
do i need a preparedstatement if i dont use like ::setString and such?
That was a sarcastic comment
How many connections from clients did you throw at the server?
or is it just optimized?
bru
attack speed is an attribute
Yeah but it adds it
i need to set it
like on swords
Where my answer?
2 Ways.
- Remove the default modifiers and replace them with yours
- Add a modifier that decreases the attackspeed based on the default speed (-100% would remove it all together)
only 4k/s
This is something your server host should handle
well it's incoming connections to join the server..
Most of them have that included
it is not a ddos attack
How do I remove the default modifiers?
the modifiers on swords dont seem to be in the nbt
Just add a cooldown and reject connections which occur too close to each other
what if I reject a person's actual client?
removeAttributeModifier(Attribute attribute)
The default modifiers get overwritten as soon as you add custom ones
Are there any dependency mirrors for the spigot API? The network I work on blocks spigotmc.org
Usually they block all non-mavencentral dependencies
Any idea how I can work around this?
what is that network ?
Im assuming that you use a shared remote repository and your maven profile is setup to use this remote repository?
Work, I wanna work on my plugin so my commute isn't a total waste of time but I can't get around some blacklisted domains
at my work i cant use discord ... but "sadly" they also provide guest wlan .... with (maybe?) no blacklisted domains 😄
Is the domain blacklisted or is your remote repo setup in a save way?
what kind of job blacklists discord? do jobs do that?
Not sure what you mean by the second part there but pretty sure it's blacklisted, I've never been able to get into the website so I wasn't surprised when maven failed to get spigot dependencies in the pom
I'm 17 I work a 17 year old job
hm just had a random question, if I later create a premium plugin but also put the premium plugin as say a patreon reward, am I not allowed to say that you can get it via patreon on the spigot page?
not adult job really
well... its an easy way to download junk that they dont want you to bring into the internal system xD
oh
Yeah cyber security is a major concern
Oof... You can try using a VPN or use a guest wlan.
Mm this might be too hard, I can't download VPN software either and I don't want to "try too hard" to circumvent their restrictions if you know what I mean (security breach = unemployed)
Was hoping there was just another spigot repo I could link
I have a weird problem, intellij only works on a more recent version of Java, like Java 16, but another app where I'm learning java needs java 8
you could just switch to an local storage or not ?
People aren't going to want to spend all that work going from spigot's site to patreon to then download it
Put spigot on a USB and put it in? Yeah that'd work, although is that maven/pom friendly? I've never just downloaded and dropped a jar into a project
Intellij even works for programming with Java 5.
But you dont need java 8. There is nothing you can do in 8 that you couldnt do on any predecessor.
got plenty of people to join me on patreon from spigot in the past so that hasn't really been an issue for me
my spiggot server doesn't though
should work flawless ^^ i always do that when making those stupid PR attempts xD
my question is if it's allowed or if it falls under promoting an alternative marketplace
my spiggot server needs like java 15 or higher I think
mvn install:install-file
You can install any jar you want into your local maven repo
Update Intellij to the latest version then
TMCbeans is the one who needs a more previous version of java
Yeah but you're going to lose customers. Plenty of people is survivorship bias. You don't know how much money you lost from users turned away from the idea of needing to sub on Patreon
Sweet, thanks guys :)
yeah I do, I lost 0 because my plugin is free
Well I'm not talking about free
I'm not asking if I can somehow make it so they can only get it on patreon, I'm asking if I make a premium plugin and I also have the download up on patreon if it's allowed to say that it is also available on there
bad idea tbh
people prefer paying once
than per month
i guess you are free to add licenses manually tho
from patreon
guys I unironically have a decently successful patreon already, stop trying to dissuade me from something that I am already doing alright in
Also allowed?
he couldnt post it on spigot
Why not? What did i miss on that front
exclusive = patreon only
no other way to get
posting on spigot would make it not exclusive
So much help development here
Yeah imo you'd lose out on too much potential revenue to bother with Patreon
And not enough dog pictures. What a world we live in huh
I keep asking about forum rules but keep getting bad financial advice instead
You go to a dev chat to talk about rules you're not going to get what you want
I can't go to dev chat to ask if I can post my dev stuff on spigot?
Magma afaik you’re not allowed to
Like some other devs have done it before
And well, it just didn’t end their way
If I'm dragging and dropping my spigot jar in, do I need a fat jar e.g. xxx-shaded.jar from https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/ ?
Hmm I was searching in my messy hdd
But can’t find em
Life is pain
Yup
because of the thing about promoting a different marketplace?
or is it a different rule
I believe so yeah
Wym?
If you use some ‘primeary’ build tool yes
But eventually you get something more keen and then you don’t need to depend on the shaded one
🥲
Yikes
What do you mean by primary build tools? I'm building a plugin with Maven but need to do it offline so need to download and link one of those files from spigot nexus I linked
Ah
One way would be to depend on the one which gets built into m2 repo by build tools as someone mentioned above
is there a thing like TimeUnit.SECONDS.sleep(seconds); but for spigot?
?scheduling
ty
Sorry, not sure what you mean here? I looked at my local .m2 and the folders for spigot just contain some .lastUpdated files. I'm just trying to find out which jar I need to download to build my plugin on the other offline machine.
my .gradle is 20gb.
You probably havent install
CafeBabe, you're Awesome
i Already knew that but it's Handy for new People
Its a bit easy. First of all you should download Spigot Build Tools. I recommend you to follow the spigot tutorial.
?buildtools
Build Tools will install the Spigot, Spigot-Api maven dependencias to local repo.
Of course you should told the build tools which versión do you want to install
Ohh actual spigot build tools, I thought he meant any build tool of which Maven is one
?bt
There you have
Yeah I know what spigot BuildTools is
Allrgiht
For programming spigot plugins you only have on remote repos the Spigot-Api
the MySQL connector driver is installed by default on Spigot, yeah? Because it's not very happy with me atm lol
Grrrrr java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/veinminer
I thought its boundled with Spigot. Havent used it in 2 years tho
Because Postgresql is a thing
The question is: What does veinminer need a DB for?
I'm saving player data. e.g. which categories they have disabled, which pattern they're using, which mode they have selected, etc.
I store with JSON currently, I'm just adding support for a few different options, including SQL
Just can't test at the moment because it won't let me connect to my localhost server! lmao
Did you Class.forName it
Is that a requirement for MySQL? o.O
I think there is some classloader thingy that gets triggered then
I believe technically not with recent versions, but that’s traditionally how you load jdbc drivers
Will give it a shot then I suppose
Oh nice github Shutdown my package maven repo. Where I had deployed the Spigot-Jar and Spigot-Api
Its amazing btww
I mean yeah ideally you don't host that anywhere
There's a reason why Spigot doesn't lol
And my account was Warned by github
ngl, genuinely surprised they did that though. That's the first I've heard of them doing that, meanwhile I know of a few repositories that literally have NMS in source
I once accidentally committed a Discord bot token to Github and within about 30 seconds Discord yelled at me 
Its amazing why i cannot host a private maven package for spigot
I have explained and send probs that its only used byke
But they didnt like
||codemc||
Adding this fixed it
Now I'm just getting a "access denied" which I can fix. tyty
I will definitly deploy it on a simple webserver.
How do I alphabetically sort an array of Plugin type?
It still needs to be the Plugin object in the end
Create a comparator that compares their name
So there's no method like Arrays.sort... sad, but thank you md_5
oh damn youre right
Arrays.sort(plugins, Comparator.comparing(Plugin::getName));
So this?
Probably
How do I trigger a custom sound when a player bumps into a specific block type?
So that all players can hear it
Well, all players that are close enough
Hellow.
How fix it?
ERROR]: Tried to load unrecognized recipe: crystal:commoncobblestone removed now.
ignore it, you had a plugin called Crystal that you removed
ow ty
Anyone know how I could fix this issue Caused by: java.lang.NoSuchMethodError: com.google.gson.JsonParser.parseString(Ljava/lang/String;)Lcom/google/gson/JsonElement;
Use spigots Gson version or if you shade in your own at least relocate
Alright thank you
sounds like a little bit of
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
send ur pom
Awesome, I left the toxic, dmca riddled DayZ modding universe for Minecraft, and it's the same here? Maybe I should stop messing with computers altogether and become a beet farmer in north east pennsylvania
don't use maven.
if I were to use PlayerInteractEvent, how would I get the name of the player I just clicked on?
your gradle config if you're using that then
I want to make a freeze block basically
its fine dw
alr
Oops wait no
that gets the user who used the block
:p
well you dont damage players
its for a practice server
p.getName()
im pretty sure he wants to do it if the player right clicks on a certain player
no so
Ah
The player you clicked
u want to code a freeze plugin lol
cringe
,
Thank you for your input
You could just freeze the closest player?
hmm that could fail
Does that apply to players? Probably
If not, a ray trace would work
declaration: package: org.bukkit.event.player, class: PlayerInteractAtEntityEvent
I am currently trying EntityDamageByBlockEvent
Just check if the entity type is player and continue
I'm pretty sure that applies to when blocks damage a player/entity
Like
Falling sand/gravel
Or magma
Yeah
p.sendMessage("Sem dinheiro");
return;
}else{
Main.getInstance().economy.withdrawPlayer(p.getName(), 5000.0);
p.sendMessage("Você reparou seu item");
}``` I'm using the SPIGOT 1.18 version. Why is not this working? Returns that Economy.GetBalance (P) is null.
Does build tools include plugin-annotations? If not, where can I get that jar?
It's on the Spigot Maven
oh god my brain
I can't rly code from my brain but I'll navigate you
Can I get the jar from here? I need to build my plugin offline
Entity clicked = e.getClickedEntity()
I mean you can download it from the Maven manually if you want...? It's not generally advisable to link to files over Maven though.
@mint mesa check the doc
Unless it's on maven central I've got no choice, spigotmc.org is blacklisted from the network I'll use
Or wait till tomorrow so I can help you
got this error
Could not find artifact org.spigotmc
jar:remapped-mojang:1.16.5-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
lolwtf
I don't think spigot is in ma en Central
It's not unfortunately :(
Afaik you build that yourself
what
java -jar BuildTools.jar --rev <your version> --remapped iirc
Spigot can't post mojangs code
they also can't post their mappings either
So it's not in repo
which I've never understood :)
Did you use --remapped flag?
yes
why post mojangs mappings when mojang posts mojangs mappings
Is maven local in your repo list
I useded this
in build tools
"C:\Program Files\AdoptOpenJDK\jdk-16.0.2\bin\java.exe" -jar BuildTools.jar --rev 1.16.5 --compile-if-changed --remapped
he could also be declaring the dependency wrong
Post your pom on paste
I changed now to 1.16.5
It doesn't matter
Sending the file doesn't embed the whole thing
I can't see it
Oh
mobile moment
Mobile haha
lol bitchass mobile user X D
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
u can still view the text on phone i just forget how
i think u just open it in external browser
So any one can tell what is wrong
besides the ungodly amount of spacing, no not rly
Do you have to declare maven local or its automatic?
I don't think most things are automatic with Maven
i would hope that maven searches maven local
Maven Central also isn't automatic in Gradle
unless u need to like <scope> it
The only automatic repo is the Gradle Plugin Portal lol
not expert on maven could you explain
https://stackoverflow.com/questions/33548395/how-do-i-force-maven-to-use-my-local-repository-rather-than-going-out-to-remote i think maven automagically tries maven local
Yeah
Lol that way of calling main class instance
Really strange
this
I never called the main class instance like that
Yeah it’s bukkits singleton design
Oh ok
A bit odd but it does the job 
Ah yeah
Do you normal use gradle?
Normally
The normal way should be called Dependency Injection?
Don’t use that fancy word on me
But you right
Passing it through a constructor
(:
He
I refer this:
MainClass instance
onEnable instance = this
MainClass getInstance
I do it like that
Hi conclure!
Does java have its own Emmet?
Greetings
?
Boilerplate generator
Idk
For example
What that means
div>p*5
Just noticed remapped jar is not builded from some reason
This makes div in html and 5 paragraphs in it
Don’t think so kacper
Sadd
Ye
Html is too powerful
and not sure why
Not sure either
Lol yeah
What r the options?
Everything
Java and Rust
@ivory sleet could you help my remaped jar is not created
I'd leave C and JavaScript
"C:\Program Files\AdoptOpenJDK\jdk-8.0.302.8-hotspot\bin\java.exe" -jar BuildTools.jar --rev 1.16.5 --remapped
oh dam
Google how to use nms 1.16 I guess
will do
is there a way to make an onPlayerLand event, other than checking PlayerMoveEvent a bunch?
Don't think so
I wouldn't use the moveevent
I'd just run a scheduled timer 😄
well do you only care about landing from high distances, or normal jumping too, etc?
what about using the isonground variable? check if they are on the ground right after they are in the air
have an if statement that triggeres everytime they're in the air that then checks for when they're back on the ground
normal jumping too
thats what im doing atm
i was wondering if there is a more efficient way
oh
ty tho
so just like every 5 ticks check whether the player is on the ground, and if they were previously in the air, then execute the event?
Yeah don't use is on ground
oh
Man it's like looking through a crack to understand whats going on with that lmfao
Does anyone have any knowledge of how getNearbyEntities works internally?
Does it it filter by chunk? Or is it just shorthand for a distance check?
Pretty sure it determines all chunks within the given range, then gets all entities in those chunks and filters them to which ones are actually within the radius
He's trying to protect his code from plagarism obviously 🙄
Most people who are scared of their own shadow don't get help here
is there any way to check what block the player is currently standing on with respect to how a player can be shifting over the edge of a block?
could you just use getBlock(player.getLocationX, player.getLocationY -1, player.getLocationZ)?
wait nvm I forgot about the shifting thing where you can be above another block
maybe do an if statement where if the block below the player is air it won't work?
im just trying to figure out a work around for the depreciation of Player.isOnGround()
maybe check if the y location of the player remains exactly the same after .001 seconds?
like player.getYLocation minus player.getYLocation after .001 seconds to check if they're on the ground
That's what I figured, thanks. Was thinking it had to be more optimized than just iterating through all entities in the world.
https://paste.md-5.net/atafubaful.rb
I dont see anything wrong at line 31 in my combatLog tick function
https://paste.md-5.net/afusugebol.cs
any help?
yeah?
my question ^
Ahh nvm
I dont see any other place/way I would remove them..?
Either use Iterator, or make a temporary list and remove them after you're done with the loop.
Iterator?
Si
I never figured how they works
oh so make a temp little list add them to that, then when the loop is done remove them from the list and blah blah and delete the list?
Yeah
You dont need to delete the list
An aproach I wont recommend saving player object if you dont need it
Its commonly used its uuid over the complete Player Object
well, its much easier, you suggest I save their uuid or ign and get that?
UUID
Pretty much never store IGNs
Name can change
It wouldn't, but just for good practice purposes save their UUID
Yeah
alr
I had some problems with tmp and saving James
imm go with the list approach, ty all very much
Your welcome sir
If you need more help just ask it here
You're gonna have to be a little more specific, you're trying to update a value in the config?
?paste
Already solvw
do not car still should paste big text
So you're trying to get something from the config?
edited, thanks
i respect ur change but if it was already solved.. 
So you want people change the location from yaml
Im back, still gives me the same error for line 38 https://paste.md-5.net/tarawukita.cs
how could i detect if the player is pulling a bow?
getItemInUse() is bow maybe
ConcurrentModificationException, youre reading from queue while also writing to it somewhere
Am I just stupid or is it hard to add support to a 1.18 plugin for 1.8 - 1.18?
Depends what you're doing
I mean, it's for a sort of mine plugin so I gotta sort out schematic and material stuff
I can't understand why people are stuck with such old versions when the newer ones are fine, but it'll get me a larger audience if I can get it to work on the older versions
how can I get the enchantment and level from Set<Enchantment>?
For loop?
PvP is the only reason 
I mean, there's plugins to replicate it...
Yeah I know, tell your audience that lol
I wish I could add the support myself but I'm not smart enough to do so
For people to drop 1.8 someone is gonna have to make a fabric mod that makes PvP look and feel exactly like 1.8
Which is pretty hard to do
Fabric? I don't trust that tbh
Ive used fabric for like 3 years
Whats wrong with Fabric
I don't even trust that lunar client
I trust Fabric over Lunar
same
I swear somethings gonna come out bad big time regarding lunar client
Like it was made to pull people in and it'll have something in the background
fabric is basically forge no?
Same concept, completely different softwares
well yeah but in functionality, its just fabric is more visual no?
Don't think so? Fabric is a full mod loader afaik
ah
But yeah, i wish I knew how to support older versions but hey I'll learn one day
No better time than the present
^^
I mean I think me getting myself into a mess has made it harder
also to this it doesnt show it correctly, i get this rn [Enchantment[minecraft:sharpness, DAMAGE_ALL]] But im not sure how to dynamically get each of the minecraft: effect
Call getKey()
Set<Enchantment> doesn't have getKey from what I can see
You need to iterate over it
for(Enchantment enchantment : enchantments) {
NamespacedKey key = enchantment.getKey();
}
You could also stream but idk what you're trying to do
im just trying to get all the enchants on an item
ah I feel stupid lmao
Thank you it now tells me minecraft:enchant, and I can just remove minecraft: with .replace
Could also call getKey again on the NamespaedKey 😄
I'm trying to make a plugin with two dependencies and one of them doesn't have a maven repository
how do I import it? tried following the steps here https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
am not happy to say it did not work
"build success" but really did not succeed. it's not a dependency and just threw two files around
You didn't add it as a dep or? I'm confused did you add it to the pom?
can you just tell me the code? i dont understand those docs..
AttributeModifier damage = new AttributeModifier(UUID.randomUUID(),
"generic.attackDamage",
70.0,
AttributeModifier.Operation.ADD_NUMBER,
EquipmentSlot.HAND);
item.getItemMeta().addAttributeModifier(damage);
Cannot resolve constructor 'AttributeModifier(java.util.UUID, java.lang.String, double, org.bukkit.attribute.AttributeModifier.Operation, org.bukkit.inventory.EquipmentSlot)'
Cannot resolve method 'addAttributeModifier' in 'ItemMeta'
anyone know why ...
I did and it can't find an artifact in the spigotmc repo
What command did you use to import it?
I used the install-file command as shown in the link I provided but it's still unavailable
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
install:install-file
yes
mvn install:install-file -Dfile=C:\Users\name\IdeaProjects\Rankup3\build\libs\Rankup-3.13.2.jar -DgroupId=okx-code -DartifactId=Rankup3 -Dversion=3 -Dpackaging=okx-code.Rankup3
What version are you using
1.12.2
and it shows up in your libraries?
No
Um well
if version is a problem how can i use it without change to higher version?
-Dpackaging=okx-code.Rankup3 this is wrong?
how?
You can use those.
Packaging is the type of packaging is it a war,jar etc
hmmm so how about add attribute ?
oh
addAttributeModifier seem not in 1.12.2 too
I set it to jar
so it now it looks like mvn install:install-file -Dfile=C:\Users\name\IdeaProjects\Rankup3\build\libs\Rankup-3.13.2.jar -DgroupId=okx-code -DartifactId=Rankup3 -Dversion=3 -Dpackaging=jar
ran it, "build success," nothing in the external libraries dropdown or in the maven dependencies in the maven menu
just tried a clean dependency install and still nothing
mvn clean install -U
So go to your dependencies
add
<dependency>
<groupId>okx-code</groupId>
<artifactId>Rankup3</artifactId>
<version>3</version>
</dependency>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<version>0.97.5.15</version>
<scope>provided</scope>
</dependency>
</dependencies>```
So add it there and see if it worked
okay it's listed as a dependency now, thank you
now I just need to figure out how to use a listener with it...
👍
Trying to get rid of the block so I did
block.setType(Material.AIR)
Isn't this how you do it?
how to break it
breakNaturally
breakNaturally is boolean
It returns a Boolean
I want if wheat grow, it breakNaturally
@EventHandler
public void onBlockGrow(BlockGrowEvent e) {
Block block = e.getBlock();
if (!(e.getBlock().getBlockData() instanceof Ageable)) return;
Ageable ageable = (Ageable) e.getNewState().getBlockData();
if (ageable.getAge() == ageable.getMaximumAge()) return;
block.breakNaturally();
}
so I did this but it wasnt broken just drop item
I've never used BlockGrowEvent, but have you tried cancelling the event? Or use a higher EventPriority?
You may have to wait a tick
oh it works thx
How can I make armor stand looking into specific location?
Vector
You should be able to calculate the vector between the two and then use setDirection
Vector dir = loc.toVector().subtract(armorStandLoc.toVector());
armorStandLoc.setDirection(dir);
i think
Can I somehow get the yaw?
I mean I'm trying to do this client-sided
So with craftbukkit method
you can prob get it from armorStandLoc at the end
Is there anyway to change a value and server.properties, and then applying it live? Specifically resource-pack. I found a way to save the URL to the file but not change the live string of it.
This is how i'm saving it currently
((CraftServer) Bukkit.getServer()).getServer().x.getProperties().X.setProperty("resource-pack", packURL);
So I am making a spigot plugin where im adding a custom item, I made the item but I still need a custom model or texture that cannot be obtained by a normal player(so that they cant cheat). I need this because I am making a crown that gives special abilities and I am using my base item as a netherite helmet. I want a custom texture so people can deffrienciate between to players with enchanted netherite helmets. (sorry for bad spelling)v
If you set a variable in the PDC you won't have to worry about players being able to cheat
You can set a custom texture with customModelData
ik
But that only works for the item, not the model when worn
yes, is there a way to get around that?
Optifine
Optifine
Or a ton of messing with core shaders
ok thank you!
Nah. Player's head is unique because it's the only place you can put a model (because head armor slot can accept other items besides helmets too)
So you can make "hats" that are shown. Done using a model you can create in Blockbench
(Which is 100% vanilla)
Wait really?
so I can make a crown
but instead of using a netherite_helmet I can use a pumpkin or somethign?
Nope
You can actually use any item
Any material
Just change it's model using custommodeldata
so i ur saying I can use a seed
ok you just endend my 2 hour cycle of watching useless youtube videos 😂
Let me know if you need any help
so do I have to set up a recourcepack?
Can you completely disable viewing spectator hotbar menu?
Yes
ok thx
This thread by the looks of it allows you to stop the teleportation
https://www.spigotmc.org/threads/prevent-players-in-spectator-mode-from-using-the-spectator-menu.121987/
Alternatively, depending on what you want to do, you may put the player in spectator mode, set the player to spectate an armorstand (and maybe? set the gamemode back to survival)
Or if you want the player to just fly around actually spectating - you could just make them invisible and enable survival flight
My goal is to make the player viewing entity's view with spectator mode and for the additional feature, the player cannot open the spectator hotbar menu.
Can you use pastebin instead of posting 3000 lines of text
That's nice
Paste your problem in there
Please
The error
Mostly
What's at line 51 in your "External" class?
this.plugin is null
Perhaps you're forgetting to set it
Did you read what I said, I'm sorry?
For you to use "this.plugin"
you must define it somewhere
as in "this.plugin = plugin"
It's not set, which causes that error
What's wrong with it? We're not here to debug your code for you.
I did but I was having a error with it not giving the message I had set to send, the only outstanding error that came through was Unhandled exception occured in onPacketSending(PacketEvent) and I wasn't sure why it occured
Have you tried logging and or debugging via a debugger?
Yes
No issues showed up
Just a build success in a few seconds
using the intellij debugger
What? Debuggers don't say build success
I selected the debug option in intellij and that's what was sent through the console
Debugging the build sequence isn't going to give you any info on whats wrong
You need to debug an active server thats running your plugin
or use a logger to log the different stages of your command/listener/etc
okay
ok so I made a resource pack and in my code, when creating the item i specified the customemodeldeta and wrote .setCustomModelData(123456); then I went to my recource pack and folder and in models i put my model with the item i wanted to replace and specified the custom model data in their as well. I feel like im missing something.
I can't
no not u
?
im just saying I join my server and it dosnt work
Okay, did you follow a guide for the model?
It has to first be put in a models folder
wait
Then you must create a json file that has the material as it's name
did that
then inside of that you put all of the custom model datas
{
"parent": "item/handheld",
"textures": {
"layer0": "item/bowl"
},
"overrides": [
{ "predicate": {"custom_model_data": 123456}, "model": "item/Crown"}
]
}
that is what is in my file
of the material
Everything looks correct
Are you sure that's the correct path to the model?
It must lead to a path inside assets/minecraft/models
And must be a json file
?
You could try enabling output log in your launcher
To see if there are any errors while loading the pack
Hey, Im trying to get my local debug server up in intelij, I got the server up and running but how do I get it add the plugin too ?
How can I make the totems give negative effects as you spend them?
Use EntityResurrectEvent
X D
I assume it just makes a plugin folder? So you'd just put it in there like a normal server? 
is it a good practice to use dependency injection just for the plugins logger?
no
well kinda but not fullt
I know that, but that they give you effects as you spend them? example: totem number 9 gives you poison 3
So... check the totem? Not really sure what you're asking.
I've never made a debug server, but the files have to be somewhere, the world can't just not have any files 
Could inject the code live 😉
But why 
as I explain, example: you spend the first totem and it does not give you anything, a normal totem. but the totem 2 when spending it gives you Poison 1
I don't know if I explain myself :P
You'll have to keep track of that yourself, probably using PDC would be the best way.
whats pdc stand for
Persistent Data Container
not if ur on fun fun 1.8
is this how to execute multipe queries after each other?
Well that's also not supported so 
I'd use 1.18 if notch was still at minecraft
Hi. I'm writing a plugin in Kotlin, and for some reason, I am getting a org.bukkit.command.CommandException caused by java.lang.NoClassDefFoundError caused by java.lang.ClassNotFoundException. In my onEnable, where I do this.getcommand.setexecutor, am I doing something wrong?
class Arena : JavaPlugin() {
companion object {
var plugin: Arena? = null
private set
}
val arenaPlayerManager = ArenaPlayerManager()
override fun onEnable() {
plugin = this
this.getCommand("arenalistplayerjobs")?.setExecutor(ListPlayerJobsCommand())
}
}
class ListPlayerJobsCommand() : CommandExecutor {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
plugin!!.arenaPlayerManager.getPlayerJobsMap().forEach {
sender.sendMessage(it.key.name + " is a " + it.value.name)
}
return true
}
}
after he left the code went to shit
do you know any kotlin ?
That's not a reason to stay on 1.8 though smh
yes, it is
Im still a beginner, but I think I got the basics down
it went from 1gb sometimes to 5 gb doing nothing
Yes
or like that transaction you said
Transaction, as i said before.
Or, if you wanna insert multiple rows in the same table, batches
these are all table, database creations
You dont have to create a database manually. A user should create it and judt provide you access
why are you using companion obj ?
I looked up how to create static variables in Kotlin and apparently that's a way to do it. I have no clue what it does though
oh
simpler to do something like:
lateinit var jp: JavaPlugin
class Whatever : JavaPlugin(){
override onEnable(){
jp = this
}
}
fun getI():JavaPlugin(){
return jp}```
if you put methods outside of the class, they are similar to what we have in java with static methods
Or use a companion object perhaps?
as far as im aware
na, why'd you do that. those are less nice
Oooooo okay thanks for this (: do you think my code, specifically in regards to handling commands, is a good translation of what I should be doing in Java? I'm not sure why I'm getting an exception
at least in my opinion
tf is this
kotlin ?
Well if you annotate with JvmStatic ofc but anyhow
LMAO
Smh just dont do singletones
and finally what does this do again?
getConfig().options().copyDefaults(true);
The code you showed is probably something you want to avoid.
I don't lmao, I havent in 6 months now
not really, it's the same just no need to write ClassName.whatever
anyways Im not a super expert so rely on them
Actually if you really want a singleton in kotlin, companion objects are overkill, simply an object class is enough
also true
