#help-development
1 messages Β· Page 1563 of 1
you can just compare /data get entity @p SelectedItem or something like this
I think that should print the NBT of the item
things like custom model data would also be stored there
welp there you go
thanks there is a clue
can i change entity rotation in spawner? I need it because happens this
https://imgur.com/wMvaHEy
how would i teleport a player to another player???
Player#teleport
huh
like
like player.teleport
read java&spigot docs, dude
?jd
hey so i have npc villagers i place on onEnable, and remove by their uuid on onDisable but when i wakeu up and the server's been running for a while the villagers are duplicated, where one villager is the npc and the others turned back to normal villagers (because they still exist but my eventhandlers aren't checking for their uuid on interactions anymore)
don't wake up
does anyone know a best way of having persistent npc villagers? i tried giving them a persistentdatacontainer tag thing where i'd kill every entity with that tag, tests worked but i just woke up and found out that didn't do the trick (so basically sometimes the onDisable doesnt load (part where it kills the villagers) and the onEnable does run (the part where i place them down)
honestly the best way is to use packets and not have anything server side
onDisable only runs on a clean shutdown
but that's also hard
okay so i just reloaded the server and my code does work (to remove all entities with that tag) so maybe it's because the ondisable method where i remove the npcs can't detect them because they're in unloaded chunks??
reloaded the server
i could switch over to packets for that, but is there anything i could watch out for before switching to that method?
for npcs just use citizens api lol
well its not so much about having a solution, but also for me to experience these kind of things and trying to solve them
i might do that but it'll be when im desperate and there's no other solution
Set SkullMeta of item
and?
Set the skull owner to which head you want
How can i set the value?
setOwner
I think i don't know what i mean
relatable
What are you trying to say?
He wants a player head
I mean a custom head value like this:
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTI0YmExOWMyM2JhNDU0NzQxZGEyYTE0MjMxMWFhZjRhOTE4ZmMyYjY4Mjk3YmViYzEyNTk0Mjc1ZjU0YzU3OSJ9fX0=
NMS it is then
create a game profile and set the texture property
How can i create a game profile?
nms has no java docs
using authlib
is correct?
Yeah premade libraries or look around NMS and figure it out
cache the field
Ew spoon feeding
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
But yeah you need to cache that
?
Try it and see?
what name should I write in depends: [...] in plugin.yml in JDA API?
depends: [nuVotifier, JDA] ? depends: [nuVotifier, ..
Also, error occurs when I enable
java.lang.NoClassDefFoundError: net/dv8tion/jda/api/entities/MessageChannel
It's a depend
JDA is not loaded on server
And?
yeah
It's not a plugin
oh yes but doing this asks me the message to put and I do not understand what I have to put
You must have the jda files in your plugin
ohh
also in plugin folder?
Remove scope from your dependencys
Am i doing right?
public static void createItemWithNBT(Inventory inv, int invSlot, String texture, String displayName, String... loreString) {
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
ItemStack Item = new ItemStack(Material.PLAYER_HEAD, 1);
List<String> Lore = color(Arrays.asList(loreString));
SkullMeta Meta = (SkullMeta) Item.getItemMeta();
profile.getProperties().put("textures", new Property("textures", texture));
try {
Field profileField = Meta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(Meta, profile);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
Meta.setOwner(String.valueOf(profile));
Meta.setDisplayName(Utils.color(displayName));
Meta.setLore(Lore);
Item.setItemMeta(Meta);
inv.setItem(invSlot - 1, Item);
}```
hmmmmm maybe it sounds like odd,
but how to add file to my plugin
I already added depend in my plugin
Are you using maven?
Don't do that. JDA is not a plugin
.jar depend
Then instead of asking if itβs right, ask what you should put lol. Did you check the javadocs?
idk but when I download from maven, it says ERror"no file were downloaded"
Can someone tell me if this is correct or not
Yeah I just did
yeah but if you call that method a lot then your server will lag to shit
you don't need to resolve profileField each time
only do it once and you can use it on all other skullmeta instances
the namespace is your plugin
dunno what RecipeUtil is
Okay thanks for help!
declaration: package: org.bukkit, class: NamespacedKey
Represents a String based key which consists of two components - a namespace and a key. Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.
where is
?jd
Any1 knows where's this msg on Bungee SRC We were unable to connect it to the primary or backup server. Try it again later.
No
yes
SRC = Source code.
ohh

and i'm pretty sure it's a configured string
Hello, I having java.lang.NoClassDefFoundError: net/dv8tion/jda/api/entities/MessageChannel error. how to fix it? I added depend like:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.3.0_295</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
<artifactId>opus-java</artifactId>
</exclusion>
</exclusions>
</dependency>
</plugin>
</plugins>
</build>
</project>
use the maven shade plugin to shade jda into to your jar
Nope
I already saw that XD
uh i don't think so
You're not shading JDA
Most like a packet exception
oh I realized
I should shade
also, it was a little bit error in pom.xml
<modelVersion>4.0.0</modelVersion> invaild content was found...
I want to π¦ but there is no spigot pom.xml tutorials
I saw the thread that says "you should use <plugins>, ``<plugin>` tag to use depend
ohhhh
maven is a build system to build your jar and has nothing to do with the depends section of your plugion.yml
What does rank weight do? I noticed it when adding perms for my plugin
so it doesn't have anything to do with other plugins?
Most plugins won't care
ok, good to know
thanks u but I have problem
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>ν ν μλ²νλ¬κ·ΈμΈ</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.3.0</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
<artifactId>opus-java</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>``` no erros on tags
but
you odn't even have the maven compiler pluign
in here, <groupId>net.dv8tion</groupId> it says Dependcy net.dv8tion:4.3.0 not found
Yes, I'll install after this
idk if jda is on maven central but if it isnt then you need to specify the repo
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - DV8FromTheWorld/JDA
it is now
not
**
ahh!
by default maven only looks at maven central
well it shows you exactly hwo to includ eit there
Have you tried clicking the link above and reading?
yeah I'm already looking this xD https://github.com/DV8FromTheWorld/JDA#download
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - DV8FromTheWorld/JDA
but
You can basically just copy and paste, change version and done
yeah. but it says "dpendcy net...... not found"
yeahhh
<artifactId>JDA</artifactId>
<version>4.3.0</version>```
errors on net.dv8tion, JDA, 4.3.0
did you add the repo
i feel like we are going around in circles here
and that you need to do some reading on how maven works
I'm sorry, I was going to do it earlier, but I gave up because everything went wrong. I'll try again.
oh uh where should I put
it
everywhere is error
you probably did not put it in <repositories> tags
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>``` hmmm nop
then you need to put it in <repositories> tags
ahhhhhhhhhhhhhhhh
mb
I'm small brain
i'm so tired so I read repositories to repository
lol
u need both
<repositories>
<repository>
.... info here
</repository>
</repositories>
thanks you every1 btw
if ur using spigot u should technically already have a repositories tag if im not mistaken
I'm using jar depend π
mm ic
don't do that if you're using maven
yeah
you use maven for a reason and this is one of them
using maven = hunting down either source code and compiling or hunting down repo and dependency info
You can install jars directly
it's spigot
Yes but thatβs still using maven
sorry for saying that, but there is still errors on <groupId>net.dv8tion</groupId> <artifactId>JDA</artifactId> <version>4.3.0</version>
and if there isnt a dependency and/or repo for it then u can use the jar with maven
u'll define the scope as system and provide a path
show your full pom.xml
Yes ofc it is... I never said it wasn't
sure!
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>plname</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.3.0</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
<artifactId>opus-java</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>```
Now shade plugin
hmmm
Since you need to include JDA
before that, I think we should solve the error
shade wont do anything just yet until the dependency is actually found right?
or does it
the error will be resolved when you reimport maven
olivo arent u usually in pink π§
I was pink for one month with gifted nitro
to do this if ur in intellij go to maven at the top right corner and click it, then press the little reload icon
or u can right click pom.xml > maven > reload maven project
π
sorry bishop as i was typing i was like i'll turn off pings for this reply as soon as im done then i hit enter for both and i was like wait
idrc about pings
ya know, i still have a nitro code from a puzzle nobody was able to complete
yoo
how can I reimport?
when I write mvn clean install
in terminal
it makes error
(I installed mvn already)
whats the error
oh wait nvm
the current latest version of JDA is 4.3.0_295 according to their github
(Not a batch file...)
sorry for saying that, after reload, still error on here π¦
I have a bug and its pissing me off
do you need screnee?
Oh no ;(
is it JDA?
is that the error?
depend not found
change the version to 4.3.0_295
wait in 1.8 when i shoot a snowball at somebody it just goes right thru them why????
im trying to make a custom item
with snowballs
but its not working
sorry for saying taht, still same π¦
did u reload
heyo all! Could someone help wit solving this? https://www.spigotmc.org/threads/replace-original-item-with-own-modifications-nms.515090/
W
thanks you everyone
wait in 1.8 when i shoot a snowball at somebody it just goes right thru them why????
im trying to make a custom item
with snowballs
but its not working
so now, I should install shade tool
NMS is not really supported and what you're trying to do is very unsafe. I recommend creating a patch instead. (Or work around the can break with packets)
patching the worst solution, about safety that's true, i'm sure there is way like this to change block breaking time
i spend 2 days on this
spigot contains 0 good solutions
so i started work around staff like that
Just write your own system that breaks the block after mined a certain amount of time
patching the worst solution
Why worst? Because splitting for each mini-game jars is the most unprofessional thing, i guess
PacketPlayInBlockDig basically can solve it, ye
but creating per-each player when he is trying to break block, i guess it can produce some unpleasant staff
i also tried to interrupt in block dig packet but i didn't found any variables which is basically current block damage (As i looked deeper, damage is client-side fully on 1.12.2)
It's there
I gave up installing maven shade plugin
cuz there is <version> error
and I digged it for 20min+
and I can't do it
Well time to stop using JDA then
so how can I add jar to my plugin
ohhh
NOO
but can I add jar myself?
Well technically you could but it's harder than just using maven (iirc)
is it possible to define more than 1 variable with the return of a function, i want to remake the classic check for inv clicks
event.setCancelled(true);
final ItemStack clickedItem = event.getCurrentItem();
if (clickedItem == null || clickedItem.getType().isAir()) return;
//gets data
final Player player = (Player) event.getWhoClicked();
final UUID id = player.getUniqueId();```
my idea was something like
``final ItemStack clickedItem, final Player player, final UUID id = new GetDataFromInvClick(event, kitInvForRemove)``
and the function would return those values in that order
well, I think just I need to right-click project and add file
This error is pissing me off and idk how to fix it. I can screenshare. Please someone who can help me with this. Its like a wrong java version but I dont know what to do π
i just used jda with maven like last week and it worked fine, so whatever you're doing is wrong @quaint mantle
tuples
In here,<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <configuration> <!-- put your configurations here --> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
errors on here: 3.2.4
in <version>
whats the exact error
You're compiling with Java 16 and running server with Java 15 (?)
Plugin 'org.apache.maven.plugins:maven-shade-plugin:3.2.4' not found
idk how to check that
only in <version>
did you reload the maven project so it can download it?
Yeah it's that
yup
So how do I update my server to java 16
Are you using a host?
im using my PC
Install Java 16 at https://adoptopenjdk.net/?variant=openjdk16&jvmVariant=hotspot
imma go make a new project and set it up rn
ok
thanks you
can I go to bed?
it's 1:25 am
Or set the enviromental variable manually
ok thank you
bump
I forgot where the enviromental variable is
nobodys stopping you /s
But he is helping me
okay bye
thanks you for your hel[p
Is there an event I could listen to which fires when the dragon egg gets placed for the first time in the end?
Update
update what?
(Spigot)
@quaint mantle works fine https://paste.md-5.net/hexumacune.xml
Run build tools again
ok
I'm completely out of ideas. All the ones which could possibly sound logical don't get fired when this happens
Should plugin messaging channels be full duplex (one channel each for input/output) or is half duplex fine (shared channel)
@chrome beacon I runned BuildTools again but it still doesnt work
This is pissing me off
Which version did you build
I downloaded BuildTools and opened it
and some progress bar appeared
1.16
1.16.5
Latest 1.16.5 should support Java 16 π€
maybe it doesnt
Oh well you have downgrade Java in your plugin then
how to do that
How are you building your plugin
i think they are asking what build system you are using
Yeah
uh
i.e. maven, gradle, eclipse
eclipse
oh god i categorized eclipse as a build system
is it possible to make CommandSender#sendMessage send a message in all chat and make it fire the AsyncPlayerChatEvent ?
idk
You can call the event yourself
how would i do that?
?eventapi
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(false, sender, message, recivers);
Bukkit.getPluginManager().callEvent(event);
how would i get the receivers?
and also does CommandSender#sendMessage send a message in all chat?
Yes and make sure to call that async
No it sends it to the sender
could someone tell me a cleaner way of doing this? if (event.getInventory() != kitInvForRemove) return; event.setCancelled(true); final ItemStack clickedItem = event.getCurrentItem(); if (clickedItem == null || clickedItem.getType().isAir()) return; //gets data final Player player = (Player) event.getWhoClicked(); final UUID id = player.getUniqueId();
maybe turning it into a function, cuz im gonna use this in all my plugin commands
so instead of false i just set it to true right
but i cant find a way of doing it
oh i want to be able to send TextComponents in all chat, what method do i use for it? Bukkit#broadcastMessage does not allow components
The callEvent method needs to be used on a different thread
does anybody have an answer for this?
Loop all online players and send a component message
oh ill have to do it that way...
ok thanks for your help!
I think I forgot but what's the alias used for in oncommand?
Alias?
How can I specify the jdk when I am using buildtools? I am trying to build servers pre 1.17 (java 16)
change the path in the env variables
in env?
i believe you could also do
"C:\Program Files\Java\jdk-16.0.1\bin\java.exe" -jar BuildTools.jar but not sure
I was trying that rn
does anyone have a friendly way of deleting paths in config files
for some reason i cant find anytihng on google
I'm trying to hook book edits and block them under certain circumstances. I've tried using event.setCancelled(true) and event.setNewBookMeta(oldMeta.clone()), and while they work I can't see the changes client side until I relog. Is there any way to let the client know that the book contents need to be refreshed?
It works I just had to use the right path
should I make a server for each major version and test my plugin if it works? or is 1.8.8 enough
most of the time it will work unless you use something that got added in like 1.16 api and it isnt in 1.8 or you use nms
you can just adjust the priority of the java paths in ur Path variable
Ok then I'll test only a couple version
its what i do when i switch between jdk 16 and 8
Okay so im making my own plugin and im organizing right now moving everything to other classes for player events custom items recipes ect, For event handlers I would just assume i would make a new class in the folder and then just import it, then it would work? but clearly i was wrong and i don't know what to do...
my java home is 16 but when i need to use an outdated version i just move the path to my jdk 8 higher in my Path variable
you can also just change the path but i said that command just to say that it should work
ye
in a package
thats what you do yes
well then how comes i can't access them? i have an event on a player join there health get set to like 60
send a picture of ur layout
that doesnt happen, and when i die it shows custom death message
like the little explorer in ur IDE
i cant
snipping tool ?
can only verified people send pictures
use sharex if thats for linux
or gyazo if thats for linux
should i make when someone is an op, he can use all the commands?
or will that be abused?
sharex has a thing for linux
i think
doesnt ops get access to all commands anyway
thats usually what plugins do
actually i think jus default mc does that
ah uhh i was struggling with permissions and so on
shareX π
use flameshot
because it may return null
you can safely ignore it if you define "experience" in your plugin.yml as a command
i have done that
i dont have linux anyway
lmao
i thought they had a linux version guess they didnt
@maiden thicket here this is my explorer for the files
all of the stuff in the ITEM folder i can use and works 100%, and for organization i moved out of my main file to sub class folders and now all of my events no longer work
and commands
does anyone have any ideas on this? it got a bit buried
it also updates if i throw the book and pick it back up
but if it stays in my hand the edits dont show
figured it out
the very spooky Player.updateInventory() call did the trick
if there is a better way let me know
Hi! I have a weird problem.
I have 2 own plugins. From one plugin i made a service registration:
public void onEnable(){
this.mongoProvider = MongoProvider.connect();
try{
Bukkit.getServer().getServicesManager().register(Mongo.class, this.mongoProvider, this, ServicePriority.Normal);
} catch(Exception e){
Logger.getLogger("").info(e.getMessage());
}
getLogger().info("enabled!");
}
from another i connect to it:
this.DB = this.getServer().getServicesManager().getRegistration(com.hoshion.mongoapi.Mongo.class).getProvider();
and i have an error:
Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because the return value of "org.bukkit.plugin.ServicesManager.getRegistration(java.lang.Class)" is null
i made my second plugin depend on first. Minecraft verion 1.16.5
Make sure the second plugin depends or softdepends the first plugin
name: HubPlugin
main: general.Plugin
version: 1.0
api-version: 1.13
depend: [MongoAPI]
plugin.yml of the second plugin
name: MongoAPI
main: com.hoshion.mongoapi.Plugin
version: 1.0
api-version: 1.13
plugin.yml of the first plugin
shall this work or do i really need to put the name there?
the same problem after restarting
Put name
oki
When are you calling getRegistration
in the onEnable(). i checked services that work before calling getRegistration:
[19:07:08] [Server thread/INFO]: net.luckperms.api.LuckPerms
[19:07:08] [Server thread/INFO]: me.wolfyscript.armorstandtool.metrics.bukkit.Metrics
[19:07:08] [Server thread/INFO]: com.hoshion.mongoapi.Mongo
[19:07:08] [Server thread/INFO]: me.gfly.Management.BStatsManagement
[19:07:08] [Server thread/INFO]: me.wolfyscript.utilities.main.metrics.bukkit.Metrics
[19:07:08] [Server thread/INFO]: com.comphenix.protocol.metrics.Metrics
and there is my service
Strange
can someone do a tutrial on how to do the new shaped and shapless recipies for crafting as all the ones are depricated
Find the deprecated method and it usually tells you what to use instead
iirc itβs deprecated for the reason of being a draft which probably means itβs subject to change
Ah
Just get flameshot
i got screen shots i know how to do it
i just wasnt able to upload them because i wasnt verified
Well then why'd you bother mentioning linux lol
And?
screenshotting wasn't my concern more about me just verifying my self
You don't need to verify your choice of OS though
Verification makes no difference linux or windows
im not talking about a fucking Operating system
he said use Snipping tool.. i said im on linux dont have that, and also said i need to verify to send a screen shot in this discord server
i have my own screenshotting application that i use.....
Then why bother saying snipping tool wouldn't work
It's like kleenex or bandaid
Generic name for screenshot utility
i dont understand what your point is here
I don't understand why you said you use linux when they said to take a screenshot
because he said use snipping tool
Generic name for screenshot utility
Okay? and i need to know a generic name for a screenshot utility?
It has total "i UsE aRcH bTw" vibes
We don't care what system you use. Just take a screenshot
Whether that's flameshot or snipping tool idc
guys I use debian
and all i said was i dont have that im not on windows
am I cool
They're the same basic program
why is it such a big deal saying that i dont have snipping tool
It's pointless
Yes. Debian good
that you need to make an argument based of off nothing to make your self seem useful ?
No, you said you couldn't use snipping tool, so I gave you the alternative
i already have one
dude, just take screenshot and that's all
The issue is it sounded like you said it just to assert you're a linux user
i already took it
ITS RIGHT HERE!
Either you are just flexing linux, or you were looking for an alternative
why are you still arguing then?
I tried to help
i have access to all commands with op level 2? op-permission-level is 2 and level is 2 in ops.json but i can still /stop
Use a permissions plugin. It's just easier
arguing over why i mention im on linux because i dont have snipping tool @whole stag making a big deal that no one cares what OS anyone is on...
when the guy above said to use snipping tool when i mention on linux dont have that, then i use my own screenshot application to take one but then needed to verify to send a screenshot
luckperms breaks everything
not worth my time
i just wanna know what bukkit is doing to perms checks and how to fix it to vanilla like behavior
Setting it up wrong or something. You're changing the ops permission level in server.properties right?
yes]
How can I modify the version that is shown on the top right of a server in your server list?
Example:
And reloading/restarting after?
yes
Β―_(γ)_/Β―
OnlyMoon be like
Already lads no need to argue over Linux and screenshots
Can someone at least point me in the right direction? I forgot what that thing was called, so.
It was
its a paper event i think
or just use protolib
can anyone help
hm
On a side note @sacred vector, flameshot would let you post images even without verification. It has an imgur integration:
https://i.imgur.com/G52z7ed.png
anyone?
Β―_(γ)_/Β―
disabled checking for this.getBukkitSender().hasPermission(bukkitPermission);
from public boolean hasPermission(int i, String bukkitPermission) {
in CommandSourceStack
shitty workaround but it works
once again bukkit sucks YEP
ah yes BukkitSender
using bukkit permissions
handles this call
public boolean hasPermission(@NotNull String inName) {
it defaults to true if player is op
bukkit fucking sucks.
I havenβt messed with it so canβt really comment on that.
Bukkit perms itself has no idea what * is
the concept
if the permission is not found and the player is op then the check returns true
Yes, bukkit perms has no concept of *. It only assgns perms you set to be assigned
it produces ops having *
Is it maybe a way to check of the player is an op?
If you want to see if a perm truly exists test isPermissionSet
then why doesnt bukkit use that
No idea
heck, i used luckperms and didnt disable ops and even explicitly denying an op a perm didnt matter they had * no matter what
Someone know which packet force player to sleep?
I've no clue if LP understands op and notop, I know GroupManager doesn;t as its from before those ever existed and I never added them
lp has a disable ops feature
it sucks ass
the entire bukkit permissions system sucks ass
Fix it and make a PR
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
not worth my time
Stop bitching then
the only fix is breaking changes
being the legacy project that it is, the pr wouldnt get accepted
That doesn;t matter. If it is truly broken then a fix is whats required
1.17/18 is a very good time to submit breaking prs
ill think about it
When I try and spawn a FallingBlock with
FallingBlock fallingBlock = player.getWorld().spawnFallingBlock(player.getLocation(), Material.OAK_PLANKS);
I get the error Cannot resolve method 'spawnFallingBlock(org.bukkit.Location, org.bukkit.Material)' with 1.16.5
Can't find anything online
?jd
uhm
BlockData or MaterialData, not Material
OH
Thats what the javadocs are for π
I just realized there's an issue with my enchantment, when you break a block, it automatically gives you the item instead of dropping it on the ground. With a world guard region, it gives it to you even though the block break was cancelled, I tried using event.isCancelled() but it did nothing, any ideas?
Wait why's MaterialData depricated?
Would I have to use World Guard's API?
Look at teh javadoc it tells you
Is there any way to get the portal block from a PlayerPortalEvent
Getting the player's block doesn't work obviously as they don't have to be centered on the portal block to travel
Anyone got any ideas?
what?
Guys , How to register multiple events in one Class
Multiple event listeners or just Events?
Events , as Player Interact event , death , leave
a player occupies two blocks, so check their block and the one above it
They are event listeners....?
No , Normal Events
can you show some code of what you mean?
But when I set player drop item to setcanccled to true , it don't work@opal juniper
What?
Its still not going to be 100% accurate though as its the players collision box that triggers the teleport
Nope
The player can TOUCH a portal block
Without being on the portal
Exactly what I meant.
I send in DM @opal juniper
You have to annotate the method with @EventHandler
try monitoring the interact event then
On Every Event I Need to do that ? @opal juniper
Talking to me?
yes
yep
Thanks ! @opal juniper
The interact event? For a portal travel?
@EventHander
public void onPlayerJoin(PlayerJoinEvent event) {}
That sorta thing
yes, the player will likely interact with teh block before it triggers a teleport
I'm sorry, but this is an absolutely dreadful solution.
This is my thoughts
Its about the only chance you have of getting the actual block
I have an idea
divulge
Not really, your solution is probably about the worst way I could go about it honestly.
Hey, I can always stop making suggestions
No thanks, someone told me to "add it urself then" π
Some filter might help π
but i want to know your idea
please
Ok, I found your solution.

π π
Try monitoring the EntityPortalEnterEvent as it MAY trigger for a player
so long as the PLayer hasn;t been completely seperated from those events like Vehicles
I have a feeling it won't trigger for players, as it's about the instant teleport that happens for entity
But fair idea
looks good
If that doesn;t fire then you are out of luck
whatβs a good inventory lib? i made my own but i cba to add compatibility for menus that arenβt chest guis
Canvas, inventoryframework, helper, bkcommonlib iirc and mfgui
merci sir
How do I get Location from a RayTraceResult
Looked at the NMS, my idea wouldn't work
public void run(Player user) {
Location loc = user.getEyeLocation();
Vector dir = loc.getDirection();
RayTraceResult result = user.getWorld().rayTraceBlocks(loc, dir, 10);
Location end;
if(result != null) {
end = loc.clone().add(result.getHitPosition()).subtract(dir);
}
else {
end = loc.clone().add(dir.multiply(10));
}
Bukkit.getLogger().info(String.valueOf(end));
user.getWorld().spawnParticle(Particle.CLOUD,end,200);
}
get hit block or sommin
It could be passed through by API, but the simpler option is just to redo functionality a little
This doesn't work and the result gets to like y = 128
Does anyone know what particle is the white dot commonly used for indication?
Anyone know an api that I can give two locations and then it returns the βpathβ an entity needs to follow?
I donβt know if the nms pathfinding would work cause there would possibly be unloaded chunks in between
The two locations could be 1000βs of blocks away
I know this is insanely specific but has anyone here ever tried using seeded randomization to create voronoi noise patterns which do not require long term data storage beyond just storing the seed?
how are you going to find the ground path through unloaded blocks
possibly tens of millions of unloaded blocks at that
then just make a straight line
Yeah but like buildings and mountains and shit
sucks to suck
How do I get the point right before the result of rayTraceBlocks
I want the get the location of the air right before it hit the target block
realistically at that point you would want to do the flight in increments and not through unloaded blocks
but also the minecraft flight ai is so bad it wouldn't be a loss to the game if it was just deleted
so even if you get air pathfinding to work you'll probably wish you didn't
I was kinda thinking that when it got to an unloaded chunk I just remove the entity and then just re spawn it when it gets to a loaded one
I mean you can just reverse trace the block before it
depends on how much accuracy you need really
I just donβt want it to fly into shit or thru it
just saying it sounds like you're setting yourself up for failure
Use pdc ig
yeah but do you want to account for diagonal blocks
and if so at what angle
1m I think I got an idea
No it donβt
Sounds like i need to think this thru though
To not be laggy as shit once it has a few entities flying
π
Hi I was wondering if anyone here knew of a good and easy to use plugin obfuscater. if so it helps me a lot if you can tell me where to find it, Thanks!
Why are you obfuscating
just in case that people try stealing code where you have been working on for al long time.
end = result.getHitBlock().getRelative(result.getHitBlockFace(),1).getLocation();
Easy
Are you planning on publishing the plugin to spigot?
Does that account for diagonals
I forget all the block faces
There is no diagonals
Ah ok
Whichever face you hit is the way its going so diagonals are not a thing in this case
Are you planning on posting it to spigotmc?
no not right now but maybe in the future, I just find it very useful to have I just can't find anything quickly, I've been looking for it for quite a while
spigot has very specific guidelines on obfuscation if you want to do that
Why would you obfuscate it
Trust me - your code is not that ground breaking to need obfuscation
But - by all means try to prove me wrong
braking
then I won't publish it, but that doesn't stop me from looking for it because I do work at servers that I make plugins for and I don't want the code to be out on the street right away.
Oh an of course I gotta get an error when shutting down the server
I mean just google it
and*
Lmaoooooooo
people trying to obfuscate plugins just never ceases to be funny
i aight gonna fix it now it's 530am
They are basically always white roles as well
βFirst plugin, time to obfuscateβ
just very short sighted
already done could only find nothing useful
pepsiCan.yeet();
this.sloop(10h);
π³
AIght gn ig
Ciao
would you look at that, found a random 2013 Bukkit forums voronoi noise implementation that was exactly what I was looking for
god bless the internet
though I guess I will have to figure out a way to store nodes
hmmm
So I have an enchantment that puts items into your inventory instead of dropping them when you break a block. When in a World Guard region, the blocks act like normal, not being removed, but the player gets the item. I looked through the block break event and the closest thing I found was checking if the event had been cancelled, but that didn't work. Any have any ideas on what I could use to fix this issue?
actually screw storing it, I'll just check if the chunk already existed on the chunk load event
way faster
ok guess the real work will be meshing the voronoi noise with chunks
Hello
I have a source code for a plugin to prompt you to download a resource pack
How hard would it be to make it force you to do it?
To kick you if you decided not to download it
the actual kick would be easy, but how do you want to check if the ressource pack is actually downloaded and in use?
Great question
There is no way
But for the event of you clicking the "no" button
That is possible right?
Sure
im pretty sure it is possible to check if a resource pack is in use
idk
unless it isnt
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setResourcePack(java.lang.String) this is how you make them download resource pack
declaration: package: org.bukkit.entity, interface: Player
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent, enum: Status
public class YourListenerClassName extends Listener {
public void playerResourcePackStatusEvent(PlayerResourcePackStatusEvent e) {
if (e.getStatus() == PlayerResourcePackStatusEvent.Status.DECLINED || e.getStatus() == PlayerResourcePackStatusEvent.Status.FAILED_DOWNLOAD) {
e.getPlayer().kickPlayer("please download the resource pack!");
}
}
public void playerJoinEvent(PlayerJoinEvent e) {
Player player = e.getPlayer();
player.setResourcePack("https://your-resourepack.download");
}
}
``` something like this @dark jackal
i think
you really should be providing the sha1 hash as well
otherwise you're just making it shit for users
I tried checking if the BlockBreakEvent was cancelled, but that didn't do anything.
idk how you would convert it to a byte[]
Thank you
But i dont really know how to implement it to that codeπ
hang on
Because i already have a code juat for downloading it and using it on all servers
Just*
import javax.xml.bind.DatatypeConverter;
public class YourListenerClassName extends Listener {
public static byte[] toByteArray(String s) {
return DatatypeConverter.parseHexBinary(s);
}
public void playerResourcePackStatusEvent(PlayerResourcePackStatusEvent e) {
if (e.getStatus() == PlayerResourcePackStatusEvent.Status.DECLINED || e.getStatus() == PlayerResourcePackStatusEvent.Status.FAILED_DOWNLOAD) {
e.getPlayer().kickPlayer("please download the resource pack!");
}
}
public void playerJoinEvent(PlayerJoinEvent e) {
Player player = e.getPlayer();
player.setResourcePack("https://your-resourepack.download",toByteArray("your-sha1-hash"));
}
}```
Any ideas?
how were you checking it
With if (event.isCancelled())
and what is your event priority
?paste
All of the event, or is just the handler fine?
either
there shouldn't be a second arg for the event
also you can put ignoreCancelled = true in the event annotation and it will be ignored for yoiu
I added that after I tested with isCancelled
but get rid of your second argument anyway
Yeah, did that
Then when WorldGuard cancels it, that should be cancelled, correct?
yes
Okay, thanks
if (sender instanceof Player) {
Player player = (Player) sender;
if (!(player.hasPermission("blah blah")
does this look right
will this work for player and console commands
how do I set it up for console and player
How to make rgb colors in plugin? version 1.16.5
Anyone know how I can get the itemstack of a dropped item?
for(Entity e:w.getNearbyEntities(loc, 2, 2, 2)){
if(e.getType() == EntityType.DROPPED_ITEM){
//I want the itemstack of e if that makes sense
}
}
cast to Item, then use method getItemStack()
for(Entity e:w.getNearbyEntities(loc, 2, 2, 2)){
if(e.getType() == EntityType.DROPPED_ITEM){
ItemStack item = ((Item) e).getItemStack();
}
}
:3
btw how do you make these little code boxes in discord?
``` something ```
Oh, cool. I got to try that
also you can use
```java
something
```
and there will be colors
those have been here forever

how can i detect if an armor stand is a passenger
what are you trying to do
if i kill the mob who have an special armorstand on it... the armor stand will killed too
get the entities passengers?
if list contains the armorstand
on mob death event
ok wait i explain (im not good in english)
im doing a car and the skin of the car is a armor stand with a custom item with custommodeldata and i want to if i kill the ridable mob, the armorstand die too
get the killed entity's passengers
ok
wait, is the armor stand riding the mob that would get killed?
yes
I would think that getting the passengers of the killed entity should return the armor stand if the armor stand is riding that entity
ok im trying this and if isnt work i come show you what i do π
how to kill an armor stand π
loool
If you remove the void you can also remove the universe and earth so be careful.
it's true, you really need to be careful
for some reason itemList is null
i dont think thats a null warning
that looks like a unchecked cast warning
yeah thats kinda weird tho cuz if the list had nothing it should return a empty list
but I am getting an Unchecked cast warning too
yeah you can ignore that but you must make sure that the list contains ItemStack's
I am putting an inventory into the file
ok but is it itemstacks?
ok
I think they are ItemStacks
make sure that the thing where that list is what you want to get "player YourUUIDbackpack"
wait can you send me the whole yaml
yep
i wanna check if its valid
so it is valid but you might not want the null in the thing
ok I think I can fix that
lol the yaml validator i used gave me this https://paste.md-5.net/lufisumihu.bash
im pretty sure you cant have - in yaml
so maybe thats why theres extra characters
and ""
How can you add a space in between each path in a custom yml file
it should do it for you?
I mean like ```yml
test:
blabl: "ww"
test1:
poop: "yay"```
without having a config.yml
I don't think you understand
it should auto do it for you
The space in between test and test1
im pretty sure
oh that
i dont know
why do you want to do that with code anyway
Looks messy without it
Kinda pissed because I had it work yesterday and then I deleted it by accident and closed my intellij so i can't ctrl + z andd yeaa trying to remake it
f
Do you want to set the config then saveResource?
Β―_(γ)_/Β―
how can i create an Itemstack and the Itemstack is the item on the head of my armorstand?
How can I wait for a response for a plugin message? I tried waiting on a CompleteableFuture but then it locks the main thread and that ain't good
are you using get
Right so I have java saveDefaultConfig(); saveResource("messages.yml", false); messageConfig.reload(); config(); messageConfig.save(); on my onEnable then messageConfig.get().getString("prefix") in my command class but it seems that it is null but I'm loading the config and setting it
it's weird to think about futures, but code to be run in the config has to be in an enclosed scope, using something like CompletableFuture#thenApply
get will do it immediately, on the main thread
thenApply is a lambda with the result of the future as an input variable
Hmm
hey all! I've tried using the remapped-mojang dependency, but it's not working...
My depedencies:
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
isn't remapped spigot, not spigot-api
since it's illegal to redistribute mojang code
i.e. buildtools output
im slightly confused as to what you mean
not about the legallity things
I've added the maven stuff so that it un-does the remapped stuff
but it doesnt seem to remap
If i have a interface with implemented objects how do i get a random object fropm under the interface? (i hope im saying that right)
what I'm saying is, spigot-api is api only
you need to run buildtools for the version you need to use the base mojang (and remapped) code
i have
so change the dependency to spigot
and my re-mapped jar dependency is there
oh
so i have the api
the remapped
but then i also had to include just 'spigot'
bc the remapped didnt seem to work
hi i am trying to add args to a command but i have never tried doing args b4
any1 can help ping me please
Google your question before asking it:
https://www.google.com/
was a command
...
Who uses bing anymore
i swear I'm not crazy
sure...
does ur config actually contain the string prefix?
yes
is messagesConfig.get() null?
That is possible let me print out get()
It doesn't seem like it is
Oh wait yeah it is
wait no
It's not
@ionic reef What's another way I could test to see if messageConfig.get() is null?
When I debugged it it didn't seem null but I guess it's the only way
that's what I did but I did some other ways some said it was null and others said it wasn't
so I'm im just gonna go with that it's null
wtf the spaces in between each path is gone in my config are gone now
heyhey
i was wondering if its possible to have spigot jar's and the main classes and what-not already be made in Eclipse
like, is there an addon.. or a way to make Java projects with pre-loaded stuff?
well im tired so ima just leave this here ```java
private File file;
private FileConfiguration fileConfiguration;
public FileConfiguration get() {
return fileConfiguration;
}
public void reload() {
file = new File(plugin.getDataFolder(), "messages.yml");
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
fileConfiguration = YamlConfiguration.loadConfiguration(file);
}
public void save() {
try {
fileConfiguration.save(file);
} catch (IOException e) {
System.out.println("no");
}
}
wa
aaaa
Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.silentprogram.chaosplugin.MainClass.getCommand(String)" is null```
i know it has something to do with the command name but idk
wts in ur onEnable
new MainCommand(this);
public MainCommand(MainClass plugin) {
this.plugin = plugin;
plugin.getCommand("chaos").setExecutor(this);
}
this is my constructor for the command
thats very wrong
...
in ur on enable do
getCommand("chaos").setExecutor(new MainCommand(this));
and remove the plugin.getCommand() from that constructor
my constructor for the command class
o
ok
Could anyone give me a hand with setting up the remapped-mojang thingo? Its not working for me rn
same issue