#help-development
1 messages · Page 704 of 1
Well... there you go. Using shading and special source plugin together already.
Which issue
noClassFoundExeption for mongo db
First of all... Why are you shading the entire maven shade plugin?
how to fix?
They're not using the maven shade plugin
And wtf is even this?? Thats not the spigot api.
How do you compile your plugin?
i press package button
still java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients
Ok, so step one: Remove the maven shade plugin from your dependencies
Next: Explain what Jaconp:SpigotAPIs is. If you cant, then remove it.
idk what is it
its that https://github.com/Jaconp/SpigotAPIs
no
Then remove kotlin from your project
I can't wait until these enchantment injecting code libraries break
Because they will break. It's unsupported use of internals
how can you make a method to search for a safe location (comparison with the list of material) volumetric spaces?
for structures
This can go as well.
After that run clean once package afterwards
Im not sure you can even easily parse a structure without it being placed in the world.
i got 4 plugins which should i use?

The one without tags
88Mo?
parse a space with a predefined width and height
[00:32:32 WARN]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[00:32:32 WARN]: SLF4J: Defaulting to no-operation (NOP) logger implementation
[00:32:32 WARN]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
does anyone know what this error is
the blocks on the screen are a selected area
So a BoundingBox?
Yeah you can do that. Just go from bottom to top and scan for
passable blocks. If you found one, also check if the block above is passable as well.
down up
In most cases this will lead to a ton of overhead as areas tend to be filled with air at the top
@lost matrix still the same error java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients
Open the jar and check if the lib is shaded
how?
is this the best option?
jars are just glorified zip files
winrar or 7zip will do
are there better ways?
no but were to search
otherwise I will again have to mess with asynchronous threads (
In your jar.
The path is
-com
--mongodb
---client
----MongoClients
No reason to do that sort of thing async if you don't absolutely need to. All you're doing is comparing block types
If possible I would advise using World#getType() over World.getBlock()#getType() to avoid unnecessary Block instances, but if you need the Block then go for it
You can use different spatial analysis algorithms if you want to.
Its always a tradeoff between precision and speed
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
@lost matrix https://prnt.sc/qA77sdjfXeYN
As before:
-com
--mongodb
---client
----MongoClients
its not here
Ok. Clean your plugins folder
Do a mvn clean
Then mvn install
Then show the jars that got compiled.
ok
Wait this is a completely different exception now.
There is no mentioning of mongodb anywhere.
This exception is not even from your plugin my guy
i dont have this plugin breah
Spigot says you do.
Delete PlugManX
And while you are at it: Never use the reload command
why?
How can i cancel enderpearl consume event? Is it via PlayerItemConsumeEvent
Because both will lead to a ton of problems and break your server in unimaginable ways
still the same error
Uninstall AuthMe
i dont have it breh
Clearly you do or it wouldn't launch with AuthMe
maybe your server jar was modified in some way?
try rebuilding spigot
Its even creating the folder AuthMe but i dont have the plugin wtf
is it injected on any of my plugin
🤷♂️ doubt it
makes me wonder if this is an official distrobution of authme
you had installed
i didnt installed anything
a malware that install authme brehhh
anti malware here maybe?
j make a new server lol
Its adding authme to the server when i build the plugin brehhh
I'd say this warrants looking into it first if it is malware I wouldn't leave it lingering arround
its in one of my pom dependency maybe
yeah, its must be
does the error persist if you remove your plugin?
is it just your plug-in in the server ?
lemme try
i have even open reverse shells just because they use a plugman which it can load remote jars
oof freaky
no
try ProjectileThrowEvent? don't think enderpearls cause consume event
it doesnt have the error
right, thanks bro. I will test it
You'll need to get the Shooter hceck if its player than readd the enderpearl to their inventory
have you heard about enderbutt item? the one you right click it and throw /launch you vertically
well im just code one, but cant stop the item dissapearing from the player inventory
only one i don’t instantly recognize is Foundation
v
oh nvm
fairly popular it seems i doubt it has malware
what about nbteditor @gilded granite
kangarko :kekw:
it'd be better if we got his jar
and decompiled
real
this is legacy as fuck but not malware as far as I can see
do i try removing 1by1?
no send your jar
send your jar
<dependency>
<groupId>com.cjcrafter</groupId>
<artifactId>openai</artifactId>
<version>1.3.1</version>
</dependency>```
what about this one
i cant here
verify if you have forums
i’ve used this openai before
Usage: !verify <forums username>
eww kotlin you can look at that if you want xD
it is not a spigot library
ahhh
no auth me 😅
I wonder what would even want to inject authme 🤔
@gilded granite just to verify issue goes away after you remove your jar right?
!verify LiamCtgn
A private message has been sent to your SpigotMC.org account for verification!
yes
Its 80mb gonna take a while
there's probably a nicer java chatgpt api
idk
If not I'm down to making one myself
I dont use it anyways
it has never appeared before
hello, got a question abt mongodb connections, never understood properly how to connect it cause last time i used it i needed like the host ip, port and more, but now i use atlas and its nothing similar than
its like this: mongodb+srv://<username>:<password>@host.qoymv1e.mongodb.net/?retryWrites=true&w=majority
hypixel clone 
is your ip
u can do //mongoDB
MongoClient mongoClient = MongoClients.create("mongodb+srv://LiamCtgn:pasi@finepixel.ngqtdne.mongodb.net/?retryWrites=true&w=majority");
MongoDatabase database = mongoClient.getDatabase("sample_weatherdata");
MongoCollection<Document> coll = database.getCollection("data");
coll.find();
shit password leak
lmfao
k
i got this Provides transitive vulnerable dependency maven:commons-codec:commons-codec:1.11
Cxeb68d52e-5509 3.7 Exposure of Sensitive Information to an Unauthorized Actor vulnerability pending CVSS allocation
Results powered by Checkmarx(c)
um
and the retryWrites=true and w=Majority its always used? cause im trying to do like this in config.yml
how i can get a #getEntity.getkiller as a entity
because that only contains player
i guess Entity entity = (Entity) player; ?
You can't
guess not
as you said getKiller only returns a player
yes
Do you want to know what killed a player in the death event?
bro how u even manage to have 2gb of dependencies
Idkk
That's the repository index
why its 2gb
I got over 14gb in maven caches
i dont need 2bg
Because there are many dependencies in maven central
breh
no i want to get an mob as an killer
?¨¨
cuz i spawned an mob added the tag in another class so in this class i need to get the mob that contains that tag
You know you can just pass a variable
i can pass the varibale into another class ?
i luv u 7smile7
....
fr ?
most stupid question, how can i place a closed door (even replacing block)
Arent doors placed in a closed state on default?
yes
thought that would not count on spigot or some shit don't know why i specified that
???????????????????????????
can we
?///////
yes obv
Sure. You can pass variables all over your application
Did you try simply setting the block type to OAK_DOOR or something?
Yes. Via the constructor or other methods.
#getStage ig that could work for closed door
like
private String omg;
public YourClass(String omg) {
this.omg = omg;
}
daym
LOL what
but if there's a block on top i think it just breaks
what?
Then check the block on top before 
?
chat gpt in chat minecraft???
what does he give?
chat methods?
oh wait
I was wrong this is for Java and not for plugins
@subtle folio
@river oracle
how to choose what to shade?
Set the scope of what you don't want to shade to provided
I have this beauty of a method which prints the leaderboard of all players for bingo.
It colors the winner in gold and adds tooltip with all finished tasks.
I can't get the sorting to work for some reason. (commented line)
||I can use the Sleep Sort ™️ instead, but I would rather the sorting to work :D||
Anyone got any clue why the sort does not work ?
Create player wrapper class then implement Comparable<T> interface.
who has a directory for building the plugin version and its numbering
tutorial
I don't know what standards you have
what message library is that?
looks interesting
While the data is in PDC, I don't think creating a wrapper is necessary...
After using my brain and remembering how the comparing actually works, I did this
https://github.com/Rayzr522/JSONMessage
But I edited mine so it can do more stuff, you can check my github and the FunnyLibrary
(But looking at the git rn, it seems that it has been updated since I last stole it)
given you're using my minigame lib
or well
my structure for it
don't forget that each phase should also have control of its own tasks
So when the phase cleans up, tasks do too
Oh I do have that, but in this case
I had to use the normal way 'cause they would get cleaned up after the phase ends and nothing would be printed by the sleepsort
then just end the phase after all the messages are sent?
I guess that would have been a way as well lul.
But I did fix the sorting so it don't matter now
yeye
something really weird, the item slot is being found but the item doesnt appear
do you think that must be issue a with my textures?
Inside PlayerInteractEvent
InventoryMenu#open(player) just call internally player.openInventory(this.inventory)
Something more to add, if i listen to the custom click event. The the event.getItem() is not null
This is how im debugging
So far item is not null
So only thing im thinking its a fucking texture issue or if not, no idea what could be happening
I can share fully code if you want
Thats the calling of menu click
Also the item not even appears, adding it via code 💀
@echo basalt most code of MenuInventory:
public class InventoryMenu implements Menu {
@Getter private final String name;
@Getter private final int rows;
@Getter private final Map<Integer, CustomItem> items;
@Getter private final Inventory inventory;
public InventoryMenu(String name, int rows) {
this.name = Chat.style(name);
this.rows = rows;
this.items = new HashMap<>();
this.inventory = Bukkit.createInventory(this, this.rows * 9, this.name);
items.forEach((slot, item) -> inventory.setItem(slot, item.build()));
}
@Override
public Menu set(int slot, CustomItem item) {
this.items.put(slot, item);
return this;
}
@Override
public Menu unset(int slot) {
this.items.remove(slot);
return this;
}
@Override
public Menu update() {
this.inventory.clear();
items.forEach((slot, item) -> inventory.setItem(slot, item.build()));
for (HumanEntity player : inventory.getViewers()) ((Player) player).updateInventory();
return this;
}
@Override
public void open(HumanEntity player) {
player.openInventory(this.inventory);
}
}
yikes reminds me of my first menu lib
what I showed you was v2
you gotta learn to add empty lines for readability my dude
what?
add empty lines for readablility
split the code into logical blocks that belong together
to not burn my eyes and make my head spin when reading the code
no we just mean in your code
so what you need i can do it and explain
he's doing the google "style"
just big fat code blocks
i mean its better to help / give a hand rather to make laught of someone
google style still accepts empty lines
i helped illusion to understand
I have google style as my codestyle in my ide
hmnn too messed up, it just now that my items are not appearing
Ohh you mean IJ style
🤔
LMAO i thought you were talking about my code itself, that wasnt understable what im doing
right, so far the item doesnt appear on the inventory
But while listening to custom menu click event, the item i get from the event is not null
hey!
does anyone know of good way to make "Did you mean"?
e.g.: user inputs "enbled"
but only options are "enable" "disable"
therefore the DYM would tell him if he meant the "enable" option
uhh
word matching
Basically you need to make an algorithm that spits out a "similarity percentage" between 2 strings
And make a comparator out of that
"enbled" is a lot more similar to "enable" than to "disable"
there's a lot of weird cases
Like uhh
accounting for the whole keyboard layout
if I type my input but every single character is offset to the right
so the item exists
but just not gets added
btw updateInventory is redundant
Levenshtein distance
just asked GPT for some example code and it also uses levenshtein :D
tysm for that ref tho!
very helpfull
oh. So far i thought it was something related to bad a parsing from the config. So i directly add the item thru code, but still doesnt appear on it. So far i think is appearing as AIR
:DD
can't wait for the next kid asking us for help with their hypixel skyblock clone
debug the item, check if its the same inventory, check if its added correctly and and and
hey can you help me im making murder mystery
i already checked inventory part and its okay, i also debug all the items from the Map<Integer, CustomItem> and appears everything
Cant you use String#regionMatches() ?
public List<String> getCompletions(String[] args, List<String> input) {
String argument = args[args.length - 1];
return (List<String>)input.stream().filter(string -> string.regionMatches(true, 0, argument, 0, argument.length())).limit(80L).collect(Collectors.toList());
}```
Hey, which event do I use to detect when an player places an item in an inventory?
for taking out of inventory I can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryMoveItemEvent.html
but what do I use for placing Items in an inventory?
InventoryClickEvent
InventoryDragEvent
and a lot of hope & praying
click or drag
I mean i already test what you mean, but still doesnt make sense
at the exact moment a player clicks an item (getClickedItem) he takes it out
on the cursor = not in the inventory
answering me right?
ok, so elaborate it more
Sometimes
Can any1 help i cant shade my plugin idk why
I hate these goddamn lombok warnings
I already turned them off like 13 times and they still keep appearing
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
do you want call so i can share screen?
no stay away i hate people
based
yes but i mean placing in an gui inventory. I want to execute code after the player placed the item in the gui inventory, not the player inventory
?paste ur pom
me?
yes
and the usage of the MongoClients
ok, but i can show more code. What you need?
only the base initialization
pretty sure ur missing some stuff
MongoClient mongoClient = MongoClients.create("mongodb+srv://LiamCtgn:PASSWORD@finepixel.ngqtdne.mongodb.net/?retryWrites=true&w=majority");
try running Class.forName for this class somewhere in onEnable or in your class init or maybe in a static block
it usually happens with jdbc drivers that you need to Class.forName it, in my experience
maybe mongodb also needs it
if not, the problem is probably somewhere in your pom
what?
code
ConfigurationSection kitNpcsSection = config.createSection("kit-npcs");
for (KitNpc npc : kitNpcs.values()) {
kitNpcsSection.set(npc.getPosition().serialize(), npc.getKit());
}
public String serialize() {
return x + ", " + y + ", " + z + ", " + yaw + ", " + pitch;
}
any1 can please help i cant shade my plugin
@sterile token you see what is happening here?
the x y z contains . in them
since they are double
and while im using .set()
the . is being used as a way to specify sections
change the seperator
what's the issue
I think i fixed
why dont you use:
getConfig().set("Location", player.getLocation());
Location loc = (Location) getConfig().get("Location");
Because Location implements ConfigurationSerilizable, so you can just save it and load it without having to manually serialize it
what is the site for mappings
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
i forget alot
hm
WAS THAT
@hybrid spoke Sorry for tagging man, but doesnt make fucking sense
Also i checked 3 times the config to see if everything matches and its perfect
descriptive method name
lmao
how can i make that works if the end is disabled ```@EventHandler
public void onPlayerEnterEndPortal(PlayerPortalEvent event) {
Player player = event.getPlayer();
if (event.getCause() == PlayerPortalEvent.TeleportCause.END_PORTAL) {
event.setCancelled(true);
event.doSomting;
}
}```
what this lol
wdym
if the end is disabled wont this event just not happen?
not much you can do about it
i want it to happend even if the end is disabled
Should i use playermovement event?
i want to teleport the playe when he enter the portal the problem is that the end is disabled
so it doesnt work
Hi , i get a null profile when loading a user , so long story short is i have 8 diffrent profiles that a Player must load when join , but its null for some reason ..
why does this method exist? seems interesting
i have this abstract and i implement it into the Profiles Types :
iam intilizing them when server start :
if it was 1 profile , it will be easy to handle but multiple profiles .. that's hard ..
don't get it?
yes ik , how would i be able to get it to work with multi profiles?
like each profile will load its own data ,
I do it here
Basically you assign each player a profile id
alright let me check it
and use that profile id for all the data
It kinda doubles the latency as you have to wait for the profile ID to be fetched
Before fetching all the data
But it's a decent tradeoff
better than fetching all the profile data
its sideways
the seperator is not the issues, the . in the double is the issue
yes
change the yaml config seperator while setting it
then change it back
the . in the double is no longer an issue
declaration: package: org.bukkit.configuration.file, class: YamlConfiguration
declaration: package: org.bukkit.configuration.file, class: YamlConfigurationOptions
config.options().pathSeparator('@');
ConfigurationSection kitNpcsSection = config.createSection("kit-npcs");
for (KitNpc npc : kitNpcs.values()) {
kitNpcsSection.set(npc.getPosition().serialize(), npc.getKit());
}
config.options().pathSeparator('.');
config.save(data);
like this ?
yeah
ive never seen that
Its when u disble the report or enable craked server
google the error
i just found this https://github.com/KaspianDev/AntiPopup/releases/tag/14a7979
its working
so
nice
breh
yeah
hmm
in my language its not a verb
but yeah its not always used as a name
verb
search for information about (someone or something) on the internet using the search engine Google.
"on Sunday she googled an ex-boyfriend"
oh ma god
how i can get a file and send it via webhook?
in the server folder
i need logs files
I just read i need legs files
Okay im struggeling a little bit with the config file, how can i update my changes made in the Java Editor (Intellij IDEA) to the exactly config file? because right now im doing the following:
this.getConfig().options().copyDefaults(true);
saveDefaultConfig();
in my onEnable() function, but when i start up the server, my config doesnt get overwriten
so there is another issue reading it
well the seperator is @
config.options().pathSeparator('@');
for (String key : kitNpcsSection.getKeys(false)) {
System.out.println(kitNpcsSection.getString(key));
Optional<Kit> optionalKit = KitManager.kitByName(kitNpcsSection.getString(key));
if (!optionalKit.isPresent()) {
throw new IllegalStateException("Unknown kit");
}
npcs.add(new KitNPC(deserializeLocation(world, key), optionalKit.get()));
}
and the output of the sout is MemorySection[path='kit-npcs.4001', root='YamlConfiguration']
ok it is not working
@onyx fjord @tender shard
Job for u cuz u are pros that will crack it
Its not even full secured cuz it doesnt have native inside
what is better to create a region in a certain zone and link the region to the zone itself or link the zone to its locations via math
without linking the region
like in skywars
How are regions and zones different from each other?
?pdc
zone this object
not location
locations - > region
If you want to create regions then you should use BoundingBoxes
i want to associate zone locations with the zone itself via hashMap
location -> List<Location> locations -> zone - but skip step 2
Someone translate this for me pls...
If you want to create a region, use a BoundingBox to check weather a location is within this BoundingBox
are you asking if this is okay?
i ?
why not use BoundingBoxes as Smile says
BoundingBoxes are much faster than whatever you would be doing now
I think what he is trying to do would be impossible
to everyone who uses jetbrains annotations: Here's a tiny gradle task to fix the "double annotation" issue. https://github.com/mfnalex/cesspool/blob/master/buildSrc/src/main/kotlin/com/jeff_media/cesspool/gradle/tasks/FixJavadoc.kt
Usage: ```kotlin
tasks.withType<Javadoc> {
// regular javadoc options ...
finalizedBy("fixJavadoc")
}
tasks.register<FixJavadoc>("fixJavadoc") {
description = "Fixes double javadoc annotations"
group = "documentation"
directory.set(tasks.getByName<Javadoc>("javadoc").destinationDir)
}
I just heard that there is a way in which mathematics is used in the skyWars islands where you can get the center of the island from anywhere in the location
Yeah. Thats a BoundingBox
^ BoundingBox go brrrr
oh
Does all the math for you
Yes its spigot api.
BoundingBox.of(...)
is your entry point
does the Bounding Box work if it's not an island but a zone on the field?
You are mocking us, dont you?
no really
Bounding boxes always just work
the math doesn't change no matter what you call your area of coordinates
that's the beatiful thing about math
it just is
A BoundingBox defines a box between two locations x and y.
?jd-s
the problem is that the 2nd point may be unknown...
Location locationA = ...;
Location locationB = ...;
BoundingBox boundingBox = BoundingBox.of(locationA, locationB);
// Get the center of the box
Vector center = boundingBox.getCenter();
// Check if a location is within the box
Location locationX = ...;
boolean isInside = boundingBox.contains(locationX.toVector());
Then you cant create a region
@Blocking
@Override
public synchronized boolean reload() {
return config.reload() & messages.reload();
}
bois this will call both reloads right? no matter what they return
Not with spigots api, not with worldguard and not with anything else.
A single point is just a single point.
but how is it used in skywars if they do not know the 2nd point?

I heard somewhere that in this formula it is necessary to divide by 16
Ok lets take a big step back.
You are riddling in absolute, incoherent gibberish.
What are you trying to do. Give us the whole picture.
I got donowalled feelsbadman
F
It's been like this all week
Yes
Associate all locations in a defined allocated zone with the zone itself (As an object) and so that I can get the zone via location from any of its points of contact via HASHMAP
Ok. How do you define a zone?
Mans really picky about his hashmaps
location -> zone classlocation -> zone class
He basically wants a sort of octree
And a zone has a defined size, right?
zone is auto mine
What if we made a hashing algorithm that makes a zone id based on its position and size
end get mine object location -> AutoMineClass
That way we can use your stupid hashmap
What do you mean by that?
this better then search region
A mine has a defined size, right?
It has two corners.
location -> region -> object or location -> object
so this is why i use 2 step
2 option
this dude does not know what he's talking about
yes mine have size
but for this you need to know 2 points and I have only 1 anywhere
You cant define a zone with one point
If you have one point then there is no location which is inside
Hi, this is my pom.xml and I am trying to import protocollib dependency, but for some reason it just shows this. Does anyone now what can be wrong? And yes, I reloaded my maven
You create a boundingbox around the each island
For which spigot version?
1.19.2-R0.1-SNAPSHOT
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
*PS: Make sure to add the repository of dmulloy
I'm sorry, but I'm Russian is to blame for the fact that I'm not able to express my thoughts the translator)
Oh you are from there...
translate sack
well, I have repository and changed the dependency to what you send me, but it shows the same error
even now translated not properly
Show your pom pls
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.
who is Russian here, let me explain the problem in a personal
Spigot policy does not allow
another language
Use java 17 instead of 1.8
Other than that, just reload your maven project with one of IJs buttons on the top right
I have java version 17 in project structure, but idk why is it 1.8 in pom so I changed it. And also, I reloaded the pom like 10 times, but still not work
Change the order of spigot and plib in your dependencies
spigot first
done, still doesn't work
What happens if you just mvn clean install
OMG it worked. Thank you so much, you just saved me like 3 hours of time.
[WARNING]
[WARNING] Plugin validation issues were detected in 3 plugin(s)
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING] * org.apache.maven.plugins:maven-shade-plugin:3.2.4
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
anyone know hwy im getting this when I build? I haven't worked on this plugin in a while and now im getting a warnings from maven
Probably because of using not the latest version of those plugins
ah
makes sense
any way to update easily?
ok for some reason my plugin just completely breaks....
not even showing up on plugin list anymore
is this the correct way to get all tasks of a type?
its clearly there but it doesn't show up
all I did was build then override current ver
now it just doesn't work...
and I get build success
here are logs
[21:22:28] [Server thread/ERROR]: Could not load 'plugins/AnarchyCore-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalStateException: Cannot get plugin for class com.possiblepanda.anarchycore.AnarchyCore from a static initializer
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:433) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: Cannot get plugin for class com.possiblepanda.anarchycore.AnarchyCore from a static initializer
at org.bukkit.plugin.java.JavaPlugin.getPlugin(JavaPlugin.java:404) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at com.possiblepanda.anarchycore.AnarchyCore.<init>(AnarchyCore.java:15) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?]
at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?]
at java.lang.Class.newInstance(Class.java:645) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:79) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 7 more
Pretty clear
yeah I saw that but I have no clue what that means
havent done java and spigot in ages
You are doing some sketchy stuff in your plugins constrcutor
I think I may know why
AnarchyCore.java:15
I'm surprised that this compiles
lol
null!!
yeah shouldnt it cause a compilation error or sth lol
"null can't be not null" or sth
do null?:null!! XD
Wait
Thats not the right operator
Whats that one operator named after a singer
?: elvis operator
very famous poet
t u r b o f i s h gang ::<>
!! is just a runtime assertion iirc
what's the difference between TaskContainer#create(...) and #register(...) ?
ah, apparently register is lazy whereas create isn't
That means …? :d
don't wanna spend that extra build time in creating something that isn't gonna be used
Ah
So im going to create a custom task, my plugin implements Plugin<Project> - can I somehow change ALL Javadoc tasks to run my custom task after them?
I also need to pass those Javadoc objects to my task
isnt this usually configured in your build.gradle when you decide to use that task?
my task fixes an issue with the normal javadoc generation, hence when people use my plugin, they 100% wanna run it on all Javadoc tasks automatically
otherwise they woudln't be using my plugin
(it removes those annoying double annotations from the generated html files)
uh you can do something like, TaskContainer#all<Javadoc> { finalizedBy("myOtherTask") }
yep I'm currently doing that but how would I then get the Javadoc task from within my task?
I feel like my task should not extend/implement DefaultTask but sth else
What if other javadoc tasks are registered after yours?
I don't know
i'd do something like, for each javadoc task register a fix<JavadocTaskName>Javadoc and your FixJavadoc task have a Directory as input property (via ctor or configure it in-place)
methods like all call your callback for existing and future...ly registered tasks
(specifically withType(Class<T>), then others derive from that)
my task currently looks like this but it's not getting called at all
I'm registering it like this, and it does print "FixJavadocTask is being applied to javadoc"
ok I'm registering them like this:
when I run javadoc on my project now, ofc gradle complains because my TaskACtion method requires a Javadoc object
An exception occurred applying plugin request [id: 'com.jeff-media.fix-javadoc', version: '1.0-SNAPSHOT']
> Failed to apply plugin 'com.jeff-media.fix-javadoc'.
> Could not create task ':fixJavadoc'.
> Cannot use @TaskAction annotation on method FixJavadocTask.fixJavadoc() because class org.gradle.api.tasks.javadoc.Javadoc is not a valid parameter to an action method.
ew you are infected?
feeling sick today?
yeah I've been drinking yesterday and still hangover. 10mg diazepam, 1mg clonaezpam and 0.5mg lorazepam didn't help so yeah I'm writing gradle plugins now
by this i meant something like
class FixJavadocTask @Inject constructor(val task: Javadoc) : DefaultTask() {
// ...
@TaskAction
fun run() {
// ...
}
}
// apply(project)
project.tasks.withType(Javadoc::class.java).all {
val fixTask = project.tasks.register("fix${name}", FixJavadocTask::class.java, this)
finalizedBy(fixTask)
}
hmmm
An exception occurred applying plugin request [id: 'com.jeff-media.fix-javadoc', version: '1.0-SNAPSHOT']
> Failed to apply plugin 'com.jeff-media.fix-javadoc'.
> Could not create task ':fixJavadoc'.
> Could not create task of type 'FixJavadocTask'.
> Unable to determine constructor argument #1: missing parameter of type Javadoc, or no service of type Javadoc.
line 14 you aren't passing the task to the create ctor arguments 🍹
uuugh right I'm stupid
I rewrote the whole thing so I don't have duplicate code for main project and subprojects, then forgot to call the new method lmao
thanks
hmm now I get this
- In plugin 'com.jeff_media.fixjavadoc.FixJavadocPlugin$Inject' type 'com.jeff_media.fixjavadoc.FixJavadocTask' property 'task' is missing an input or output annotation.```
Or make the getter private
adding Input to the constructor worked
However now my issue is that it only detects the Javadoc tasks of the root project
abstract class FixJavadocPlugin : Plugin<Project> {
override fun apply(project: Project) {
println("Applying FixJavadocPlugin to whole project...")
println("Checking Javadoc tasks of root project:")
project.tasks.withType(Javadoc::class.java).forEach { javadocTask ->
println("Found javadoc task: ${javadocTask.name}")
addFixJavadocTaskToJavadocTask(project, javadocTask)
}
println("Checking Javadoc tasks of subprojects:")
project.subprojects.forEach { subproject ->
subproject.tasks.withType(Javadoc::class.java).forEach { javadocTask ->
println("Found javadoc task: ${subproject.name}/${javadocTask.name}")
addFixJavadocTaskToJavadocTask(subproject, javadocTask)
}
}
}
now when I run gradle javadoc on a subproject, I get this
...
> Task :buildSrc:jar UP-TO-DATE
> Configure project :
Applying FixJavadocPlugin to whole project...
Checking Javadoc tasks of root project:
Found javadoc task: javadoc
Checking Javadoc tasks of subprojects:
> Task :shared:compileJava UP-TO-DATE
...
why are you rewriting your stuff in kotlin in the first place
Something like
project.afterEvaluate((var10001) -> {
project.getChildProjects().values().forEach((child) -> {
});
});
I guess
it's a gradle plugin
Also in case you ask, I have no idea what afterEvaluate does
it just defers it to a further phase of the configuration as far as I know, useful when something isn't set during the apply logic, like some extensions' values
Yaay! Thanks, that did the trick
last question, how can I set the "group" name of a task created by code?
Good thing you can code otherwise I'd be hard-pressed to convert that to groovy
using build.gradle.kts I can declare tasks like this, including group and description
I do it like follows:
project.getTasks().create("deployMods", GslDeployModsTask.class, (task) -> {
task.setDescription("Deploy mods to the extension directory of the development environment.");
task.setGroup(TASK_GROUP);
});
if you have the kotlin-dsl plugin applied, you can do the same things as in the build scripts
You probably can invoke setGroup in the task's constructor though
thank you @slender elbow and @quiet ice , I got everything working now!
This also reminds me that I should get rid of my fromJar hack I have in that project considering that Project#zipTree exists
is it possible to override a method of a class?
like spigot have class RegisteredListener with method callEvent, and i wanna override that method
?
Just FYI, you don't have to delete your old message
ofc, with an extending class
unless the class or method is final, ofc
What exactly do you mean with override?
?jd-s
RegisteredListener.callEvent
What I am saying is that your query makes 0 sense
You shouldn't write custom implementations of that class unless I am sorely mistaken
It's been a while since I've been working with bukkit though so it could very well be that I'm rusty
I need to override a method to call other functions
yay
Override as in replace/overwrite the bukkit implementation? That is any call to RegisteredListener#callEvent will forward to your method?
like
old:
public class RegisteredListener {
public void callEvent(final Event event) throws EventException {
if (event instanceof Cancellable){
if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){
return;
}
}
executor.execute(listener, event);
}
}
custom:
public class RegisteredListener {
public void callEvent(final Event event) throws EventException {
if (event instanceof Cancellable){
if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){
return;
}
}
System.out.println(event.getName());
executor.execute(listener, event);
}
}
why would you want to do that
to handle bukkit events from another programming language
Did you forget to extends RegisteredListener?
for what
i need to override
Use PluginManager#registerEvents then
but it need to register every events
What you are asking for is overwrite I fear
so u want to listen to all events?
yep
Hm what do you mean by handle?
Because this can have an enormous impact on the servers performance.
Which language and how does the cross application communication look like?
RegisteredListener only wraps your registerEvents call in the first place
well there is a good post on this, here https://www.spigotmc.org/threads/listening-to-all-events-listing-all-events.337466/
there isnt rlly a good way to do so unfortunately
as far as i know
Why can't the plugin in the other language just register the events it wants
Dynamic typing I fear...
There's tonnes of python and JavaScript plugins that do fine
At which point you'd have to cleverly work around this limitation
i can just list all the events and register them via registerEvent, right?
Basically
MyRegistwredLustener extends RegisteredListener {
[...]
@Override
public void callEvent(Event e) {
// [...]
}
Again,why
for listen all events blyad
It seems you are unfamiliar with OOP
?xy
Asking about your attempted solution rather than your actual problem
You would have to do classpath scanning and register listeners this way.
But there has to be a better way. You are also ditching listener properties like
the event priority with this approach
Task :publishPlugins
Publishing plugin com.jeff-media.fix-javadoc-plugin version 1.0
Thank you. Your new plugin com.jeff-media.fix-javadoc-plugin has been submitted for approval by Gradle engineers. The request should be processed within the next few days, at which point you will be contacted via email.
yaay
noice
what's the equivalent of Function<T,R> in kotlin? kotlin.Function only seems to have one return type parameter
How do you prevent a certian item from dropping on death
e.getDrops().remove(item); doesn't work
whats broken in javadocs
like what does the plugin do
ok nvm fixed it
I assigned 4 skins to 1 block with minecraft variations, but can I use a command to use the wood variation I want, for example /give minecraft:oak_planks textures:oak_purple
Can I choose the model I want in the same way, when I added 4 variation models to 1 model with variation
?nms
Is there any tutorials to write "clean code" or something like this? Because the plugins that i'm creating are working but... I'm not sure that this code will satisfy somebody or something like this
writing "clean code" is stupid
write good code
if you want to get your code reviewed #1100941063058894868
Like i'm always thinking how to make code look clean, and readable but i dont know java too good to make it look well
I'm afraid of showing code to advanced people
🥲
then you'll never improve
either you have to learn your code is shit or someone has got to tell you :P
personally I've felt self acceptance is the best method
my code sucks
Oh ok, i'll try
Is there an easier way to wrap a Player object like this so I can add custom methods and things to it, without having to have an AdagraPlayerManager to store a hashmap of all online AdagraPlayer objects?
Help me plss 😭
I assigned 4 skins to 1 block with minecraft variations, but can I use a command to use the wood variation I want, for example /give minecraft:oak_planks textures:oak_purple
That’s not how textures work, no
There are some very good videos on it
Do you want a link?
can one publish gradle plugins to a normal maven repository?
Im wondering because it uses the fully qualified plugin name as artifact id
Epic are you using jetbrains annotations?
Ağh thx
is there a javadoc option to get rid of this "external link" button?
So can I do it with a plugin, if I write a plugin, can I choose the variant texture I want or can I put it
Pretty sure i do
annotations or annotations-java5?
never back down never what?
Never give up
i’m bored idk what to code though
does it also cause the "double annotations" issue for you?
Probably not without modifying the base stylesheet. If you can find that though, you can just add this to it.
a::after {
content: none;
}
Looks like you can specify your own stylesheet, but I haven't found anything about modifying the base sheet.
https://maven.apache.org/plugins/maven-javadoc-plugin/examples/stylesheet-configuration.html
thanks, I'll check that out later
@remote swallow can you please try whether you can use my plugin and/or whether it works fine? https://github.com/mfnalex/gradle-fix-javadoc-plugin
a::after {
content: '';
}
if it is an "a" tag
That's already set on the default javadocs. If you want to truly remove it, you set it to none. Alternatively, you can set background-image: none since some docs like to use that instead of specifying the icon in the content tag.
I guess you could also do display: none, but maybe there's a reason to keep it in the dom.
if you want to keep it visibility: none
True true. It's all going to depend on what the CSS standard javadocs support.
@slender elbow would be useful to use that in paper, they still have the double annotation problem
I haven't had the best luck with CSS and native Java. I don't think it's even CSS5
Anyone knows how to make a shake effect?
you can use a repeated task and teleport the player while only changing their pitch and yaw
I think that would be more mod territory. Although a shader might be able to produce that effect.
Because I use oraxen and i want to do that when the item has been used, it produce a shake effect to all the near player
I guess it just depends on what you define shake as.
Are you talking about a real screen shake effect?
Or maybe something like a ground shake?
screen shake
idk if it is possible to do ground shake
Ground shake can be simulated (although would probably be a little intensive).
To the best of my knowledge, screen shake is not something that's achievable without mods. Like I said before, a resourcepack shader might be able to do that, but that requires knowledge of how to write shaders.
but this can't works?
That can work if the player is stationary. If you want the player to be able to look around while the effect is happening, it might start to look a little buggy.
and how to make gorund shake effect?
A lot of display entities. Get a radius around the player, get the topmost ground layer, set to barriers, spawn block displays in their place, have them shake a bit, maybe spawn some particles, gradually reduce shakiness over time and once done, return blocks to their original state.
Have that happen while the player is moving to have it happening all around them.
That's the rough idea. ^
Could probably do some better method when it comes to determining the blocks to select for shaking.
You could also do some of that with Player#sendBlockChange() so the server isn't killing itself.
Would be nice if we had the /camera command that bedrock has. It has screen shake functionality built in.
best way to host a webpage off of a plugin?
[20:44:07 ERROR]: Uncaught exception in thread Profile Lookup Executor #36596
java.lang.NullPointerException: null
[13:35:59 ERROR]: Uncaught exception in thread Profile Lookup Executor #52
java.lang.NullPointerException: Cannot invoke "java.util.Optional.isPresent()" because "optional" is null
at net.minecraft.Util.ifElse(Util.java:448) ~[?:?]
at net.minecraft.world.level.block.entity.SkullBlockEntity.lambda$updateGameprofile$5(SkullBlockEntity.java:141) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
Why does this error happen on my friends server? im assuming its smth with the world but im not entirely sure
Does world.getChunkAt(x, z) not work async?
No, as it loads the chunk
Ah makes sense
I am trying to count value for chunks and need to find certain blocks and tile entities :l
you can get a ChunkSnapshot sync'ed and then you can use that to check all the blocks inside that async
help me? I'm trying to make the player, when placing a seed in the plowed land, 3 blocks next to him to be planted with a seed also automatically, but he is breaking the block instead of planting.
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (!plantingSkillActive.getOrDefault(player, false)) {
return; // Se a habilidade não estiver ativa, retorne e não faça mais nada
}
// Verificar se o jogador clicou com o botão direito em um bloco
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
ItemStack itemInHand = player.getInventory().getItemInHand(); // Obter o item na mão do jogador
// Verificar se o item na mão é uma semente
if (itemInHand != null && itemInHand.getType() == Material.SEEDS) {
Block clickedBlock = event.getClickedBlock();
// Verificar se o bloco clicado é terra arrada
if (clickedBlock.getType() == Material.SOIL) {
// Tentar plantar sementes em até três blocos ao lado
for (int i = 1; i <= 3; i++) {
Block nextBlock = clickedBlock.getRelative(BlockFace.NORTH, i);
if (nextBlock.getType() == Material.SOIL && !player.getInventory().contains(Material.SEEDS)) {
break; // Se o jogador não tiver mais sementes, saia do loop
}
if (nextBlock.getType() == Material.SOIL) {
nextBlock.setType(Material.CROPS); // Planta a semente
removeSeedFromInventory(player);
} else {
break; // Se um dos blocos não é terra arrada, saia do loop
}
}
}
}
}
}
obs: spigot 1.8.8
It doesn't seem to include data though only the material
it should include BlockStates and BLockData just fine?
You are setting the block to crops, crops go ontop of the block nextBlock.getLocation().clone().add(0, 1, 0).getBlock().setType(Material.CROPS); // Planta a semente
How the heck do I use ints within block data 😢
Thank you very much
I am using 1.8, that seems to be a newer thing 😦
Doesnt seem like i can do anything with it
Ugh I wonder if it is more efficient to do 2 loops
One can loop though chunk snapshots to count blocks, another on main thread loops tile entities for spawner and chests
hey there, how can I cancel the drop item event, with perishing the item?
I mean, I just want to make that item disappear, preventing it from giving back to player?
The problem is: I set the item cursor for player, then they/them close the inventory & it'll given back to the player, which i don't want to.
can't you set the cursor to null in InventoryCloseEvent=
Hello , i have a problem with mysql not updating value , well its but after 4 , 5 times of try to change it it stop
no errors nothing
is something wrong with these too?
did you mean me?, well nah, InventoryCloseEvent doesn't have setCursor, I cancel dropping the item by PlayerDropItemEvent & checking if there is a custom inventory open.
Should I use firstEmpty() on player's inventory and call setItem() by that to null? are there any better workaround for this?
fix it and
?tryandsee
?
Does ChunkSnapShot's snapshot.getHighestBlockYAt(x z) count tile entities
isn't setCursor a method in InventoryView?
declaration: package: org.bukkit.inventory, class: InventoryView
The problem is when should i have to call it?
InventoryCloseEvent?
not sure, i haven't looked into your problem, just noticed that you said you coud;n't find the method
Yes, thanks, i had to mention about finding that setCursor function, sorry
where to find documentation about plugin.yml what command is database: true. I did not find its description on the Internet
oh great i found it
My code just use an ArrayList#add("Something") how is this possible to the index -1?
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
at java.util.ArrayList.add(ArrayList.java:455) ~[?:?]
at java.util.ArrayList.add(ArrayList.java:467) ~[?:?]
Why do i have hardcore hearts when my plugin is loaded?
Is it possible to save and load ShapedRecipes to/from config?
// ShapedRecipe shapedRecipe = (ShapedRecipe) section.get(key);
Something like this or is there any easier way?
are you using add(index, element)?
No
tf
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Got bored, going through bukkit plugin requests again.
What would even be a good way of implementing this? https://bukkit.org/threads/command-on-date-time.331746/
I guess limiting checking to only on plugin start? But that doesn't help if the date passes while the server's already enabled 🤔
check current time every 20 ticks and compare it to every scheduled task (>= so it runs if its late too)
md_5 please, help me
True, but that is a lot of checking for something that could be a year+ from whenever 🤔
if youre concerned about performance you could place them in diff blocks based on week or something
and then check every 5 minutes whether shit needs to move to the next block
and only check the upcoming/front block every second/5 seconds
Performance isn't really the issue, just seems like a lot of pointless scheduling lmao
That code seems to be the easiest way.
I am also trying to handle itemStacks that contain pdc, any custommodeldata and so on....
I would like to create crafting recipes with weapons from WeaponMechanics (Crackshot) for example
yea, and it could be a lot of repeated tasks which aren't really needed 🤔
no only one
which goes through every task
in the first block
and one which runs on start and like every hour
which updates the blocks
You just sort the tasks by time and stop that execution once you reach one in the future
like a subscheduler
Ich search for a plugin wich do a command on a date e.g. at 5.5.2015 at 15:05 the server use the command ¨/say hello¨ or somthing.
so it would be configured something like
times:
date: <command>
date: <command>
date: <command>
At least my guess 🤷♂️
true
better system
ig
well, it's what makes the most sense for their request
You have a completely arbitrary date & time, with a command assigned too it
is pulling an item from an array deque expensive
Linkedlist would be fine
yeah
just curious
if they dont have some kind of magic unsafe pointer shit or smth
instead of moving the array
Elgarl sent code for that a bit ago
If it were just year-month-day. It wouldn't be difficult to just
every IRL day, check the date via LocalDateTime
but it's the arbitrary time that's the fun part ig
@eternal oxide wheres the code to run something at an exact time
would still have to do the calculations needed to make sure the scheduler isn't fucked in terms of sync, but it wouldn't be hard
it's faster if you remove a lot of elements in a loop, otherwise go with linkedlist
yeah linkedlist would be better here
wait, no, ScheduledExecutorService is a thing
&
public boolean isActive() {
LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());
boolean sameMonth = now.getMonthValue() == this.monthDay.getMonthValue();
boolean sameDayOfMonth = now.getDayOfMonth() == this.monthDay.getDayOfMonth();
return sameMonth && sameDayOfMonth;
}
it's the specific time that's the problem lmao
/**
* Schedule every Monday.
*
*/
public void schedule() {
LocalDate nextDate = LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.MONDAY));
Long midnight = LocalDateTime.now().until(nextDate.atStartOfDay(), ChronoUnit.MINUTES);
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(()-> { /* Code here */ }, midnight, TimeUnit.DAYS.toMinutes(7), TimeUnit.MINUTES);
}
this is what he sent
not really what's needed here though, given the amount of arbitrary data
Hey, could someone help me in bungee development?
https://www.spigotmc.org/threads/saving-configs.618236/
Thanks!
Scheduling something for a specific month & day within that month isn't the difficult part.
It's getting the time correct that's the problem.
e.g. it could be 1hr, 1min, 1sec or 1hr, 1min, 2sec
You could get by with just https://paste.md-5.net/iraqupubem.java, but noooo
arbitrary time
(╯°□°)╯︵ ┻━┻
If I want to spoof the PacketPlayOutMap packet, when should I send it? when MapRenderer#render is called? Delay it maybe?
Listen for when the packet is sent by the server and send your own one instead?
That is an option, yes
okay so
i havent seen anything like it yet but is a health/hunger "bar" like wizard101 as a little ball in the bottom left possible
With a resourcepack, yes. It will just be a bit tricky if you want numbers inside as well
the numbers were the one part i did know
but it would always occupy a hotbar slot for it so it would be a bit annoying
You can use the action bar for this
duudeee
i forgot that thing even existed
but could i make it go downwards? im pretty sure i can move it to the left as much as i want but idk about down
Yes with some font magic you can move it to the left, right, down and up
This screenshot shows how sprite characters look like in chat and in the action bar
And here you can see that symbols are moved in different directions.
e ok please can someone explain me how can i pass a variable into another class because i cannot make it the variable public or protected and i cannot get the instance of the class
Dependency injection
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Also remember about getters and setters
Check the linked wiki article
alr
that can pass variables as wel l?
ok so if i have a variable of i = 0; for example how can i use this i into another class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i cant understand that ....
Maybe you should like explain why you variable is like it is
It's a basic concept
Send your class
me ?
Yes
Yes
WitherSkeleton ent = Bukkit.getWorld("world").spawn(player.getLocation(), WitherSkeleton.class);
ent.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither Skeleton");
ent.setCustomNameVisible(true);
ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
ent.getEquipment().setItemInMainHand(new ItemStack(item));
ent.setMaxHealth(2048);
ent.setHealth(plugin.getConfig().getDouble("Ancient.health"));
ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, Integer.MAX_VALUE, plugin.getConfig().getInt("Ancient.strength")));
ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, plugin.getConfig().getInt("Ancient.speed")));
ent.getNearbyEntities(30, 30, 30);
Double x = ent.getLocation().getX();
Double y = ent.getLocation().getY();
Double z = ent.getLocation().getZ();
PersistentDataContainer ancdata = ent.getPersistentDataContainer();
ancdata.set(new NamespacedKey(Bosses.getPlugin(), "anc") , PersistentDataType.STRING , "anc");
ent.addScoreboardTag("s");
here simple thing
i want to accsess that "ent " variable into another class
ain't the first time I'm telling you
That isn't the class
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.
omg
bro
in java u can just make the variable protected or public and get the instance of class and boom u can accsess the variable
One of the 4 principles of OOP is Encapsulation
but its not letting me define the variable as protected or public
Collections are also a thing
cuz ur doing it in a dang method
Send your whole class
sometihng u should know
how
...
You copy your whole class?
Ctrl + a, ctrl + c
That's like when I was little, my dad taught me how to use computers. One thing he taught me was Ctrl + c, ctrl + v

