#help-development
1 messages · Page 1814 of 1
iirc an anti cheat used to have a crash command and had to remove it
I know this is a stupid direction for many, but what would be the non nbt way of doing this please.
CraftLadder bRot = (CraftLadder) blok.getState().getBlockData();
In order to get the getFacing() method.
Search the javadocs for facing
so cast the block's state to Directional?
anyone know if spigot will load a plugin automatically (from the plugins folder) if it has already been loaded manually?
h?
Yes
What do you mean
ty
If I've loaded a plugin using Bukkit.getPluginManager().loadPlugin(myJar) before the plugin loads, will bukkit try to load it again anyways, like it usually does?
Load it again when
When the server loads all its plugins
For some reason, I was getting an NPE because some stupid class loaded before my main plugin loaded and tried to get the instance
I don't think so, if you have 2 copies of the same jar it wont load both if they both register with the same name
So I did this?JAVA public static Plugin getInstance(){ if(instance == null){ File thisJar = new File(PATH); try{ return Bukkit.getPluginManager().loadPlugin(thisJar); }catch(InvalidPluginException | InvalidDescriptionException e){ e.printStackTrace(); return null; } }else return instance; }
I suspect that mechanism would stop it
you might want to assign the instance that you return 😅
also soft depend is a thing
yeah, whoops
nah, because of complications I couldn't use softdepend
the class loading was kind of unreliable and I had no idea what caused it
But I'm gonna try this, hopefully it works
making a module loader for a plugin?
i'd like to associate all the source codes of the server in BuildTools directory to my spigot dependency so that investigations on game details will become easier.
could someone tell is this doable?
Sure, just import the maven into eclipse and run from that
ty!
how can i hide all item flags
ItemStack#addItemFlags(ItemFlag.HIDE_ATTRIBUTES)
check vanilla flags
would that work?
(Material.DIAMOND_SWORD.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)) ?
mc wiki
Nah you add it to the item meta
uhh
also it's gotta actually be an item
not just a material
So, to construct an item: new ItemStack(Material.DIAMOND_SWORD)
An ItemStack is an actual item; a Material is just an item type
To get ItemMeta (what you're trying to modify): ItemMeta meta = yourItem.getItemMeta();
And .addItemFlags() is under ItemMeta
So you would use meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)
uhh, don't think that's what you should do?
ItemFlags is the spigot way to do it I'm pretty sure
if (item == null) return null;
ItemMeta meta = item.getItemMeta();
if (meta == null) {
return item;
}
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
meta.addItemFlags(ItemFlag.HIDE_DESTROYS);
meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
item.setItemMeta(meta);
return item;
}```
?
Yep!
i think meta never gonna be null?
You can also use .hasItemMeta() to check if the item has meta
nah
Air has null meta
air is item..?
Yes
Some of the block exclusive materials don’t have an ItemMeta I believe
True
Also, to add all item flags, you can use ItemFlag.values()
But they shouldn’t be an itemstack in the first place
So meta.addItemFlags(ItemFlag.values()) would probably be better
(values() returns all values in an enum, which is what ItemFlag is)
or wait
actually whatever i just realized there might be non--hiding item flags
lol
Can you explicitly pass an array to varargs?
yep
Nice

it says Missing artifact org.spigotmc:spigot:jar:1.17-R0.1-SNAPSHOT D:
run buildtools
i've run BuildTools already.
oof, it is 1.17.1. 😮
you got 1.17 in your pom instead of 1.17.1
:3
Some people really do use 1.17.0
some even use 1.7.10...
well, sadly, it seems there're still no sources attached to the dependency.
if you're using spigot: it has no docs. add spigot-api as well
this is what i'm trying to do.
NMS of course has no docs at all
How do I stop rendering the scoreboard?
docs no need. source attachment is good enough.
idk what you mean with source attachment sorry
but you can easily view the decompiled source of any class
e.g. CTRL+B in IntelliJ
did you choose those poor variable names yourself or is that some kind of decompiled code from another plugin @proud basin?
?
It's a class made by mojang
i'm running in eclipse. however if it's doable in intellij, it should do in eclipse too.
There's no class called GuilnGame in mojang mappings
This isn't a server jar
I still don't understand what you're trying to do
client jar
why would you want to mess with client classes when developing a plugin?
It's not a plugin
oh okay, maybe you should seek some help on another discord then. this channel is for spigot development
No it's not
It is, read the channel description
yeah okay but you won't get any answer here probably
Don't know where else I would go
I can't recall
Forge would yell at me for using mixins
Worth a try here though, you never know someone may be smart
I just wanted to point out that this channel was supposed to be for spigot dev questions, even when the descriptions might suggest otherwise. Most of the people here probably never looked at the client code
in eclipse, when sources are attached, their class names, methods or fields become available to be searched. also u can check their declarations from codes invokes them.
if it's so easy you wouldn't be asking here. As said, probably noone here knows. And tbh I still think you at least have a typo in "GuilnGame" because that doesn'T sound like any name someone would name a class like
I might be wrong though ofc
Go to fabric
Or a genetic mod dev discord like MC Ideas Academy
I feel like they would yell at me too Coll
for real? can't eclipse decompile it itself? IntelliJ can easily do so with Ctrl+B
noone is yelling at you
So instead of going to a fabric/forge discord for client side stuff you came here expecting to get more answers? 
yes
No you need a plugin for that
I'm just pointing out that a discord that's about server software isn't the right place if you seek for help regarding client things
true, but probably indeed noone here knows. that's all I wanted to say 😛
True, but you're definitely going to have more luck in one of those other Discords.
I almost got banned from forge for asking a question...
and it was because I was using mixins
they don't like it
there's probably a bit more to that story lol
no
then I can't help
good luck though
eclipse only decompiles when u try to access the class' declaration itself.
it won't collect any internal informations of a class if there'no sources attached.
that's... bad
All I can say is that IntelliJ handles it fine
might be a time to switch 😛
if you're using maven or gradle, switching is a no-brainer
Are you trying to fix a bug in the server
If not surely this is unnecessary
There are javadocs for the api
?jd
no, just trying to understand some game logic details.
Spigot source doesn't have all classes anyway
It only has about 600 out of like 3000
that should be enough for me actually 🙂
I doubt you would get banned there for asking questions
i would say that's reasonable.
decompiling for all classes takes a lot of resources and the result is different from the sources. for example it loses the docs.
it is not necessary if u already have the sources.
maybe I misunderstood what you're talking about
I just wanted to say you can select any classname in IntelliJ and have it decompiled immediately. It does not decompile all your dependencies at once if that's what you're talking about
then how would the ide know if some certain fields, methods or classes are invoked by it?
it doesn't, as said I misunderstood your question
however you could just decompile the whole .jar and then open that in your IDE or sth?
that's fabric I said forge
ugh no. that was the forge discord
Wrong Discord. Lol
CurseForge and Forge aren't the same thing
^
wait
Lul
you want to tell me that curseforge = fabric?
No, thats also different

bully
client mods are the worst thing ever lol
it's truely a work around, but no docs make me feel a little bad 🤷♂️
20 different projects, 30 different websites lol
What
It's great practice though
There’s like 2
They'd be alright if they had literally any documentation at all
Forge and fabric
Curseforge and modrinth
Forge's documentation is "ok here's how to install. goodluck idiot"
yeah and when you google "forge discord" you end up at "curseforge" discord which apperently has nothing to do with forge according to the messages above
Doesn't help that they have basically the same logo too
ikr?
it's like someone making a project called "cursespigot" with a spigot as logo and then getting upset when people confuse both
and the different name^^
and the fact that paper includes 100% of spigot
or lets say 99%
but yeah I really dont understand all those forks anyway
if they think they can do stuff better, why dont they create PRs instead of getting their own fork
yeah of course
I'm fine with paper and spigot
everything else will be gone in 2 years anyway I guess
Whys that
just speaking out of what I've seen
I might be wrong, time will tell
anyway I doubt that any real large server will use some obscure fork that just came up and might be gone next year
but that's a bit offtopic anyway
90% of servers are on spigot or paper
you know what would be good
if we had a server that wouldnt rely on stupid bukkit code
That’s called fabric
and it sucks
Yeah, but people are lazy
I disagree strongly on the fact that bukkit should not be used in favor of fabric
yeah pretty much, 86% according to bstats 🙂
Fabric doesn’t have anywhere near the same API equivalent as Bukkit
Maybe one day it will
the rest are some forks that will be gone in some years
TacoSpigot 
i really wish hybrid server impl would die
for example 😄
What like, Sponge?
no
yeah fuck mohist
Idk what that is
mohist tries to unify bukkit and some other API
but its bugged like hell
in one version it didnt even call PlayerDeathEvent when a player dies
I got soooo many bug reports
until I finally found out it's a mohist issue
Idk man they have a cool animation that disagrees with you

lmao
they create a new Player object every time the player dies
whoever has the need to put things like "solid code" or "Code grade A++" into the README has shitty code
which is stupid
??
idk if its true, but if it is: very stupid
Yeah that's stupid af
going to sleep, have a nice day everyone 🙂
You too 
it is
if u go onto essentialsx
they made an public announcement abt it
Ohhhhh yeah I remember seeing that now
yeah they say "DONT USE MOHIST" lol
anyone know what the alternative to Material.isTransparent is?
and I agree on that
why do you need an alternative for that
getting player that player is looking @
dont want them looking thru walls
What's wrong with isTransparent though
World#rayTraceEntities
But idk why you need alternative
What's wrong with the method
It is deprecated for some reason
I figured it out all by myself
HA
@Inject(method = "renderScoreboard", at = @At(value = "INVOKE"), cancellable = true)
private void renderScoreboard(CallbackInfo ci) {
ci.cancel();
}
``` here yall go
i have an enchantment that conflicts with mending
when i add mending to an item with the custom enchantment, it doesnt work because it conflicts (which should happen)
but when i do it the other way around it does work
how can i fix this
Use addUnsafeEnchantment
nice, i found a good way to solve this for windows eclipse users.
use mklink /J to create a symbolic link of Spigot-Server\src\main\java in Spigot-API\src\main. name this link whatever u like.
then specify Spigot-API\src\main as source attachment folder of spigot dependency in eclipse. it'll automatically searches subfolders as sources.
sponge
i notice the server will check and move the spawn location to avoid choking.
while (avoidSuffocation && !worldserver1.getCubes(entityplayer1) && entityplayer1.locY() < (double) worldserver1.getMaxBuildHeight()) {
entityplayer1.setPosition(entityplayer1.locX(), entityplayer1.locY() + 1.0D, entityplayer1.locZ());
}
do we have sth similar in the api?
private void sendServer(Player player, String server) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
try {
dataOutputStream.writeUTF("connect");
dataOutputStream.writeUTF(server);
} catch (IOException e) {
e.printStackTrace();
}
player.sendPluginMessage(this.getServer(), "bungeecord", byteArrayOutputStream.toByteArray());
}
my player does not support "sendPluginMessage"
is there a way to rewrite that? or write a function that does that? im not using spigot/bukkit but still need the functionality
ping me !
limbo
im looking for the sendPluginMessage definition but cant find it
What is limbo?
low power afk server
Gl getting help with that
im pretty sure the function can be rewritten
public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message);
/**
* Gets a set containing all the Plugin Channels that this client is
* listening on.
*
* @return Set containing all the channels that this client may accept.
*/
@NotNull
public Set<String> getListeningPluginChannels();
thats the only thing i found...
So i got a question, I save a deserialized itemstack in a config and i noticed from 1.17 to 1.18 that a variable in it changed and was wondering what it even is. My plugin compares the itemstack someone has to the one saved in the config and it isnt working properly because of the different variable. The variable in question is just called v, Here is a piece of the config for reference
itemstack:
v: 2730 (1.18 changed it to 2860)
type: DIAMOND_SWORD
meta:
==: ItemMeta
meta-type: UNSPECIFIC
Damage: 2
I don't think that should affect
equality / comparisons
It does. I changed the number to the new one and tested it and it worked. Before it was saying it wasn’t the right item
Hi you don't know of any good boss or pet plugins?
When making a bungee/spigot plugin, do you guys normally recommend one uber jar or one for the proxy and one for the servers?
spigot
Hmm. Not sure if that can be changed but could be worth a bug report to track at least.
Don't know about any plugins for pets? Please?
my friend said that the entity hurt method does not full kb. Is this true?
im using it for a pvp plugin thats why
Banned from Google, son?
Well have you tried it?
no but my friend and I saw it
ok i dont really take kb
Why banned from Google
lmao
Because it seems like you are unable to make an extremely simple Google query for spigot pet plugins.
Use Bing, yields better results👌
about org.bukkit.HeightMap.WORLD_SURFACE_WG, what's the meaning of "for worldgen"?
Is this helpful?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/HeightMap.html#WORLD_SURFACE_WG
declaration: package: org.bukkit, enum: HeightMap
well, no.
i think i got the "for worldgen" words just from the docs.
Suggests that a world generator may have a different highest non-air block
not rly asking for a spoonfeed
but if anyone knows a cool resource for generating nice spheres like worldedit's
id like to know
too many ugly/inefficient methods out there 😦
So I have a lot of files that I need to copy to the plugin's directory while also maintaining the directory structure. Is there a quick way to do this? I know #saveResource() exists, but is there a better way to do it than a bunch of save statements?
You could get your plugin file dynamically and then extract it like a normal zip file
Wdym by dynamically?
saveResource is teh most efficient
I guess when your plugin version changes, your filename does too, so you should hardcore your filename
I think the Api of the JavaPlugin has a method for that
Did some quick searching about saveResource and haven't found a way to bulk copy without just writing it for each file. Which I really don't want to do. That'll be over 300 lines of what is essentially bullshit.
you don;t need to type every file, you can package search programatically
Can you give an example?
specify the root source and programatically extract everything in that package
Ok, but what would I use to extract everything?
saveResource
it would probably be around 10 lines of code
I can help you with it in about 30 minutes if you can't do it. Morning ablutions first.
Probably will need some help, but yea, the idea is to just use a for loop, but how can I specify that root source. It would be nice if there was a method built in that gives the default resource path, but I'm currently unaware of anything that can give that. Or any other way to access internal jar resources.
Ok made a bug report, For now ill just update the values in my code when its loading the itemshops so they still work
just to get clear, you are using getItemStack, right?
whats FAWE?
Fast Async World Edit
I am comparing the itemstacks themselves with the itemstack from the config being serialized. Here is my code
private ItemStack checkPlayerHasItem(Player player, Shop shop) {
ItemStack item = shop.getItemStack();
if(player.getInventory().containsAtLeast(item, shop.getAmount())) {
ItemStack[] items = player.getInventory().getContents();
for(ItemStack invitem : items) {
if(invitem == null) continue;
if(invitem.getType().equals(item.getType())) {
ItemStack sellitem = invitem.clone();
sellitem.setAmount(shop.getAmount());
if(sellitem.equals(item))
return sellitem;
}
}
}
return null;
}```
Yes how did you deserialize
ItemStack.deserialize((Map<String, Object>) map.get("itemstack"));```
hello there I have a for loop that start like this:
for (String shop: ShopUtil.ccShop.get().getKeys(false))
{
it loops inside shops in "normal" order from first to last element in the array. Can someone help me on a proper way to do the loop in reverse? from last to first element?
If ccShop.get() returns a list, you could copy it to a new list, reverse it with Collections#reversed() and then iterate over that. Ofc, that all depends on what the #get() method returns.
I think you'd have to regardless, that get() method might return an immutable object in which case, copying is the only thing you can really do.
humm maybe i can try reversing the data from the list when it's created at it's origin.. will be better
i tried looking at worldedir and it was just layers of stuff
simple solution would be just to use worldedit but i kinda want to learn
? FAWE is just a faster version of the normal WorldEdit, most of it's commands are the same.
is it made by someone else i didnt know
ill look now ty
Spigot Page: https://www.spigotmc.org/resources/fast-async-worldedit.13932/
Downloads Page: https://ci.athion.net/job/FastAsyncWorldEdit-1.17/
ty
@eternal oxide You still around? I still need some help with these files.
does anyone know how i could start with world gen? (NOTE: i'm pretty basic in java and spigot)
yep, I'm just looking at it now
Bet
looks like it’s the same as w.e in terms of region selection
It's quite literally a drop in replacement. 😛
wym
FAWE was created because normal WorldEdit
- Blocks the main thread when performing tasks.
- Only works on the main thread, making it painfully slow to work with when dealing with larger operations
- Missing basic features past 1.12 (tab completion, better message formatting, etc)
FAWE does the exact same thing as normal WorldEdit, but does it better.
It's multithreaded, works with world files directly, and is easier to work with.
@quaint mantle
Anyone knows something about the Biome-Noise that is new in Minecraft 1.18 ? It allows the biome selection by 7 different values - but it will not work with custom collections of biomes :/ I think somewhere it needs to be registered
@quaint mantle FAWE is to WorldEdit as PlotSquared is to PlotMe, both are better because they offer more and innovate on the base ideas of their original.
i see
idk i guess my struggle is idk how they make such perfect circle shapes
if i could see the maths or how they do it i could learn but im pretty lost when reading it all
Well, are you trying to create one in game or replicate the functionality in a plugin?
i want to generate sphere around a location in game
so ye plugin i guess
dont rly wanna import it though
as id rather learn from this
Well there is a sphere command. You can get the usage by typing //sphere, but it's pretty straight forward. //sphere <materal> <size>. The actual syntax may differ, but iirc, that's one way to do it.
There is also an //hsphere command which will create a hollow sphere.
Ah, well looks like you will either have to replicate the functionality yourself or call upon the API to create one. (If it has such functionality)
Automate how?
game starts
generate random water orbs
to jump and parkour in
at random centers
anyone?
I'd recommend looking into both the WorldEdit api and FAWE api to see if one of them has a method available to create spheres.
just tested it by using a command to save the item in the config so its forsure the right item then had it check it with my function and it worked then changed the v in the config to how it is in 1.17 and tested it again and getInventory().containsAtLeast() is returning false. And i used getItemStack this time
^
i have this tutorial on bukkit.fandom.com about making world gen in bukkit, would it work if i use the spigot api or do i need to like import something
Only spigot API suffices
btw
you probably should get the config info on enable
then store them
then use them
Just note that it was written before the material rewrite so it may not Work 100%
That it is enough to only have the spigot api
oh so i can?
but it doesnt matter that much so u can get ur stuff working then u do that
Well, technically you only need bukkit API but you cannot get it nowadays, so you'd want to use spigot-api
wait i think i understand, bukkit is the default and then spigot adds everything bukkit has but changes it?
did i get that right
Yes
oh, so i can use bukkit anyway
Though spigot is the default, you cannot get bukkit in 1.16+
ok
And If we are talking about bukkit.org bukkit (which is the Bukkit the guide was originally made for), it does not exist since 2014 or so
ok i still need help with the world gen, this tutorial is outdated (literally the first method they said to put has something deprecated)
Why is it deprecated? Perhaps the docs suggest an alternative
this wiki page is in progress anyway
Also, you might want to try datapacks instead
idk how to do datapacks
It aint, it hasnt Bern updated in years now
The Future is datapacks though, you cannot really stay with worldgen Plugins forever
is it bad to use the same dependency for the spigot api in 2 plugins?
like the same file
Huh? Like shading a 3rd Party depend in two Plugins or depending on the same plugin?
If it is Just something Compiler time, no
i have the spigot api jar file in my dependency folder, i'm currently using it for a plugin, but i just made a new one. should i use the same jar file for it or should i make a new one for just that plugin
I recommend using maven or gradle. But No, Not an issue to Point to the same jar .... For now
i use maven
but the default thingie doesn't have everything
so i need to import the BuildTools spigot api into my modules tab or whatever
How would I go about cancelling placing of blocks from my custom ItemStack. They open GUI:s so i dont want them to get placed when right clicked.
Check if the item they are holding is a custom item that meets criteria. You can do this in a number of ways:
- Check it item name and lore is the same
- Custom NBT
- PersistentDataContainer
- LocalizedName (Quick and dirty, pretty sure this isn't supposed to be use for this though)
then every blockplaceevent
check the pdc
if it contains the pdc
then cancel it
When i try to do "event.setCancelled(true);", i get a bunch of errors in console
and the block gets placed anyway
You listening for the BlockPlaceEvent?
Can i send pastebin links here?
Yes
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.
@eternal oxide Any luck? Or do you think I should post this to the forums? Cause I'm still not finding anything useful for it.
I'm not having any luck doing it simply
I'm a total noob to java development, I got started yesterday so dont judge my poor skills ;)
Yikes, why isn't there something for this. lol
anyone had experience with pulling players to a center? trying to make it require as much force as is required instead of going overkill
i.e if player is 7 blocks away, pull them 7 blocks in, if theyre only 3, just whatevers required for 3
@quiet heron What's your console errors?
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.
?learnjava when
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
oh wait thats the old one
Well I have a hunch the new one might suffer from this as well.
java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.bukkit.inventory.ItemStack.getItemMeta()" is null
Second line in your error. You need to add a null check for itemmeta
if (itemStack.getItemMeta() == null) {
return
}
Hold up, with the new one i dont get any errors in console, the block just places
anyone know how to cancel swimming?
(i tried player.setSwimming(false) and it does not work)
@quiet heron You might be able to get away with ItemStack#isSimilar() for your comparison. Instead of event.getItemInHand() == (ItemManager.pct) you should try event.getItemInMainHand().isSimilar(ItemManager.pct)
why would you?
they want that pre 1.13 swimming 😎
Can't imagine.
imagine.... 1.8x - 1.18x
imagine 1.19
welp i mean they are right
they can cause client issue with pre 1.13 if they support that
My programming class just ended but ill get back to it once i get home…
@quaint mantle try setting sprinting to false instead of swimming, got a hunch that might do what ur trying to do
nvm it turns out
pretty much client sided
im pre sure
like even if i cancel it which i did, they swim just as fast even tho it doesnt look proper to other ppl
just gotta figure out how to make the velocity apropriate
anyone? pls
no we cant? welp you might need to look at spigot api, apis in spigotmc resources, or create one urself with nms
i recommend this
https://www.spigotmc.org/resources/worldgeneratorapi.77976/
1.17 only btw
@eternal oxide Posted it on the forums, hopefully someone knows a way to get it working properly.
uhhh
@eternal oxide Appreciate the help though.
Class.class.getResource("*.txt")
wonder if that will work lol
wait
just read ur post again
guess you will need to do that urself :sadge:
or look at other resources?
I've been searching for a while for posts about it. Not aware of any other plugin that do this. Most of them use databases for it, which I will eventually add, but I want a stable file system that can act as a backup or just by default. Allows end users to not have to worry about database setup if they don't want/need it.
Can't post/copy link but search for AdvancedWorldCreatorAPI.... Made an 1.18 update that allows you a lot of customisation since it uses the default Bukkit-WoeldCreator-just some small modifications
Is there a way to prevent entities from collided and pushed back?
Like each Entity's Mass?
LivingEntity#setCollidable should work.
Thanks :)
thanks, but i would like to make my own plugin without using an api (other than spigot api ofc) for the world gen part
Hi, is there any reason, to store BukkitTask instead of BukkitRunnable, when all the methods on BukkitTask after on BukkitRunnable as well?
You can copy my code / what is your goal world you want to create ?
my goal is to make a moon-like world with craters, and paint it with some blocks, and also change the blocks used for the craters
i want it to be like simple perlin noise generation that is quite flat and keeps on close to a y level
the craters would make the ground go up a little in a curve in the shape of a rough circle, and then go down and center
Then go and learn java + spigot
just gonna ignore you
Sorry we wouldnt spoonfeed you
there is no way to access the default minecraft world generator
if you want to modify existent terrian i recommend the api
i don't want the default one, i wanna make my own one
okay
you can use simplex noise
included with bukkit
and for craters use world decorators
i don't even know where to start, can you explain this to me or send me a known article about it?
Weong
Wrong
what
im recommending something
how is that wrong lol
that doesnt even make sense language wise
No about no way to edit vanilla one
hi guys, i'd like to know after which event a new player will be considered hasPlayedBefore?
probably after login
might be discarded when the server is force terminated tho
without /stop
how do i stop them from joining before their data being stored?
Maybe try the AsyncPlayerPreLoginEvent
Spigot is used to run bukkit plugins right ? If I wanted to learn plugin programming I should learn bukkit ?
You should learn Java first. That way you will have a far greater understanding of how the Spigot API works.
I already know java and java OOP that's why I am here asking
still a junior developer though to be honest
Oh, well in that case, they only thing you need to learn is the Spigot API.
I haven't learnt bukkit but since spigot builds on top of bukkit it really doesn't matter
Yeah just go with the spigot api
Spigot is an extension on the bukkit api
https://hub.spigotmc.org/javadocs/bukkit/ This the right api for this ?
Yes
googling "how to do x on spigot" usually gets you far enough if you click on spigot forums links for simple stuff
https://hub.spigotmc.org/javadocs/spigot/index.html @quaint mantle
package index
👍 thank you
but the real challenge is to break your problem down to what you actually want to do, like googling I want to make an auctionhouse plugin will ofc not work
i made a rough sketch
(i didn't do the craters here though)
but, something like "How to schedule a task 20 ticks later" will
I'm planning to go to uni and get a licence in cs so don't worry about that, the objective is to learn while applying myself and using logic and solving problems, while making a project
license?
sorry more like masters degree
@quaint mantle Keep in mind that you can always ask people for help with your problems here and on the forums. Spigot Plugin Development is the dev help section you would want to post in.
Ah you going for masters?
Is this where I go for help?
ya
Development help yea
plugin dev help yes
have checked that. its phase might be too early for me.
i'm gonna do sth to the spawn location of new players. in some cases i need to kick them out.
You can take a read at this https://www.spigotmc.org/wiki/creating-a-config-file/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Thanks
What is the best way for backwards/forwards compatability? Do I have to package the plugin for Every Version I wish to support? Or is it poosible to support multiple Versions in one jar?
do sth to the spawn
sth?
Yeah... I'm to stupid
Which part are you stuck with?
I have the following in my main class.
saveDefaultConfig(); // Most likely want this part since this is the one that copies the default config.yml over.
config.options().copyDefaults(true);
Two ways exist. Reflection and Abstraction.
Reflection works decently well for some things, but may not work long term. It relies on fields not changing names for a long time.
Abstraction gives you more control, but you have to keep up with dependencies and learn the differences between versions. (Could have difficulty making backwards support if things are not well documented)
As for which is better, I'm in the Abstraction camp. However, both have their use cases.
So I basically create a wrapper for every API call I need and switch to the fitting implementation on Runtime?
Better yet: don't use any API which does not honor SemVer
Or you create one interface for certain tasks (item creation, packets, chat, etc) and load whichever one is needed for what version the server is running.
depends on if you are using NMS
would you recommend a recent version of the api or an older version to learn it ? since it goes from 1.10 to 1.18 apparently
Learn the most recent
latest ofc
start with 1.2
It will be easier as things that exist in it might not in older versions.
Makes your life easier
i mean something
I'm studying .yml by watching this tutorial. Why am I getting these errors?
https://www.spigotmc.org/threads/yaml-configuration-tutorial.444987/
A tutorial on how to do this async exists here:
https://www.spigotmc.org/threads/async-yaml-file-configuration-tutorial.474385/
Introduction
In this...
I simply copied the world creation and with generatorsettingsbase and Dimensionsmanager you can modify it ... Or copy the complete nms chunkgenerstor class ... That was how I did it for 1.17
instance is what you are supposed to replace with an instance of your main class.
yes very simple, clean and convenient
you either renamed the parameter, are not in the scope or don't even have it
JavaPlugin#saveResource
But it worked ... Best think would be if the API adds finally the new world creator stuff I made in a PR
Well there are only two other events you can try: PlayerLoginEvent PlayerJoinEvent
is there any other way of moving blocks smoothly instead of using armor stand ,falling block and shulker. (the players should be able to stand on that blocks )
Just search for Bukkit world creator and if you know smth about java und the API you will easy understand this
I'm planning to create my own mine generating area as part of a feature in my core plugin. I have in my head 3 for loops to handle x, y and z blocks and I might create a block in that 3D space. However i'm a little concerned to performance and other issues that may arise with this plan. Any suggestions on how I should go? (It will be handled in a separate async thread)
Could anyone help? Whats name of PacketPlayOutEntityMetadata in remapped-mojang?
There is no something like ClientboundEntityMetadata
ClientboundSetEntityDataPacket
Do I even have to do that on very Simple plugins? My Plugin basically only runs a command when a player leaves... And thats it.
Right, thanks ❤️🔥
is there a good waay to check if player is touching water?
i tried this;
if (ploc.subtract(0,1,0).getBlock().getType() == Material.WATER | ploc.subtract(0,0,0).getBlock().getType() == Material.WATER)
and it sucks
I'd like to check if player is touching water anyhow
No, not on simple plugins. You would only have to do something like that if you are dealing with something that the spigot api doesn't already support or doesn't have enough support for. Things like item creation are pretty straight forward using the default api, however if you were using modern 1.18+ items and wanted to support backwards, you would need something in place to prevent errors from being thrown on 1.17 servers that say "Hey, that material isn't found".
Isn't there Entity#isInWater
no idea, lmme chheck
pretty sure that method exists
there is ...
So on a simple plugin like that I just compile against the oldest API my code supports and spigot does the rest?
testing...
https://timcloud.ddns.net/mapping/ is for 1.18 and for everything .... Has a little search function for stuff like you want to know ...
for support older versions and new, legacy is checking if plugin running under >= 1.13 and the plugin is compiled in 1.16+ so its support 1.7-1.18
thanks it works
example
You have already gived that, so big page, lagging. Also white finder in right corner seems dont work
BoundingBox of the player and increase it a little bit ... Then check every block inside the corners of the bounding box
Yes. You would actually be compiling against the newest api and it would support back to whenever the api call was added to the game.
IIRC, good title support wasn't added to the api until 1.11. So when I was making a plugin for 1.9 and 1.10 I created a Title class that would handle sending the title and subtitle packets to players. Then 1.11 came along and added a nice little method called #sendTitle() and it nullified the need for my abstraction classes.
Works if page is loaded completely with enter ... Page needs to be big for that amount of data 🤔 I don't have laggs there
I think it was lagging 2 days ago because of my 9302839347324 opened chrome pages about maven
@iron vector Ultimately, you are going to want to test your plugin on every version you want to support. Best part of making multi-version support is you get to choose which versions you want to support. Don't let people force you into supporting versions that will make your life harder. I see plugins that still support 1.8 even though they also support 1.18. Not sure if they fully capable of backwards compatibility, depends on featureset, but at a point, it might become a bit much to support large version gaps.
Exactly ... I don't support old versions because it's too much work and many stuff happens in nms so for each version a new class sucks too
I know... But I have a REALLY simple plugin, and I wanted cross version compatability on a small scale first.
Take 1.8 API and test it in every version ...
Well what does it do? Because if you are doing something really simple, it will probably work on older versions out of the box.
What that could really tell? Marked pom? All works, but 1.17 contains crossed out pom
Logic same as another modules
@iron vector Second question, what versions do you want to support with your plugin?
Only difference is spigot version and java version (16 for 1.17)
What does the simulation-distance in server.properties in 1.18 refer to? I set the viewdistance to 5 and the simulation distance to 10, but I still can only see the chunk with a radius of 5
Simulation distance is a new feature that gives you control over how close one needs to be to certain things in order for them to animate properly. Things like mobs, water, redstone will stop working and freeze if players are outside of the range. This is a performance setting.
In your case, it's working as intended. Players can only see 5 chunks in front of them, but things are likely happening 10 chunks out from them.
Not fully decided yet, I have heard that it is way easier with 1.10+ so Ill stay there for now.
Well, again, what are you wanting to achieve with your plugin? I might be able to give you some advice on which things you will need to abstract.
Also, 1.10 is a little old. I'm not sure of many people still running it. According to bstats, 1.10 isn't even being run anymore.
Ofc this only applies to servers that have metrics enabled, but a good place to check every once in a while.
The current "Project" is allowing to use a plugin that stops the server a while after the last player left. It compiles fine with the oldest spigot api I could find in the maven. It only needs like Playercount and support for the player join and player quit event.
Oh, yea, those api calls have been in since the beginning. Don't even need to worry about abstraction as it will support all versions that people are playing right now.
Hell you could do that in one class if you really wanted to.
OK. The plugin.yml contains an API-Version. What should I put there
it is lol I REALLY wanted a simple plugin to start experimenting with cross version
You will want to put in the latest version of the game.
Functional programming pog
And Spigot just realises Well, this plugin is from 10 Minor versions in the future, idc lets run it?
api-version was added in 1.13 due to all the material names turning into strings from ids. If you don't put it in or put something invalid, the plugin will still work, it's just that the server will enable legacy item support which isn't ideal.
That's because spigot is mostly forwards compatible.
Ok. I dont need that then.
For shits and giggles: Is there a spigot API for pre 1.8 minecraft? Those dont seem to be on the maven repo....
I don't think they have anything older than 1.8. In the old days, craftbukkit reigned supreme and everyone developed for that. It got DMCA'ed and everyone flocked to Spigot. Spigot is based off of craftbukkit, but there aren't any jars you can readily download due to the DMCA takedown. You might be able to compile it yourself with BuildTools, but I'm not 100% sure about the really old versions.
Ill try that later....
Yea, BuildTools only goes back to 1.8. There might be a way to get 1.7 files, but I'm not aware nor interested in finding them.
There is no good way of getting 1.7 or older files
hmm i want to do a private chat toggle but i don't have any code idea someone help
Hey I have a quick question about attribute modifers. I try to change the attack speed of a sword in the ItemMeta with an attribute modifier. Unfortunately, based on what I found on the Internet, I still don't understand how it actually works or how I have to specify everything there. Anyone who happens to be able to help me with an example?
Listen to chat event cancel it and resend your own messages
Or have fun with chat packets
There's a Conversation API available. I don't think it will block out the entire chat, but it will ensure you are talking to the right person.
What file/files am I meant to download in /repositories/snapshots/org/spigotmc/spigot-api to get started ?
Are you using maven?
If you aren't you can use the spigot.jar file created by BuildTools. You just have to add it as a dependency.
If you're using maven, it'll download the files automatically once you configure your pom.xml.
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>
If you aren't using or don't want to use the remapped version, your dependency would be this instead.
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
.
trying to download the dependences through intellij but doesn't seem to be working, probably just ide issue
No
You may want to press that to force update any dependencies you've added to the pom.
?scheduling
If I dont have the api of a version in maven, can I just compile against the server jar for that version?
The bukkit server jar of course
Or spigot that is
Not sure I fully understand. Can you explain a bit more?
On the webpage of spigot, I can download versions back to 1.4.7. But the Maven-Repo stops around 1.8. If I want to compile a Plugin for 1.4.7, can I just use that spigot jar as dependancy?
Unlikely
Is there a way to delete a resource from spigot?
Report it asking for such
Report your resource and in the field just say that you want it deleted.
does spigot 1.18 api require jdk 17 ?
I was using 11, have to install 17
lmao everyone who know how to make toggle staff chat help me
Have you heard about booleans?
Spigot doesn't have a page where you can download spigot jars. What you're looking at is unofficial and bad
^
Yeah xD
Hello, I am developing a plugin for 1.8.8 that can change a player's skin to one from a preset enum of skins. Everything is working fine, but when the skin gets refreshed it applies for like half a second and then turns back normal as how it was before the change... I haven't found anything on spigot or anywhere about this issue... Could someone please help me with this? Thanks.
Here's the code I use to change the skin:
public static void setSkin(Player player, SkinEnum skin){
String texture = skin.getTexture();
String signature = skin.getSignature();
CraftPlayer craftPlayer = (CraftPlayer) player;
Bukkit.getOnlinePlayers().forEach(o -> { ((CraftPlayer)o).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle())); });
craftPlayer.getHandle().getProfile().getProperties().removeAll("textures");
craftPlayer.getHandle().getProfile().getProperties().put("textures", new Property("textures", texture, signature));
Bukkit.getOnlinePlayers().forEach(o -> {((CraftPlayer)o).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) player).getHandle()));});
Bukkit.getScheduler().runTaskLater(PluginMain.getInstance(), () -> Bukkit.getOnlinePlayers().forEach(o -> o.hidePlayer(player)), 0);
Bukkit.getScheduler().runTaskLater(PluginMain.getInstance(), () -> Bukkit.getOnlinePlayers().forEach(o -> o.showPlayer(player)), 15);
craftPlayer.getHandle().playerConnection.sendPacket(new PacketPlayOutRespawn(craftPlayer.getHandle().getWorld().worldProvider.getDimension(), craftPlayer.getHandle().getWorld().getDifficulty(), craftPlayer.getHandle().getWorld().getWorldData().getType(), WorldSettings.EnumGamemode.valueOf(craftPlayer.getGameMode().toString())));
craftPlayer.getHandle().playerConnection.teleport(new Location(player.getWorld(),craftPlayer.getHandle().locX, craftPlayer.getHandle().locY, craftPlayer.getHandle().locZ, craftPlayer.getHandle().yaw, craftPlayer.getHandle().pitch));
PalermoSkinMap.put(player.getUniqueId(), skin);
}
NMS is generally unsupported
Is your server in online or offline mode?
In normal online mode. But I might be using it also on a server with offline mode in future.
same with 1.8
I don't know, I have nms, server and everything downloaded only for 1.8.8 :F
Is there a reason, why you use 1.8? Instead of 1.18?
or like 1.13+
Yeah
It does
I just need to make it 1.8. It is not really my option. Thats why I need your help :P I've already made this on 1.18 before and worked. Only here it doesnt work.
The server is pvp-aimed and isnt mine, I just dev stuff.
I mentioned earlier that I need to have the plugin for 1.8... I am just trying to make the plugin work thats all I need from you guys. :P
It worked for alot of people before so I can make it work too.
although you are on your own
Try to remove Bukkit hide
And show
Or just try to do just the skin part
Independently
I have commented ( // ) everything else, now im gonna try it :P
Alright
If I rejoin the server with the account... the skin changes back too.. it does the same thing. I can show you a footage of how it looks
This is how it looks when I try it (doesnt matter if I hide the player or show or anything else) https://www.youtube.com/watch?v=sQKsPQY8k-g
Change skin
Use the thread please
anyone know how to make simple world gen?
I have a Java Library, thats basically a jar with static public useful functions on my local drive, how can i import that using maven? And yes, i googled a lot and those stupid forums dont help, caus ewhenever someone got it right, they didnt thought it would be cool to share their solution
does your jar have its own pom to build it?
Its a standard plugin, like ^. I thought it would be "easy" to make your plugininto a library, but ...
does it have a pom to build it?
It has a pom.xml, yes, both have one
Becasue thats what plugins have and i wanna mention bukkit code in my lib
mvn deploy:deploy-file -DpomFile=file:///path/to/yourproject/repo/pom -Dfile=mylib-1.0.jar
however, if it has its own pom you could just run install
So thats for the pom.xml? Doesnt the pom.xml only contain additional packages for the source code? I hate Java... Anyways, thanks ill try that
your pom contains all teh info needed to build your plugin
you usually run clean package
if you run install it will add it to yoru local maven repo
Ty
mvn deploy:deploy-file -DpomFile=file:///C:/.../IdeaProjects/SulfuriumLib/pom.xml -Dfile=file:///C:/.../IdeaProjects/SulfuriumLib/target/SulfuriumLib-1.0.jar
just throws an error The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid
Thats the usage of using a file
So whats DFile? The builded file?
I need to add the url param according to the error and the maven docs
Soo... the guy with the backward Compatibility questions is back xD
When running my Plugin, I get (via Reflection since the API changed a while back) the PlayerList (getServer().getOnlinePlayers()).
The Problem is, that earlier versions returned an Array, while the recent versions return a Collection of Players.
Now I tried to convert the Player Collection to an Array, but I can't cast the Array returned by java.util.Collection.toArray() (the instance method) to org.bukkit.Player, bc the Runtime Type is org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.
But I don't know how that is possible, since its a Collection<org.bukkit.entity.Player>, so those two have to be related to each other.
Any Idea how I could convert a [Lorg.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer to [Lorg.bukkti.entity.Player?
teh repo should be local
Whats even a repo? I HATE MAVEN ALL THIS BULLS* MAN I JUST WANT MY F * JAR TO BE ACCESSED IN MY F* PLUGIN WHO EVVEN WROTE THAT S* THAT THERE IS NO PROPER WAY OF DOING THIS FOR IDOTS LIKE ME
Sounds like you need a break to calm down
I tried this S* for two days straight
All you need to do in run mvn install in the first project. Then in the second project put info from first project as a dependency
I have no idea what you are actually trying to do but im guessing you want to add a jar as dependency.```xml
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/path/to/jarFile</systemPath>
</dependency>
Don't use this
Maven might not like it, but for now that works
Use what Elgar said instead of that
Yes, i need a repo. There i need complicated S* like nexus or so, that brings me back to the beginning
You don't need a repo for local projects
Maven will use the local repo on your system. No need to add one to project pom
your local repo would be (probably) c:\Users\%USER%\.m2
Im a bit stupid, how would the exact command look like? with my normal IntelliJ project?
mvn install
^
May I ask what version you were on?
Because it hasn’t been an array for a very long time
@chrome beacon and @eternal oxide You helped me such much, thanks! 🏅 <-- Medal
Equally important, it’s a Collection<? extends Player> (type parameter is not just Player) which makes it a bit complicated.
Get org.bukkit.entity.Player Array from the Player Collection
Does Entity implementation object after death goes stale?
for example i spawn an entity
It varies
with #World.spawnEntity()
does it get stale after death
or is it safe to store this
But most entities can be considered "stale" post death
However this is not the case for Player implementation
I thought like this too, it wouldnt make sense to create EntityHuman object all over again
So yes to answer your question, it’s probably unwise to store it after its death
Is it possible to inject renderScoreboard to modify RED?
yup
modify RED?
Yea
not sure what are you talking xd
How would I force people to be put into adventure mode if they arent? Basically an IF statement if a player is in a different gamemode then adventure
blablabla
if (IsGamemode) != Adventure
{
Player.Gamemode set minecraft:gamemode.Adventure
}
else
{
return null;
}
Something like that
well in principle you could just set their gamemode to be adventure whenever it changes
declaration: package: org.bukkit.event.player, class: PlayerGameModeChangeEvent
or use the forcegamemode in server properties
Yes, however thatt doesnt work for some reason
RED is the numbers beside the scoreboard
- It puts me into adventure every single time I join, i'm trying to make it so that when you have a certain permission it doesnt affect you
these are named Objective values for me
ahhh this.. i think this is client-side not sure if texturepack or custom client can modify this
Objective values can be changed, but not their appearance (chat formatting wouldnt work)
I have no idea how to set up permissions like this though, is there a doc on it
?
just
if(player.hasPermission("urpermission"){
// do stuff
}
ok this is different for the pseudo code you post... you can check when player join.. check permission and set the gamemode... you need check https://hub.spigotmc.org/javadocs/spigot/index.html?overview-summary.html for the player methods
package index
lol
I know, that code was an example of a way I thought about so it would show you what I meant you know?
btw im on 1.17.1 not 1.18. I dont know if that changes anything in this case
for what you need 1.18 not make any changes in what you need...
Sorry, I think we're having a missunderstanding
for check permission you have Player#hasPermission(String) and then you can set the adventure mode if the player not has X permission...
for when you can make this.. you can listener the join player https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerJoinEvent.html
declaration: package: org.bukkit.event.player, class: PlayerJoinEvent
is the spigot repo down? im getting a DependencyResolutionException
when trying to mvn install
Hmm works for me
hm
Failed to execute goal on project API: Could not resolve dependencies for project me.outsparkled.eframemining:API:jar:1.0: Failed to collect dependencies at org.spigotmc:spigot-api:jar:1.8.8-R0.1-SNAPSHOT -> net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT: Failed to read artifact descriptor for net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT: Failure to find net.md-5:bungeecord-parent:pom:1.8-20160221.214544-128 in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]
loading for me
Tried invalidating caches?
ima try that
Yuh, it usually solves some issues I experienced with gradle from time to time at least
I understood that permission part. How would I create the permission ?
Would simply
Player#hasPermission(ringitem.excludegamemode) Create the permission itself?
as string
not.. i mean not sure how you want add the permission.. for example you want if the player HAS special item for bypass the adventuremode then more than permission you can check if the player has the item... based in your comment
Hmm lvj is your project on GitHub or something? I guess I could try cloning it and see if I get the same issue
make a ACTION in github for test if they can build xd
its a commission and i dont want to get into trouble so idk if that's possible but thanks for the offer
...what? I mean like like how for example worldedit handles it worldedit.wand. A permission like that
yeah but how you add that permission to player? you are using a plugin for this like LuckPerms?
Ah alr nw
Yes I am.
ima check if i can build another project
andd that worked
bruh
might actually run bt again
ok if you use luckperms then you can use the method Player#hasPermission("customperms.canByPassAdventure") you can edit this permission in LuckPerms (user/group)
I know. Thank you 🙂
Hey, look like spigotmc software are having zero day exploit: https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-3201
Hey guys I'm developing a core plugin and I have a few questions about spigot and bungee working together. Please don't be harsh it's my first time ever using bungee. My project structure is as follows:
core-api - Contains API for external plugins to interact with
core-common - Contains common code between the different implementation modules
core-bukkit - Bukkit implementation of common/api
core-bungee - Bungee stuff? Not sure what this will have in it yet...
core-distribution - Just a pom file, shades everything together
- Right now my setup is to shade everything into an uber jar file, is this common practice? Or do you guys normally create separate jars for each platform?
- When would I ever register a command through bungeecord, rather than bukkit?
- What would be the best way to share context between the bungee module and the implementation modules? I've seen the plugin messaging platform and redis used, just wondering which you guys recommend.
Thanks
It could cause remote code execution exploit
well mostly plugins are the only real way of using it
and they already have full control pretty much
Apparently # is an illegal character
its .
i use # for what i make in docs xd
- fine, but i'd make 2 separate jars to make it less fat
- idk, denends on context?
- abstract out stuff and have implementations for spigot and bungee
ah
-
I've seen both been done. It's up to you.
-
Bukkit commands can only be registered in server not bungee
-
You can use redis but for smaller things the plugin messaging channel works
Also I get this Cannot resolve method 'hasPermission' in 'RingItem' However, when I create it. Nothing happens
What's the code in the method when you create it
Alright, thanks guys
Nothing
Im just using the quick fix from IntellIJ since I have no idea how to work with Java for the most things hehe
Well ofc it's going to do nothing then ;/
?learnjava Time for this
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
why does ur method have 1
As for the issue use hasPermission on an object that can have one
I dont want to learn the entirety of Java. I'm just trying to make a force gamemode thingy ;-;
@slim cairn so you dont want to be a developer?
Woudlnt that be the player?
Yeah
Not necessarily, no.
so you want to?
If you wanted to, but you dont have to since you're not spoonfeeding me.
it wouldnt take more than 5 minutes lol
Again, its your choice
Im just making a server for me and my friends and I'm trying to force them into adventure, thats litterally all 🙂
Minecraft 1.18 added the minecraft option Online > Allow Server Listings <On/Off>. This seems like a privacy thing. What does that mean exactly and should Plugin Devs respect that option?
what version
1.17.1
Spig
make it paper
If your minecraft version is remotely recent, you can use minecraft config files for that
Like stated before, that doesnt work ;-;
Not in my opinion. I prefer working with Spigot. I also already have a code around it so I'm just trying to make this thing fit into it
spigot plugins work in paper
paper plugins dont work in spigot
only affect in the ping info...
i make the PR for adapt this in CB... when the players are listing in ping info if the user has this on then in ping info show a "anon user"
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/server/ServerListPingEvent.html
declaration: package: org.bukkit.event.server, class: ServerListPingEvent
I already have a lot of other plugins okay, I'm not trying to change everythint right now in the heat of the moment
Server.properties: gamemode=adventure force-gamemode=true
doesnt work? Maybe you changed the gamerule for that?
im talking about making ur server paper, it will be able to understand both spigot and paper plugins
Legit what I did
oh okay
that wouldnt ask for permissions
i think
2Hex no need to glorify paper here
No thanks, I prefer keeping my server on Spigot if that isnt A problem.
not doing that
sorry if u cant notice "imo" in the conversation
Well, yes?
ringitem.excludegamemode if the player doesnt have this and they arent in survival they will be put into adventure
So you would only behave differently, if you for example added Playernames to the MOTD? Basically one would sanitize the Player from every List one can get without joining?
reason its ringitem is because thats my overall plugin name
Basically I'm trying to combine it with a different plugin ya know
what if they have ringitem.excludegamemode but are not in survival
in teory, this configs are only for the PING info.. this not affect other things like scoreboards/chats if you wanna see most specific how work this you can check the commit where this is added in craftbukkit https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/3b214b5a2163630a6d0413a4629310a66ab52dba
then it forces them into adventure mode
wait no
If they have the permission it simply doesnt do anything
cool
ill dm u the plugin
u can decompile it if u want
thats literally 90% of the code lol
@EventHandler
public void onModeChange(PlayerGameModeChangeEvent event) {
if (event.getPlayer().hasPermission("ringitem.excludegamemode")) return;
event.getPlayer().setGameMode(GameMode.ADVENTURE);
}```
Solved, if you have a problem you can say it here
Not necessarily an issue, however it does state Method 'onModeChange(org.bukkit.event.player.PlayerGameModeChangeEvent)' is never used
Just ignore it?
yeah
yes, ignore it.
