#help-development
1 messages · Page 1625 of 1
Does anybody have experience with ProtocolLib?
I'm looking for a way to do:
packetContainer.getModifier().write(1,
new PacketDataSerializer(Unpooled.wrappedBuffer(out.toByteArray())));```
without using nms PacketDataSerializer
hello, ive set myself setGliding(true); but it doesnt rly let me glide
any ideas
okay so
i am gliding for a milisecond
then im not
to what extent do i need to know java so I can make plugins?
i have a solution
when ur event occurs or ur command or whatever
u give the player a persistent data container
and make a check outside if the player has ur pcd
and then check if hes not gliding
then glide him
well
id hope so
@grim ice you cant fix everything with a PDC
I barely ever use PDCs
everything you write in here or the plugin development help in the forums is about using a PDC
do you even have an elytra on?
Plus in the case of kacper I doubt persistent storage is even a good option
its built in God that it will auto be stopped
can you help me at a problem im facing?
so you have to cancel the event for it to be kept going
So uh
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
I don't know at what point should i stop learning java
I don't want to master java or anything
ah
i just want enough to do spigot api
learning by doing
its not needed
Yeah i used to do that
i need to find a way to stop the event from getting canceled
and you should never stop learning java
you cant reach a point where you just can or have to stop
just on the event of the player gliding stop or whatever cancel it so they keep going
i cant figure it out at all
hi ihave a proplem when player click on any item in his inv all items removed form his inventory
i know basics of java but i miss some stuff between the lines
just continue. make things, you know you can't do. go further into it. don't even think while searching for an idea about "how can i learn java with it?". just do it.
Don't worry @grim ice. You'll learn much faster if you actually do things
o
you don't care if those things are not perfect
okay i guess
i mean i try to make them better
any help
wtf
show us your code
ok
this is 100% intentional you cant do that as a mistake can you
everything can be a mistake
i mean yeah if u say so
that's good
anyways. i would just recommend to do a big-as-hell project
which you can extend step by step
to go further into spigot and java
the beginning of a MMORPG, or recoded Essentials could be a good start
but why remake essentials
To be honest
thats not the point if you were reading jtx
to learn
EDIT: answered on the wrong one damn
i never considered remaking stuff
Its to learn
doesnt have to be something official
I can't get payment either way because i suck and ill never stop sucking + no cc
HAH
dont listen to jtx
listen to me
Don't ever expect to make money writing plugins
i bet even someone with 10x my knowledge wouldnt be good for it
^
exactly
thats why i never consider making paid stuff
@eternal oxide my savior
its really useless especially if ur like me and ur just trying to learn
by any chance, do you know a bit about ProtocolLib?
Nothing. I've never used it
oh okay
just list out what you dont understand , and try to understand them step by step. one step a day or a week.
?ask 
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
ah damn
bro i swear thaat just moved wtf
ok it did nvm
lol
i looked at the reply it was that smug thing when i looked at ur message it was smiling
that got me so scared lmao
Why not? You could be charging people if they want you to make them a specific plugin
The resident expert here with ProtocolLib is 7smile7, but it looks like he's not alive at the moment
it’s 4am for 7smile7
no its 5:30 pm for him
he's in his IDE, but showing as away
isn’t he in pst?
mesz
tbh
i would never sell a plugin
except if im just too good
like maybe
pst would be like 8;30 am
4 years of coding
I dont do any public premium plugins as its not worth it for me
other than that ill just make low quality shit that will never sell
public premium open source plugin 👀
That's what I'm doing with Oraxen
tbh i wanna code but ill play minecraft because my day is ruined
1.17.1 or 1.16.5 for NMS?
u can use oraxen for free but without built in textures and models
why
why not
Are you satisfied with it? @dusk flicker 🙂
ye
🤯
Havent used it in a little bit
.
Use whatever version you're developing for
Should I use Paper or Spigot?
again depends on your usage
Again, up to you
asks in spigot server
to run a server, prob Paper, if you are gonna develop a plugin prob Spigot
Paper has a few extra API features though
LOL
Yeah that's why I am asking
Sponge
keep in mind that you cant use a paper plugin on a spigot server
but can use a spigot plugin in a paper server
Yes
i'll do the thing i said
for the most part yes
😄
scoreboards
visual bukkit have a discord.
what’s visual bukkit
its not java
so basically skript
Yeah but arguably worse lol
why not just learn java
why waste your time to learn skript
when you can learn java
Who do I message to get a bull crap review taken down?
@vagrant stratus
I mean tbf skript can help you learn how plugins work in a way
blueprint
thanks
If it's not breaking the rules it won't be removed
well, how about it claiming GM has backdoors as a review?
elgarl made the original permission plugin
the original one was discontinued
I am the dev from When it was in Essentials
?bt
ah that’s what it is
you need 1.17.1
Yeah it's with each version you have to rerun it
then what do i do?
Yes
if that’s what it says yes
run it with --remapped to get the mojang mappings
read the docs
alright
it literally tells you how to do it
Then after you run it you can import it with maven/gradle
Although for gradle, idk if there's a plugin yet for building a remapped jar
what is the one of maven
the specialsource maven plugin
how do i get the name of a field in javax.annotation.processor
bump
if i made a custom inventory in my class can i check in onInventoryClose of the event.getinv is instaceof that class?
why havent you tried it
Why is it that I have this code
public class ListLocations implements CommandExecutor {
@SuppressWarnings("unused")
private Main plugin;
public ListLocations(Main plugin) {
this.plugin = plugin;
plugin.getCommand("listlocations").setExecutor(this);
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(!(sender instanceof Player)) {
sender.sendMessage("Only players can use commands for this plugin");
return true;
}
Gson gson = new Gson();
Reader reader = null;
try {
reader = Files.newBufferedReader(Paths.get("C:\\Users\\gaela\\OneDrive\\Documents\\advanedChorusFruitPlugin\\src\\me\\JiovannyAlejos\\advancedChorusFruit\\tpData.json"));
} catch (IOException e) {System.out.println("failed reading json file");}
CoordinateData data = gson.fromJson(reader, CoordinateData.class);
String coordList = "List of warp locations\n";
if(data.coordinates.size() == 0) {
coordList = "No warp locations set";
System.out.println("1");
} else {
ArrayList<String> names = data.locNames;
for(int i = 0; i < data.coordinates.size(); i++) {
String[] coordinates = data.coordinates.get(i).split(Pattern.quote("|"));
coordList += "\n" + names.get(i) + ", " + coordinates[0] + ", " + coordinates[1] + ", " + coordinates[2];
}
System.out.println("Thing");
}
Player p = (Player) sender;
p.sendMessage(coordList);
System.out.println("nyeh");
return false;
}
}
but all it ouputs is this and nothing else
[09:42:19] [Server thread/INFO]: Radiant_Bee issued server command: /listlocations
[09:42:19] [Server thread/INFO]: []
then you didnt do it right
?paste
uhhhh h-how do i use hastebin? i'm saving but im not sure where it's saving
What are reasons you would ban someone? Need it for my plugin lol
I never ban, I imprison. Its harder for a person to choose to not log in anymore than to be banned.
what are reasons you would imprision
hacking
griefing build (not so easy these days). Harassment. Inappropriate behaviour
Griefing doesn't apply to my server and I'd consider Harrassment a perm mute
The only other would be underage access. If your server has a legal age requirement
If you can, just have a separate server just for rule breakers
Why ban or imprison when you can just keep them coming back lol
i think im filling my lib with so much bloat, i either have to make my plugin JARs uber jars or make the lib a plugin
or just go through the lib and remove bloat 😂
all of it is used
at some point
but some plugins dont need some parts
so use some parts only in the plugins that need them 😐
inb4 compile errors
we'll see
What are plugin 'addons'?
usually jar files loaded by a plugin
Oh, like soft dependencies?
they most likely contain a concrete implementation from some base type of the plugin api or plugin sdk
uh well not really
That like add up to the plugin to make it better?
take papi expansions for instacne
They're like game DLCs/extension packs.
Extra content for free :p
sometimes free
independent redeployment 😌
on spigot they need to be, assuming it's an addon to a premium plugin
Does anyone know of how to get non-consumed items in a crafting recipe? For example: the honey block ShapedRecipe takes in four honey bottles, with getResult of 1 honey block, but where do I find the 4 glass bottles that are left behind?
declaration: package: org.bukkit.event.inventory, class: PrepareItemCraftEvent
has everything you need
Thanks, but I don't see where I would get non-consumed items from this event.
getInventory
from the CraftingInventory, there is the matrix, which is what is needed in the recipe, getRecipe doesn't have non-consumed items that I can see, and getResult is still a single ItemStack
loop through the inventory, not the matrix
Wouldn't it only have the honey bottles? Not the glass bottles?
This seems like it should be in the Recipe API
if getResult() is HONEY_BLOCK then
# glass bottles
That seems ripe with the ability to be out of date every release.
If a new recipe is added which includes non-consumed items, and the plugin wasn't updated? Isn't that why we should try to avoid magic numbers and hard coding those types of things?
Don't know
Yeah
I am looking to find what items are left behind from a recipe
Yes
use the event
that imaginedev told you
get the inventory of the crafting table then the matrix
check for each one
if one has a glass bottle or whatever u want
do ur code
declaration: package: org.bukkit.inventory, interface: CraftingInventory
I can look at that, but this should be part of the recipe. What if there were no event. Say... an auto crafting plugin?
hm
maybe
Inventory open event or what was it
then check if the event is a crafting inventory
if it is then make a loop to check the matrix
..etc as i mentioned before.
This isn't a player initiated action
What?
Say you have a crafting table with a hopper pointing into it. There are special criteria on what crafting tables are included, but that's irrelevant to the point. You look for hoppers pointing into that block and have a designated item's recipe. You can look at the recipe and see the ingredients & choices. If the hoppers have the right items, take them and pop out the item.
hoppers cant interact with crafting tables?
Unless you write a plugin that lets them
oh so you are trying to make a plugin that lets the hopper put stuff in a craft table
Yeah, in a manor of speaking
it would be hard to do tbh. Like which slot are you gonna put the item from the hopper in
top left corner?
bottom left corner?
Doesn't matter
so ur recipes are not shaped?
Basically it unshapes them
youre gonna fuck up shaped recipes.
No, I just iterate through the recipe ingredients
so you want the plugin to be able to tell a unshaped version of shaped recipes
what if there was 2 items u can craft with the items in the hopper?
This is only for Shaped and Unshaped recipies
I cant help you with that honestly
You tell the table what it should be crafting
helmet
oh i see
Youre gonna listen for every minecraft recipe
what about custom recipes?
well then check the item in the hopper and set the crafting table with the items and delete the items from the hopper
Hm
why?
i mean
Just get the item in the hopper that went through
output should be 1 honey block and 4 glass bottels
it works like normal
you should be able to do that if your code structure is good]
it should return 4 bottles
yes and where do you want to honey bottles to go?
But I can find nothing in the recipe which tells me what other items should be in the output
back into hopper?
They can go to the output hopper
check the input instead
Why would 4 glass bottles be in the input? It is 4 honey bottles in the input
well if you craft a honey block like normal but with a bot of somekind
spigot should go throu with the default crafting
and return 4 bottles
is that not the case in your tests?
Where? Where would the 4 bottles be?
say u are a player
and u craft
the bottles should be in your inv
if your inv is full
ahh i give up
never messed with auto matic crafting
what i said are all theories XD
Okay okay. The CraftItemEvent.getInventory() may have it in the matrix
so what happens when you craft a honeyblock
where did the glass bottle go
did they disappear
Yes
and you got the honeyblock?
But, that is because I am manually subtracting from the hopper's inventories
wdym
Okay.
- Find all the glowItem frames attached to crafting tables with an item in the frame and a hopper under it
This is the output item expected, what should be used for the list of recipes - Combine all the hopper inventories for hoppers pointing into this crafting table
- Iterate through the recipes and find one where the combined inventories have the necessary items
- Iterate through the hopper inventories and deduct the items as needed
- Put the new ItemStack in the output hopper
Obviously there are checks for full inventories, disabled hoppers and the like
well if that is now your plugin works
when you find a crafting recipe with 4 honey bottles
make the output contain 4 bottles AND a honeyblock
I'd rather not hard-code that as it would lead to the plugin being out of date for any release which adds a recipe having non-consumed items
So I am trying to find a way that I can get the CraftItemEvent to fire without player interaction and see if the CraftingInventory.getMatrix() has the four glass bottles.
But the CraftItemEvent is very much tied to a Player
This seems like a limitation in the Recipe API, because this type of information should be available in absence of an event.
oh i googled a bit and found nothin on google, but logically it might be possible
well GL
Thanks. I'm trying to see if I can find where the event gets it's information.
this might help
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Lol ive read that thing so many times
Alright, I'm having issues. How do I make a command executable by anyone?
the 3) Creating your own Event section
did you set the uhh
permission
in yml
if u did
remove it
or get LP and set it to avaliable for everyone
ctf.player:
description: Allows the player to use player commands
default: true
class:
description: Sets the class of the player
usage: class <class>
permission: all
These are what I have
try not to make permissions case sensitive. it may or may not be applied in plugins, and it makes life a nightmare
What do you mean case sensitive?
yes, if you specify case it makes life difficult, and may be ignored anyway
lp has auto complete so its not much of an issue :>
Is someone here a ProtocolLib expert ?
a command can have a dot in it?
all is a permission?
i never seen those
lol
my bad, I copied the wrong one
class:
description: Sets the class of the player
usage: class <class>
permission: ctf.player
Should be this
whew i thought what i had learnt were all wrong a moment there
you have the permission
if you dont have a permission plugin like LP on
only OPs can use it
does anyone here know Oraxen API
Im using Intelij with maven and wen i build and check the jar, there is no package with my project, so its basically an empty plugin
i also dont have the target folder with test classes and stuff but idk why
oh no no no maven...
Okay, so all I should have to do is pull down LP and add it to the plugins directory?
im asking for help not for java build tools
never used maven cuz its kinda hard to use so sry cant help
yes and then do /lp group default permission set ctf.player true
that will allow everyone to be able to use the command
globally
another way is to remove the permission node
Element#getEnclosingElement
wat?
That seems like it would be the easier option, yeah?
sorry that a was note for me
yes but you won't be able to say make a certain player unable to use your command
or disable your command in a certain world
ProtocolLib stuff:
Could someone explain to me why this is happening if I try to send a SPAWN_ENTITY packet that should be an Item ?
It's a command that should always be accessible, so that's fine
okay
how do i spawn items on the ground? i want to mimic breaking a chest, but breaking another block
player.getWorld.dropItem
Does anyone know if Spigot has an api for adding entity spawns (like how the datapacks do it) to the world?
yo
anyone wannts to help me better my code structure
Clean up your pom, at least format stuff, space stuff out, in your main class group things, you register a event at the top of on enable and one at the bottom, group common types
I don't see you needing the maven shade plugin so you could also remove that
my pom?
yes, your pom.
I never checked that thing in my whole life except when i add dependencies
what shit is it for
In your command and listener your DI objects should not be static
manages dependencies and contains info about the plugin/project and shit.
And maybe learn about maven before using it
eh
do I really need to
Sure ill consider
Yes and do me a favor and stop mentioning me
but it wont take as long as java right
Maven is simple
it does
It's not a full on language
oh sorry my bad
spigot is omnipotent
pom porn
it does?
tbh
yea
no, he just said it does 
the spaces r are as i like them
🏓
yes it does?
wait did i ping
spigot spawn entites
r/woooosh
what?
Yes but I had a conversation with this individual yesterday that inclines me to think that this individual has no fucking clue what they're talking about
Zombie armoredZombie = (Zombie) loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE);
Serious Spigot and BungeeCord programming/development help | Ask other questions here
how i do it
humans smh
I'm not talking about using events, I'm talking about registering spawns on the world
no events
dude
Your pom is fine formatting wise you just don't need the shade plugin or the sonnatype repo
pom
I just wooooshed you chill 
hhhh
Oh
this default font
🏓
Well I don't like messing with that stuff
Anything else? Like breaking java principles which I always do
sir, that message is not about programming.
You should learn how to use maven because that will help you a lot
Yeah ill do that
is ur pfp the red hair dude from Assasination Classroom
cool
Fix the static DI vars in the events and commands class and it looks decent to me
ayanokoji > that dude
his name is akabane Karma
haha XD
Karma huh nice name
Oh
🏓
Static DI? you mean the static field?
The variable
Oh right
You are using DI to set a static var that shouldent be static
where
some people use it
In your command class and event class make that main class variable not static
🏓
King Kong
@dusk flicker
sorry for ping
but you mean
private static JavaPlugin plugin;
(which is a field, no?)
and if you mean it, It has to be static?
fuck
XD
i think this is a basic java problem, maybe google.com will help :>
Yep
XD
Yeah that's a field or a variable
Sorry for my dumb questions
Just shouldent be static
when i make it something else
i get an error
when i do this.plugin i get Non-static field 'plugin' cannot be referenced from a static context
what link do I use to add spigot docs to a project javadoc task (gradle)? It doesn't like this one https://hub.spigotmc.org/javadocs/spigot/
Ye, you need to change the references in the methods of that class to just use the variable name rather then Class.var
Ye
ok
poggers
Someone recommend where I should ask this kind of problem ?
is there a material that i can use like all of a certon item?
so like all wool and all carpet
do you mean like test if a block is carpet or wool?
if (Tag.CARPETS.isTagged(block.getType());
o spigot has that?]
he can do startsWith
This is what Tags are for
It doesn't say anything more ?
no
no java for you
that's the thing
weird thing
i tried both adoptopenjdk 11 and adoptopenjdk 16
for 1.16.5
both of them vomits this error
do you use eclipse
no
You using Intellij ?
intellij
found this
might help
To be honest
In this episode, I show you how to create your first plugin using the Spigot API and the Minecraft plugin for the IntelliJ IDEA.
Spigot: https://www.spigotmc.org
How to make a server: https://www.youtube.com/watch?v=TXy2vFDhPVg&t=1s
Like and subscribe!! 😍
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. ...
this might help you
that's not the issue
just redo the first stuff
public class Plugin extends JavaPlugin {
@Override
public void onEnable() {
this.getLogger().log(Level.INFO, "Hello from the plugin!");
}
}
that's is literally it
i think its due to the openjdk
isn't onDisable necessary
No
ok
since its eclipse based
didn't he make like 3 other series about spigot plugins?
100% No
Oh wait
Having onDisable is unnecessary except if you have recipes / unordinary stuff
for example custom enchants
these methods are overrides. Bukkit API handles them in case its not overriden
this is useful
since i use the same compiler
fuck it
im gonna use amazon coretto
at least its not buggy with the ide
every plugins main has a onLoad, onEnable and onDisable and it will be called to 100% by bukkit.
what are you talking about?
Main class doesnt have to have method overrides, but yes JavaPlugin will have these methods, that you should override.
your main class IS the javaplugin class since it extends JavaPlugin. so your plugins main will always have those methods.
if overriden or not
doesnt matter
are we talking about the same JavaPlugin class? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/java/JavaPlugin.html
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
yes
public abstract class JavaPlugin
extends PluginBase
why do u even need onDisable
if u dont use custom enchants and stuff
f.e. saving things to your database
yeah stuff like that
well yeah
other than those stuff no need
youre right
but these methods are optional to implement
inside main class
override*
and even if JavaPlugin would not be abstract, bukkit would call those methods
optional to implement, called anyways.
right
i like how intellij idea ironically doesnt work properly with eclipse's jdk
it feels like.. Hm... Strange..
it feels like its done for purpose but its probs a coincidence
now wtf is that
java: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: Provider org.bukkit.craftbukkit.v1_16_R3.libs.org.eclipse.sisu.space.SisuIndexAPT6 not found
cmon
i just want to develop
it doesnt even use eclipse jdk anymore
im running on corretto rn
i feel like my maven repo of purpur is broken
and yet i can't fix it normally
because
nope
repo is fine
i checked the sha 256 checksum of repo
with paperclip cache's file checksum
and the checksums matches
WTF
Hey, i want to program my own LineParticle but in the 1.16 i get the Async Entity error which is why I took the old getNearbyEntities class (don't ask why), but now I get errors again in 1.17, but this time with chunk entities. Does somebody has any idea?
Error:
https://hastebin.com/secibumuvo.md
LineParticle:
https://hastebin.com/wurofemefi.kotlin
Old getNearbyEntities class:
https://hastebin.com/vutayodufe.java
?paste
Whatever ur doing can't be done async
That's why the async catcher is catching it
why is this causing intense lag: https://paste.md-5.net/xuletamehu.cs
fm.request() method: https://paste.md-5.net/qosupolofu.cs
whenever it is run
its in a command
Probably something ran on the main thread not supposed to be ran
In the 1.16 it worked, but not in the 1.17.1.
anyone
you just can't run it async anymore ¯\_(ツ)_/¯
Look what I said (clach)
how do yall do your managers?
go to your local tech store and buy a mouse with a scroll wheel so you don't ping the bot every 3 lines
With some runnables i think thats possible 🥴
But thx
what could it be tho
no errors
it lags me only
well it lags only the person who sent the command
Runnables will prob flag the catcher aswell
What you could prob do is store the list result of the method in a local var and then access it in another thread
Can I just immediately stop the server process without saving anything? Like the exit button on windows console? (Bukkit.shutdown() saves everything and takes time to stop)
You can use /stop to save stuff
but what if I don't need saving?
Then just exit out
right from the plugin?
does System.exit(0) work there btw
is there a command "kill"?
That’s how you lose data 🙂
i mean you can terminate the JVM but generally not a good idea
WhT?
Just shut the PC off
how?
I want to disable player regeneration, so I just figured i could cancel the EntityRegainHealthEvent. This works fine, however the Saturation still gets removed from the player like regenerating health. How do I disable this?
System.exit
Homie really thinks /stop is too slow 😂😂
System.exit
Inpatient
so delete the world?
check if the regain is
a
health
or check the food of the entity then check the event food leve
level
and compare them
if that can work, idk it worked for me with a different event
ok, how did you do it?
FoodLevelChangeEvent or whatever
Do the same thing cancel it if they have regen right??
public void onConsume(FoodLevelChangeEvent e) {
if (e.getEntity().getFoodLevel() < e.getFoodLevel()) {
int increase = e.getFoodLevel() - e.getEntity().getFoodLevel();
thats how i did it
ok, thanks
if i make my own java class with itemstacks in it, do i use Override ?
@Override
like that
Don’t
Don’t extend ItemStack
It will break clients
Clients can’t understand how to read the custom itemstack
ahhh ok ok
Huh
oh also is there any doc on how to use itemstand textures?
i can't find anything anywhere
My item builder extends ItemStack and it's worked fine
i wanna mask a bed as a model lol
Only issue is storing it in config
Regardless, you shouldn’t do it, and it states to not extend certain classes unless they say to do so
the player object will be the same even if the player reconnects, right?
No
Use UUID
lol
Player object will change if the player relogs, and may change when they die.
Yeah like Bukkit serialization will be messed up tho iirc
Unless you delegate
Like gui manager, world managers etc…
Wait I never heard of them changing when they die
Never knew that
can someone help? I'm trying to download the build tools but i can't see the package that says org.bukkit in it in my ide, the ones i see where it shouldve been are org.apache and org.eclipse
Don’t think they do
Why would it invalidate then
Makes no sense
When they die that is
when they die they are removed from the player map.
guys i just switched from java 8 to java 16 for intellij but now it gives me this maven error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project MaxicraftSurvival: Fatal error compiling
Oh yeah but the same object is probably added back once the player respawns
probably, but I'd not rely on it
Hey guys! I’m trying to clone an area of blocks (like /clone), but cannot find an effective solution, anyway to do it?
It would make no sense to switch object
The player object does not change when they die
I recommend using the WorldEditAPI. You can however just loop and save all blocks and paste them
So the old one gets removed
help
Or just IHM and remove on disconnect and add on connect
Need full error
Get the logs then
I looked into the API actually but could not figure out in the slightest how to use it. Is there some documentation or tutorials I could find?
kk
That could be due to a million issues
Show us not just logs
Build scripts
Which version of WorldEdit are you using? (or what mc version are you targetting)
Using a Player with an identity holder is your quickest option. Only store uuid if you need to do something with them offline
?paste
WeakReference<Player> 😁
FastAsyncWorldEdit-Bukkit-1.16-735
i- is there something i'm not doing right here?
Fixed entity and map players
Oo hmm Ima check that out
😌
Alright let me find the docs for you. Want to continue in DMs since there are a lot of other conversations here?
olivo
What
i got the logs
oh
Update Lombok
how do i create an offline player object using just the player name? btw its not a real player that ever joined the server, but SkullMeta#setOwner(String) is deprecated and now i have to use SkullMeta#setOwningPlayer(OfflinePlayer), but it doesnt accept a string, only an offline player
Server::getOfflinePlayer
okay
Sounds good 👍
I just spent 45 minutes debugging a ringing noise on my left speaker
I was like "what's this metallic interference noise I keep hearing on semi-low sounds?"
the player name i have never joined the server, i dont know the uuid, i just have the name
pass the name then
And do it async
async? how, and why
and getOfflinePlayer(String) is deprecated too, does it work anyway?
ok
so like this
temStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) skull.getItemMeta();
meta.setOwningPlayer(instance.getServer().getOfflinePlayer(skinName));
skull.setItemMeta(meta);
Hi, I have a problem. my code is sending 2x commands/messages
What should I do?
Code:
package com.civciv.avalon;
import org.bukkit.ChatColor;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.potion.PotionEffectType;
import javax.xml.stream.Location;
import java.io.Console;
public class SaklambacTool implements Listener {
GrapplingHook plugin;
public SaklambacTool(GrapplingHook plugin) {
this.plugin = plugin;
}
@EventHandler
public void onInteract(PlayerInteractEntityEvent event) {
String prefix = plugin.getConfig().getString("saklambactool.prefix");
String ebeledin = plugin.getConfig().getString("saklambactool.ebeledin");
String ebelendin = plugin.getConfig().getString("saklambactool.ebelendin");
String ebeyiebeleyemezsin = plugin.getConfig().getString("saklambactool.ebeyiebeleyemezsin");
Player player = event.getPlayer();
Entity entity = event.getRightClicked();
if (event.getRightClicked() instanceof Player) {
if (player.getInventory().getItemInMainHand().getItemMeta() != null && player.getInventory().getItemInMainHand().getItemMeta().getLore() != null
&& player.getInventory().getItemInMainHand().getItemMeta().getLore().contains("§4§lETKINLIK ESYASI")) {
if (((Player) entity).hasPotionEffect(PotionEffectType.GLOWING)) {
player.sendMessage(prefix + ebeyiebeleyemezsin);
} else {
player.sendMessage(prefix + ebeledin);
entity.sendMessage(prefix + ebelendin);
((Player) entity).performCommand("spawn");
}
}
}
}
}
?paste
Anyway the issue is caused because that event can fire twice, once for each hand
Check the hand before using your code
how do I set a Players max health? player.setMaxHealth() is deprecated?
I will try thx
Can someone please point out what I might be doing wrong here
can someone help me download the plugins and then a mod or whatever its called
What
?bt
Also spigot only runs plugins, not mods
Check if spigot is in your local maven repository and reimport your maven project
yeah sorry I get confused
can you help me though?
^
uhhhhh how do i do that
What exactly?
how do I import it into mc
i'm not sure where my local maven repository is-
C:/users/YourUserName/.m2
Just run the jar file
Usually with a /bat file to set min and max ram
I just joined, what issue are you having on your mac?
i- i think i need to check if spigot is in my local maven repository since the org.bukkit doesn't seem to be in the buildtools.jar for me
get back in #help-server, dont ask the same shit in multiple channels
ok have you ever build a spigot jar file before on your mac?
not on my mac but i have on my windows laptop before
oh ok , then your gonna have to start a .jar build so that you can have the Mac install what you need to be able to compile the .jar file.
what do you mean by .jar build?
build tools
buildtools
oh, i installed them from the spigot website if that's what you mean?
do you have knowledge on using the terminal on your mac?
installed what?
yes
the BuildTools.jar
so downloaded, you have to run that to build spigot jar
guide for building it ^
look at your main harddrive, look under users, select youe username and see if it show anyfiles that say apache-maven or modules.
yeah that could be the issue
Soooo thx, I've been dealing with this for 2 days, it finally done
so while i have buildtools.jar in my downloads, i then ran java -jar BuildTools.jar --rev 1.17.1 in the terminal, and now i have the apache-maven folder
do i then use the same BuildTools.jar as the external archive?
ok good , youshould also see a spigot - 1.17.1 .jar file in the same folder
Did you call the PortalClass constructor in the onEnable method?
wooo it's working now :D thank you kind people
your welcome. congrats on the build!
Of course... the listener runs fine. The event does not.
No problem :)
I'm just using EntityPortalEnterEvent and will add a cooldown for the check.
?paste
[17:20:43 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'announce' in plugin AbsenceBasics v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_292]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
why doesnt this error say anthnjg
not spigot, but in AbsenceBasics it seems to have managed to register a null command class
announce command
yea but every single command is like that
i was just adding extra config files
i think it not readign config right bcuz liek every command reads from ocnfig
Hey I need some help
[22:33:26 INFO]: java.lang.UnsupportedOperationException: Use BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)
[22:33:26 INFO]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:656)
[22:33:26 INFO]: at xray-1.0.0-all.jar//io.th0rgal.xray.XrayCommand.lambda$new$1(XrayCommand.java:21)
[22:33:26 INFO]: at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.executors.IExecutorNormal.executeWith(IExecutorNormal.java:43)
[22:33:26 INFO]: at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.CustomCommandExecutor.execute(CustomCommandExecutor.java:114)
[22:33:26 INFO]: at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.CustomCommandExecutor.execute(CustomCommandExecutor.java:102)```
Java 16, 1.17:
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin,
new Renderer(player,
50,
(Block block) -> block.getType() == Material.DIAMOND_ORE),
0,
10L);```
Renderer: https://hastebin.com/xafijoxazu.java
only hello debug is displayed, the run method is never called
instead I get this error
note: 'runTaskTimerAsynchronously(org.bukkit.plugin.Plugin, org.bukkit.scheduler.BukkitRunnable, long, long)' is deprecated
I didn't understand how to use a Consumer<BukkitRunnable>
deprecated
[22:33:26 INFO]: java.lang.UnsupportedOperationException: Use BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)
Use new Renderer().runAsync instead
;/ replied to wrong message but yeah
Newb Question here - - developing 1st plugin and am looking tag custom items such that I can react appropriately later on (e.g. if a player drinks a custom potion, then want to replace the fully potion with an empty water bottle [which doesn't happen automatically]).
Anywho... what is Lore used for? is it a property bag where I can drop some custom attribs & read/test-for those attribs later on to deduce if this itemstack is something that is part of my plugin?
Lore is text displayed when hovering on the item
?pdc ^
ah -k thnks for pointers. "PDC" is... ah nm 🙂 thanks again.
Great thank you
That error means the bungee couldn't connect to the server. Go to #help-server since you're not programming anything
pp
https://paste.md-5.net/amoyuyefud.cs guys any ideas for this?
a question does the onCommand always need to return a boolean
Yes
how do i get all the files in my server's main directory
uh no
im trying to make a method which will look through all the folders and see if one contains a level.dat files
i know how to do it if i'm given a folder, but idk how to loop through all files
mmm in my entity drop item event listener, how do i tell if the itemdrop was created by a player? so far i have
if(event.getEntity() != ???) but idk what the ??? is supposed to be
I think ItemDropEvent lets u get the player
do mob loot call the event also?
The EntityDeathEvent has loot iirc
sorry for the late reply, but this is also called when like a mob drops an item when it dies
does minecraft worlds have uuid
oh okie
Just use the seed
You can guarantee similarity without storing multiple longs or serializing the uuid
And ensuring the world is unique
if two worlds have the same seed?
so theres this plugin called voidGenerator
it generates void worlds
is there a better method of making void worlds other than removing every block when a chunk is created?
how 2 make tab compeletye
Using Creature Spawn Event is there an attribute that can be added to a creature such as setAfraid or setScared? To make the mob run away from you, kinda like when you hit a passive mob.
You could use EntityTargetEvent
wouldn't this make the mobs come towards the player?
says in the docs it sets what the entity will target
What if you set the target to null?
That seems like it would just stop the entity from targeting anything
not sure though
isn’t that what you want
Im trying to get the mob to run away from the player, Kinda Like when you hit a passive mob
ah
public class EntityDropItem implements Listener {
@EventHandler
public void onEntityItemDrop(EntityDropItemEvent event) {
System.out.println(event.getEntityType() == EntityType.PLAYER);
if(event.getEntityType() == EntityType.PLAYER) {
event.setCancelled(true);
}
}
}
public class Main extends JavaPlugin {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new EntityDropItem(), this);
getServer().getConsoleSender().sendMessage("plugin ready");
}
}
can someone tell me why true or false doesn't print whenever i drop an item or when a mob dies and drops an item?
Player closestRunner = null;
double lowestDist = 0;
for (MinigamePlayer speedrunner : speedrun) {
double dist = pp.getPlayer().getLocation().distance(speedrunner.getPlayer().getLocation());
if (dist < lowestDist) {
lowestDist = dist;
closestRunner = speedrunner.getPlayer();
}
}
if (closestRunner != null) {
pp.getPlayer().setCompassTarget(closestRunner.getLocation());
pp.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GREEN + "Pointing to " + closestRunner.getName() + " (" + Math.round(lowestDist) + "m)."));
}```
help lol
any startup errors?
it only points to 1 person
there is probably a 10x more efficient way to do that
but oh well
no, there weren't any errors
How can a EntityType equal a player?
the only thing it warns about is the permissions yml being empty
since when was a player an entity
I believe for a long while
forever
Why was I never told this
bump