#help-development
1 messages · Page 1058 of 1
Hi can anyone help how to make authme not leak the cords when logging in
sounds really nice! Do you have some showcase?
You should ask for help in #help-server, this channel is dedicated to development
Well now according to my un-sleep deprived testing, it's a bit bugged
@agile anvil I think I found a bug with minecraft code lol
Huh?
what a classic
Maybe I'm stoned I'm not sure, but this sorting function should relay the iron sword where the gold is in the creative gui
comparator = Comparator.comparing(ItemStack::getType);
I know it's sorting by the enum but I guess the enum constant is misplaced?
Nice! Mmmh I guess many things are dependant of some categories over other
Kind of an issue cuz perhaps there are a lot more cases like this
thats a designe choice as gold is harder to get than iron, its bdw the same thing with horse- & normal armor
So the workaround is just sorting by the name of the type I think?
I'm trying to mimic how it sorts in the creative gui is all
i mean you could try? its either going to work or it's going to end up all over the place..
how to spawn fully charged TNT that it just spawns and blasts at the same moment
@EventHandler
public void onProjectileHit(ProjectileHitEvent event) {
if (event.getEntity() instanceof Trident) {
Trident trident = (Trident) event.getEntity();
if (trident.getShooter() instanceof Player) {
Location hitLocation = event.getEntity().getLocation();
hitLocation.getWorld().strikeLightningEffect(hitLocation);
hitLocation.getWorld().spawnEntity(hitLocation, EntityType.TNT);
}
}
}
it spawns tnt but blasts after few seconds
i want it to explode right away
might aswell just spawn an explosion
how to do that
probably like world.createexplosion or something
declaration: package: org.bukkit, interface: World
yes its getworld.createExplosion
lol but it didnt cause any damage
do like 4F
Sure!
@tender forge
yo
i texted
the support
over 1d ago
and still0 rpely
?support
this email
stop pressing enter
kek
form a full sentence
ye sorry is 1 am
don;t care
is it allowed to put a link to your modrinth page on the spigot page?
no
Would be like a McDonalds employee going into Wendys and putting up McD's adverts
yes
The type net.md_5.bungee.api.chat.BaseComponent cannot be resolved. It is indirectly referenced from required type org.bukkit.entity.Player.Spigot
```Do we really need bungeecord jar for ChatComponent? I cant seem to get it to import.
Do you mind letting me know what the import is for that
net.md_5.bungee.api.chat.BaseComponent
Thats what i have lol, that requires bungeecord
it sounds like your project is not setup correctly
It doesn't need any external jars
Oh @agile anvil sorry for the ping but before I forget do you have any suggestions for learning about game dev? Sources, links perhaps?
Forum staff don't have access to this email, you'll need to wait for a reply. No other way.
Dont know, I usually dont use bungeecord imports.
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Ah unfortunately no materials. But what I recommand is for you to start from scratch, and just look online when you need something or have an issue
Sticking to one source might be restrictive, just let your imagination work!
that repository has been removed
read the bot text
thanks it worked
can I force a resourcepack to players from my plugin?
The players can refuse
right
is there nothing I can do about that?
I guess I can kick them
I have seen a few servers just kicking people if you deny the resource pack
but my question was more of like the server owner having to approve or set up the resource pack in any way or if I can send it to players from my plugin directly
you can't send it from teh plugin unless it has web access to be able to host
You can still prompt the client to download from url tho
declaration: package: org.bukkit.entity, interface: Player
ah nice, and it seems like I can use PlayerResourcePackStatusEvent to respond to players not using it. Thanks 😄
wdym
if I put my pack on github I can just send a link to that right?
you would have to be able to host it from yoru plugin, ie expose a simple web server
yes
is there a way to make PersistentDataContainer return a reference instead
What are you trying to do?
im trying to find a way to make it so that the inventory changes in pdc is reflected on any open inventories
idk how do you know if a value returns a new value or a reference
what? PDC is not displayed in an inventory anywhere
this should be written in de docs but if its absent, the value returned should be the original object
but if you mean if an items pdc changes you update the inventory that might be a bit tricky but if you set the item meta back to the same itemstack, it should instantly update
since its still the same reference presumably
but this depends on your inventory framework
like a lot of inventory systems use some kind of item builders to create inventories and they need to explicitly replace the items when they want them updated
Does somebody have idea how to create basic ball physics?
I've 3 data class in 1 package but when i use my plugin as a library in other plugins only 2 data class is accessable, any idea why?
^^ or not a public class
all of them are the same with different parameters, how?

They asked u did you mvn install it or published it to maven local
After you added that third class
did you run the task publishToMavenLocal
dependencies {
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")
compileOnly(fileTree("../libs"))
}
did you update the jar and reload gradle then
jar dependencies 
if anything you shouldnt be depending on it like that yopu should be publishing to maven local and using the actual dependency
yea but for now i'm just testing
thats what publishing to local is for
you publish to local to test or just have it yourself and then publish it to a repo later
did they ever fix the player portal event not firing when the end if disabled
there is no portal interaction if the end is disabled
true so ig just check if player is in portal block?
if https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityPortalEnterEvent.html doesn;t fire you'd have to track it all yourself on movement
as that is contact with, not an actual portal event
ah
Hey, I don't fully understand Async behaviour so I had a question (If someone could explain it I would be very grateful)
?
@EventHandler
public void onCropBroken(BlockBreakEvent e) {
if (!(e.getBlock() instanceof Ageable))
return;
//The block broken is a crop
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskAsynchronously(plugin, () -> {
//Manage tons of code updating continuously the PDC of an item
});
//Just do it not being Async
}```
So I have this
Is it suposed to be the first way less "laggy"?
Like this event is going to be fired over 80 times per second
So is async just faster
do you know what "async" means?
or avoids lag too
no
You can not update in world items async
More or less
Like it is working in other thread
async means that it's happening to a different thread than the currently processing one
yea
so as elgar said it is recommended to not change the world
but items neither?
Items you can but if its in world you can not
if you try to modify a block async Spigot will show an error
hmm
What's the difference between async and not? I mean, about performance
well you know
how do i return value from runasync
sync means when your code is running the server is waiting for it to finish
to func
spreading heavy tasks accross multiple tasks is good
async means your code runs along side the server main thread and it does not wait
callbacks
yes
show me an example
and the main thread has the tick loop
aja
meaning if the tick loop is delayed
cuz of your calculations
it can cause the illusion of lag
or just what we call lag, basically
to jump back sync you can callSyncMethod or use the scheduler to runTask
but with async the server wont "stop"
So that isn't lag right?
yes
yes
correct, it starts yrou code and continues without waiting
You can't "return" something from async context without blocking the thread
but it won't be happening on the thread that provides visual experience
there’s no real inherent performance penalty, but often you do end up having your write a bunch of callbacks and often times when u write async code u end up having to use multiple threads (esp on normal java apps)
does it uses less? As it is faster because async do it in not one task right?
it is not faster
by no means
oh
doesn;t use less, in fact can use more
then i had a wrong idea about async behaviour
I just wanted to say that
it can be faster sure, but that is in certain scenarios
How can I know when I should use async or not?
more resources to schedule the task than just executing the code directly
when you need to perform heavy tasks
or just tasks that can be done off the main thread
its best use is to perform long calculations or file/database access without making the server wait
so the server doesn't stop
ye
for example do other work while awaiting file io such as downloading
or parallelization tho its more taking full usage of hardware to cpu computation (or gpu w cuda)
yea, i've heard that
so here if you update a lot of blocks
it's best to do it async
you cant modify the world async
I think changing the data async is fine
I was going to update the tool used every time they broke a crop
so yea
it is better to not use async i believe
do sync
as long as you don't modify something about the block or smth
oh yeah, then no need
Thanks for the info!
👍
I can use little async tasks tho?
As i will need to do some small callculations
I mean, creating like 2-3 tasks when an event is fired, does that consume more resources?
depends btu generally yes
I mean I’d start by not doing it async, and then checkout if doing it async would help, often times it doesn’t unless you’re dealing with significant computations that can be split up into smaller ones
I see
I thought plugins that were "performance optimized" were using just a lot of async lol
I was so wrong xd
java is backward compatible, so to be fair, does this message even make sense?
How did you guys learn to optimise your plugins to consume less resources?
Just testing different ways on doing things?
You usually learn by users complaining of lag
visualvm, profiler
Well, that makes sense
There are some cool java std classes that support it
I read the source code of methods I use
and drew conclusions from what exactly needs to happen and what I'm doing unnecessarily
cant you give buildtools some more threads or smth?
can you?
idk its slow
uuh, i've searched in google but didn't find std
Oh, that's nice too
my pc is on high performance and my fans are heating up this room like it isnt 35°C already aaa
std standa for standard, means the normal, standard java jdk thingy
yk the jdk w all the classes yada yada :)
standard library
high performance running BuildTools? lol
btw how do you obtain craftbukkit dependencies again? that via buildtools too?
been too long since i did that stuff
i forgot, are those spigot or craftbukkit?
CB
I noticed how some plugins (and mods) have changelogs using small icons like [+] for additions and [~] for changes, does anyone know if there is some kinda standard for those or is it just what you think looks best?
been two years since i did this stuff, gonna take me a bit to get into it again
building a jar for someone is always fun:
Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'
does anyone know how i can start my server in shell:startup
remapped
ah silly me forgot --remapped
ooo
ok thanks !
is running bt with --rev 1.20.1 --remapped supposed to give me the cb jar too?
no
but the classes you need are in teh dependency
depend on spigot not -api
unless you have a crazy build and it depends on CB
doing exactly that lol
Does anyone know how minecraft calculates on what position it should send a sound packet when elytra boosting with a rocket, or where I need to look to figure this out myself? With most projectiles it's exactly the players location but when flying with rockets it's offset with seemingly no consistency
this dude got so many submodules im wondering which one to build lol
now back to the silly Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' error 🤔
ah wonderful, maven-compiler-plugin issue
another question: is v1_15_R1 1.15 or 1.15.1?
i assume 1.15
now i start to get why people dont like star imports
could be both
afaik not all updates bump the nms revision
i just need to get these things
does someone have musthave plugins? and can someone send me plotsquared i dont want to buy it
Lmao
Asking to get banned
Compile it yourself 🗿
for some reason nothing works with cb 1.15 or 1.15.1 but with 1.20.1 everything works fine :/
wait a package called v1_15_R1 uses 1.15.2-R0.1 🤔
gotta be kidding me
1.15, 1.15.1 and 1.15.2 must all be same protocol thn
no
one more error now : package net.minecraft.world.entity does not exist 🤔
looking for EntityLiving
is there an easy way without packets to get the players ping in 1.20.4?
heh what did this dude do
To my recollection, things may not have been relocated in their appropriate packages in 1.15
So it's all under net.minecraft.server
ah dang i remove that one import and it uses the star import
Yes
took me an hour and a half instead of my estimated 5 minutes 
thats nms for ya lmfao
are NMS classes from 1.17+ are the same?
thats "not making plugins for two years" for me
What do you mean by this?
Like their mappings are the same? (I don't know if they are but be more specific for anyone who can answer ur question)
Mines always "its always midnight or 3 am when i make plugins because im stupid"
i function better at midnight
DID SOMEBODY SAY MAPPINGS
I always say, never put off until tomorrow what you can do tonight
I mean yeah kinda obv
yea real because if i put it off to tomorrow ima forget how my spaghetti code works
well yea but there are people dumb enough to ask if all nms above 1.17 is one single class
remember: we are not making a spaghetti, we are making a lasagna
Realest shit ever
bro once i tried to make mac and cheese at 2am and accidentally made lasagna
holy shit
cuz its the same packet js dif instructions (and obviously for lasagna extra ingredients u supply)
not my code
At this point just don't indent
whos code then
building a jar for someone
public String giveItemUpgrade(Entity boat, ConfigurationSection section) {
if (section.getString("upgrade.item") == null) return null;
String secAmount = section.getString("upgrade.amount");
int amount = secAmount == null || Integer.parseInt(secAmount) == 0 ? 1 : Integer.parseInt(secAmount);
if (boat.getPassengers().isEmpty()) return null;
if (!(boat.getPassengers().get(0) instanceof Player)) return null;
Player player = (Player) boat.getPassengers().get(0);
if (advancedMaterialHandler(section.getString("upgrade.item"), amount) == null) return null;
ItemStack item = advancedMaterialHandler(section.getString("upgrade.item"), amount);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.getPersistentDataContainer().set(keys.getTemporaryItem(), PersistentDataType.BOOLEAN, true);
if (player.getInventory().firstEmpty() == -1) return messages.getString("player_inventory_full");
player.getInventory().setItem(player.getInventory().firstEmpty(), item);
return messages.getString("player_added_item");
}
hahahahha
beautiful
very readable
don't worry i recoded the entire plugin cuz of that lols
idk what kinda mindset i was in
interesting code https://pastes.dev/Won932Hjb2
Whats the plugin meant to do cuz i aint reading 1394 lines
wait WHY IS IT ALL IN ONE CLASS
thats one heck of a Spawn Listener
might aswell be the plugin class xD
do u understand what it is? like it seems its some sort of difficulty scaler
half of that file is in 1 method
looks like after an amount of time (days) it makes the mobs spawn with effects or stuff like that
enchanted items
etc
yeah
its is. It limits spawns to 8 of each type per chunk. 220 per world and modifies a few mob characteristics by the looks
without reading all of it I can see there are several ways to reduce the amount of code xD
like what. just to see if theres any i dont know
you seem to have too much time reading that..
most of it is gut feelings, if the code looks very similar it can usually be extracted and reused
First would be to create Sets for teh types so you can do a simple .contains check
each if seems to have a lot of similar steps like creating armor
you would also return in teh very first section if you are cancelling
Some old Bukkit plugins have up to 5k loc in one class. One had 10k.
which can probably be simplified and extracted for easier reuse
whose code is this anyways
lookup the plugin
it seesm to add extra mob spawns past day 20 when phnatoms spawn
there are a few guard clauses but more can be added
just picked the first one
I kinda like the scaling difficulty, but it should be based on teh players play time not days
ah looks like this one https://www.spigotmc.org/resources/permadeath-plugin-☠️.112343/
plot twist: its in spanish
or the local difficulty of the location
which is already a vanilla metric used to spawn harder mobs
yep
scaling just based upon days is terrible for a new player
Player joins -> get stomped on by an army of giants wearign diamond armor
I'd probably scale based upon distance from spawn
The scaling difficulty mod handles it based on time but per player
not sure how exactly it handles different players close to eachother
could take a look at that
I'd do it based on distance as then you know its going to get harder the further you travel
it depends on your goal
if you want the difficulty to be fully determined by player actions, then yeah thats a good way to do it
another way is to use a players experience or something
or keep track of total level they would be, you just have to be careful to not make it more difficult even if the player is already losing bad
piramid
is there a way to change the default attributes of items
Hey !
I'm new with Bukkit API, and i'm currently stuck on a problem.
I'm using a /give command to get an item with a special value in his custom_data (in NBT).
It looks something like this when I use /data get
{... , "minecraft:custom_data": {"foo":1b}, ...}
However, I spent some time trying to figure out how to get the value of the custom_data and I still can't find how i'm supposed to do.
I've tried to use the PersistentDataContainer but I also couldn't figure how it was supposed to be used/work
Thank you :)
?pdc
Thank you !
holy shit its ntdi
I asume spectator menu that opens when you press num keys in spectator is client sided. I want to disable it, but it is client-sides. Is it possible to set his held item slot every n time in order for the player to not see it. It is not server-sided right?
gonna build a new server, what is the fatest type of db to use? no preference if its nosql, sql, might want to use ORMS for better coding standards. just asking for opinions 🙂
hahaha
are you the non roblox roblox streamer
shhhhh
If you want super fast use cassandra or look into mem caching
cassandra 😮
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>````
``Could not find artifact org.spigotmc:minecraft-server:txt:maps-mojang:1.17-R0.1-SNAPSHOT``
I just builed it with BuildTools
did you run it with --remapped
it was
?gui
for me
Use the one that does the needed job the best and that you know the best. Speed really doesn't matter for applications such as Minecraft servers
Hey, I've made a plugin for both velocity and spigot which it receives a Request from web containing a Json like this:
{
"listener" : "listener-id"
}
when the velocity plugin receives this data, sends the listener-id to a Redis Pub Sub channel and Redis notifies all of my custom listeners with the same id received
this is how i made the listener:
fun listener(id: String, onReceive: RequestData.() -> ResponseProperties) {
object : DataEvent {
override val listenerId: String = id
override fun onReceive(data: RequestData): ResponseData {
return ResponseData(data.uuid, onReceive(data))
}
}.register()
}
data class RequestData(val listener: String) {
val uuid: String = UUID.randomUUID().toString()
}
data class ResponseData(val uuid: String, val properties: ResponseProperties)
data class ResponseProperties(val properties: Map<String, Any>)
and this is how i create a listener:
listener("salamdokhtari") { ResponseProperties(mapOf("key" to "value")}
when i register a listener on the same plugin which contains this codes it works and the listener returns the data and sends it to the webserver in a response, but when i register that listener in another plugin depending on this plugin, the listener doesn't work
this is a overall information about the issue, i don't know what else i should share, lemme know if any extra information needed
ping me on respond
you are probably shading the first plugin in the second so its not listening to the right event
?paste your pom
@sage patio ^
no i don't, its just kotlin
1 sec
main plugin gradle ^
the second plugin including just 1 listener gradle^
can't help you with gradle
then you need someone good at redis
show the redis code
this is 2 class
RedisConnection and RedisDataReceiver
looks fine to me
it works if i put the listener on the plugin it self. the api plugin
but when i put it in another plugin it doesn't
Someone knows whats happening here? I have no clue java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
If you need full trace just tell me
If I send packets to the player on proxy can I keep him there as long as I'd like?
and would they automatically support all client versions?
on bungee
How can I spawn in the Ominous banner? 💀
you arent shading the stdlib
or libraries'ing it
I don't know how to do that 😦 any guide?
use shadow with the dependency kotlin("stdlib")
I'm using maven
never used kotlin with maven so cant help
idk if any1 knows how to spawn it in
Perhaps this?
declaration: package: org.bukkit.entity, interface: OminousItemSpawner
I dont think this is for ominous banners
but rather ominous spawners
like the new mechanic
Yeh in the trial chamber
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
why the fuck are you wanted by Interpol
whats ur name
I see no red notice for Sweattypalms 😉
does anyone know?
what did i do to get on the fuckin interpol list bro
-# This user is wanted by Interpol - See more
you tell me
You probably offended a Clinton
its all those private project contributions
we have a mutual friend 💀
I dont know but i will hand you over.
-# This user is wanted by interpol - See more
easy
dang
bro
i thought we were homies and shit
nobody saw that
Is there a way to open a Anvil/Workbench that work without packets?
use a library that uses packets
spigot?
oh that works
no
you got any for the workbench?
PacketEvents
even tho they don't have an enum of inventory types
but those changed like
not-that-very-often
throught time
use OpenInv
not openinv
hold on i dont remember what its called
then they dont work
open me thats it
(made by the Core Inventory Related contributor at spigot)
Hi, can someone can help me to understande the difference between spigot source and spigot plugin, juste understand, what can be done with source that can't be done with plugin
still it doesnt have functionality
you tell me
show ur code
ignore the &
final Messages messages = CityBuild.INSTANCE.getMessages();
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
if(!(sender instanceof Player player)) {
sender.sendMessage(messages.getMessage("NoPlayer"));
return false;
}
player.openInventory(OpenMe.string().createCrafting(player, null));
return false;
}
that should work, wait for @river oracle to get back and he should be able to help more
Latest? Mc version?
If so I might need to edit how crafting is constructed
1.20.4
Probably just me missing an edge case
new ItemStack(Material.STAINED_CLAY, 1, (byte) 3) why does this give a stained clay without the colour ? 1.8.8;
1.8 moment
fr
I'll add it later I'm at work rn so I can't fix the craftingtable rn
All others should work tho <3 you can actually use api for crafting table anyways
at that point id just make a fork of cb myself
yeah anvil works
You can use normal craftbukkit events if you need to actually mutate the result or something
nah its just a normal command opend anvil
before im trying to do something stupid, datapacks are enabled on a world folder level right? like I can create a world using world creator and then put a datapacks folder with a datapack in it that alters terrain generation, and then when the player loads the world by teleportation it will use the datapack?
if noone knows ill just try it but I wanted to see if someone ran into issues with this beforehand
it should theoratically
as long as the world doesnt get loaded before the datapack
which here wouldnt be the case if i'm not being dumb
hmm I think even then I think the datapack can still affect new chunks , like if there is no player in the world, no terrain is generated right? (maybe except for spawn chunks ig)
yeah exactly
uh yeah i'm not entirely sure if data packs load for worlds other than the {level-name} overworld over bukkit's bastardisation
since data packs are global and they can also do all the data pack funsies
I'm a bit embarrassed to ask this, but I've always used Eclipse and recently moved some of my projects to IntelliJ IDEA using Gradle.
I have this error when trying to compile with Java 21 to work on Spigot 1.20.1
Could someone help me? 😅
?nms
is there a way to change the default attributes of items
WHat is this bro
-# This user is wanted by interpol - [See more](https://www.interpol.int/How-we-work/Notices/Red-Notices/View-Red-Notices)
I dont think so. If the items dont have any attributes added, the client simply assumes and displays the vanilla ones.
There is no packet which would notify the client of changed default values, strengthening my assumption.
Any idea why the server hangs if I try to get a list from PDC when a chunk loads
🤔
goofy ass
if it were to recurse infinitely then we'd see a StackOverflow
maybe its like delaying by a tick or whatever
but I guess then it wouldnt be lagging like this

crashed so hard that none of the backend servers have internet access anymore
what the actual fuck
crashed so hard that i fell of the chair and my neighbour had to restart their wifi
?whereami 🤓
Looks like a plugin sending a component as a string
The problem I have is due to the Java version, and that my plugin has a module for each version it is compatible with
i want the player to have Items here eveytime he opens his inventory but there is no event for this, how would you solve this?
i know i can place items here but i don't know when to place them since there is no event for it
I think they have slot numbers
So get the PlayerInventory and set items in the specific slots
yup i know that but how do i know when the player open his inv
you dont
ok
the server has no idea when its open
You just do it constantly I guess
won't that make the server lag?
im pretty sure the server knows about if the player clicks their own inventory, so if in ur case you only need to do something when they click, it would work
it wouldn't work but i found an obvious workaround
okay
im having a hard time understanding oop. when you create a class and have fields in the class private int xp; make a getter and setter with it, the class has the players uuid in the object. does it not store it?
why does it create a new instance everytime?
Mining mining = "new" Mining
thats what i kinda figured but whats a good way to call it after its made.. that part is confusing me
You need to store it somewhere
Either in a field of another class or inside some sort of collection, like a map or list
okay, i'll give that a shot. thank you 🙂
trying to learn without being spoon fed. been working on this for way too long.
plus pls dont use if statements like that
your code is really inefficient. it should rather be a map<Material,Integer>
so set a material map in my object class and set them in there and just call the map?
i'll give that a try once i figure this out, thank you
the whole idea of this is trying to not read/write to files everytime a block is broke. i feel like that would get bad
use a switch statement here```java
switch(block.getType()) {
case IRON_ORE:
no
yes
why do you believe a map is better?
he is performing an action based upon the block type
and only specific types
cuz you dont need to add a case for everything, just add the material with a integer xp val
no, the materials are going to in the config.
ah ok
this was for testing
use a map
in that case yes a Map Map#getOrDefault(block.getType(), 0)
I never used oop correctly before, so im trying to break bad habits
so all the advice helps
switch statements almost always indicate a design flaw
oop is really simple. every new object has to belong to some parent
my issue is i didnt know you had to store the object after calling it, i figured java did it in memory somewhere lol
nah, if in yoru code you do new Apple(); but don;t store it (assign it to a field or pass to another method) its wiped from memory once that section of code finishes
Not at the exact moment but yeah it's set to wipe eventually
This week I discovered that Jetbrains Datagrip is a thing
It's an IDE for interacting with databases :)
hella nice tool
I just use a plugin for Eclipse for databases, as I don;t use them often
Um YT just decided to start offering me vids about hitler 😦
can you not make the map in the object?
private HashMap<UUID, Mining> miningHashMap = new HashMap<>();
or do i have to store the fields independently?
Is there a method to set player scale? I can't seem to find it anywhere
no
it all depends on your project design
It's an attribute
did they add scale now?
Wdym
As in you can edit player size now yeah
Iirc yeah
you can do it for mobs too
Came in 20.6 I think
everything i try it with seems to work except ender dragon unfortunately
ah I've not touiched since 20.something
It's player.addAttribute and just create an attribute modifier with the correct information
oh ok thank you so much
if i make the map in the instance it wont save
How do I simulate a "fake" empty limbo server on Bungeecord?
Fake means that no actual seperate process is started for it
Like no jar
Same vm
mining = new Mining(p.getUniqueId());
mining.getMiningHashMap().put(p.getUniqueId(), mining);
}
mining = mining.getMiningHashMap().get(p.getUniqueId());```
wow i feel like an idiot.
thank yall
don't put the map inside the Mining class
no?
you create a new Mining object for every player
you want a single Map outside the Mining class
^
even if i'm accessing it from other classes?
yes
A global map if you will
if it is inside the class you are creating a new Map for every player
So long as your user class is a Singleton
I don't think you want that, because then theres no reason for key -> value caching
different map
If each player has their own map then technically only one key/value will exist per map
Mining contais the players xp, level etc
from what I understand
ah yes we are talking about different parts
So then yes you should have a global map storing uuid or wtv to a mining object
If player information is already within the mining object then you can just pull wtv data you need from that mapped object
i was planning on using a map for each skill, should i not?
yep, one Mining object per player put into a global Map for <UUID, Mining>
each skill?
Sounds a bit overkill
i was going to make more than one skill
one for Mining and another for Wood cutting?
yes
if their xp/level is seperate then yes
^ yes
Oh right yeah
That's fine
my next question was should i make that a class for every skill so i could used like Skill mining = new skill
Tbf in my (wip) rpg core, I store ability levels and the class level within the class object itself
that was the question
Map<UUID, Set<Skill>>
have a package of skills
or
as each one is identical just a single skill class, then add a field for its type
I would have a class that holds all the skills for a player
Rather than nested collections
actually don;t even need that
Skill would only contain the xp/level data
so Map<UUID, Collection<String, Skill>>
make teh string either a name or an enum
i will have to try this because it sounds more efficient for more skills later on
I still advise this :p
@young knoll what do you mean?
You make an object that holds all the player skills and store that in the map instead
you could do that
just moves teh Collection into a skill container
Map<UUID, Skills>
public Skills () {
Set skills<Skill>
You can also add more helper methods to said Skills object
yep in skills you have add get methods
so you have a Skills object and a Skill object
Skills is the container for multiple Skill
Hmm considering this information perhaps this isn't the best design for my abilities system...
@worthy yarrow i've been trying to make this system for 2 weeks now.... thats why i finally came to here lol
It's being worked on currently
Well cuz at first, I thought I was just gonna have 1 or two abilities per class lol
then I was like
That's just fucking dumb
Either way
Yeah I should have done more planning before actually writing kek
Well yes, I'm still practicing proper oop haha
Anyways abstraction of the abilities is in progress so
so same as me
private int level;
private int xp;
private final UUID uuid;
private Player player;
private final User user;
private int newLevel;
private HashMap<Material, Integer> materials = new HashMap<>();
private HashMap<UUID, Set<Skill>> skillMap = new HashMap<>();
public Skill(UUID uuid) {
this.uuid = uuid;
player = Bukkit.getPlayer(uuid);
user = new User(player);
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getXp() {
return xp;
}
public void updateXp(int xp) {
this.xp = this.xp + xp;
}
public void setXp(int xp) {
this.xp = xp;
}
public void levelUp() {
if (getXp() >= getLevel() + 100 * 2) {
newLevel = getLevel() + 1;
setLevel(newLevel);
setXp(0);
user.sendChat("&aLEVEL UP!");
user.sendChat(String.format("&7Your mining level is now: &6%s", getLevel()));
user.spawnFireworks(player.getLocation(), Color.PURPLE, 5);
}
}
public HashMap<Material, Integer> getMaterials() {
return materials;
}
public HashMap<UUID, Set<Skill>> getSkillMap() {
return skillMap;
}
}```
^ what I tried to do with that registry system
don;t track the Player, UUID or User in the Skill object
^ The skill is already going to be mapped to a player
the Skill object should just be a data holder
Okay so do that per class too
the Skill class should be identical for all skills
thank you so much for this information, this has been bugging me forever
hi guys, i'm trying to make a disc shape using block displays. how would i be able to achieve this
its literally just holding the xp/level data
private int level;
private int xp;
private final UUID uuid;
private Player player;
private HashMap<UUID, Set<Skill>> skillMap = new HashMap<>();
public Skill(UUID uuid) {
this.uuid = uuid;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getXp() {
return xp;
}
public void updateXp(int xp) {
this.xp = this.xp + xp;
}
public void setXp(int xp) {
this.xp = xp;
}
public HashMap<UUID, Set<Skill>> getSkillMap() {
return skillMap;
}
}```
Okay i get what you're saying
remove Player and UUID too
no skillMap either
create a Skills object that has the skillMap
this was what i was attempting before.
so if i extend from the skill class it will store it?
yes
alright i will start working on this
private final UUID uuid;
private Player player;
private HashMap<Material, Integer> materials = new HashMap<>();
public Mining(UUID uuid) {
this.uuid = uuid;
}
public void addMaterialXp() {
for (String mat : Main.instance().getConfig().getConfigurationSection("Materials").getKeys(false)) {
if (!materials.containsKey(mat)) {
materials.put(Material.getMaterial(mat), (Integer) Main.instance().getConfig().get("Ores." + mat));
}
}
}
public HashMap<Material, Integer> getMaterials() {
return materials;
}
}```
so the mining class will contain methods i need for events/etc correct?
yes
and i need another class to hold the skillmap like inside my main user class
yes skillMap goes inside each user object
i have this right now. it should make a circle / disc type shape but it's teleporting the block displays into the middle which is resulting in it looking like a regular block. how can i move the block displays as a group in a set direction?
for (int angle = 0; angle < 360; angle += 5) {
double radian = Math.toRadians(angle);
double x = Math.cos(radian);
double z = Math.sin(radian);
Location eclipse = origin.clone().add(x * 0.5, 0, z * 0.5);
BlockDisplay blockDisplay = (BlockDisplay) player.getWorld().spawnEntity(eclipse, EntityType.BLOCK_DISPLAY);
blockDisplay.setBlock(material.createBlockData());
blockDisplay.setGravity(false);
blockDisplay.setInvulnerable(true);
Transformation transformation = blockDisplay.getTransformation();
transformation.getScale().set(0.4, 0.3, 0.4);
display.add(blockDisplay);
}
if (clicked) {
shoot();
}
if (!clicked) {
if (source == null) {
getSource();
}
if (origin.getY() < source.getLocation().getY() + 2) {
origin.add(0, 0.1, 0);
} else {
// "hovering" simulation
origin.add(0, (Math.sin(System.currentTimeMillis() / 1000.0) * 0.03), 0);
if (!ready) {
ready = true;
}
}```
oh..
.append(initialMessage).append(display).append(finalMessage).create(); How would I reset the text after append(display) ? because my finalMessage shows the hover message when only display should
how should i do it then?
not sure what you are attempting
what exactly are you trying to do?
okay. i'm trying to replicate a disc like shape. the shape comes out the ground and rises to player height, then hovers a bit while it waits for the player to left click to shoot
so i want it to move up and down, and then move in the direction when they shoot
private void shoot() {
if (!ready) {
return;
}
direction = player.getLocation().getDirection();
origin.add(direction.normalize().multiply(1));
}```
my shoot method
ok, spawn the display at its origin.
start a runnable 2 ticks later to apply a translation to make it move up to wherever you want it to rise to.
this is in a method that runs every tick btw
and origin is the block location that the disc comes out of
if you apply the translation when it spawns it will just apply it strasight away
Spawn display.
runnable 2 ticks later, getTransformation, adjust translation, set transformation back.
the interpolation duration is how long it takes to apply its transformation
how do i get a vector that leads from vector a to vector b at progress x
x is 0 to 1
once that duration has expired reset its trasnslation and teleport it to the new location
Thats how you make it rise from the floor
you only apply a translation to the Y axis
what does 0 and 1 represent?
the progress
1 is the full distance?
yes
so you are talking about locations not actual vectors
targetVector.subtract(sourceVector) gives you the distance
amazing
how should i adjust translation?
multiply that by your progress
that gives you distance multiplied by progress
for (BlockDisplay d : display) {
d.getTransformation().getTranslation()
}```
then add the multiplied distance to the source vector?
or the target vector
idk
This causes a display to bounce up and down simulating a dropped item. You do the same but a single runDelayTask not repeating```java
entity.setItemStack(new ItemStack(Material.ACACIA_BOAT));
entity.setInterpolationDelay(0);
entity.setInterpolationDuration(1);
Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
float angle = 0;
float stepSize = 2.87f; // Sync to Minecraft animation rotation speed.
float rotation = Math.toRadians(stepSize);
@Override
public void run() {
Transformation transformation = entity.getTransformation();
transformation.getRightRotation().rotateY(rotation);
transformation.getTranslation().set(0, Math.cos(Math.toRadians(angle)) / 10, 0);
entity.setTransformation(transformation);
if ((angle += stepSize * 2) >= 360)
angle %= 360;
}
}, 2, 1);```
this moves it every tick
but i'm already in a method that is repeated every tick
@eternal oxide where should i add the skill class in the set?
you would want a single transformation from origin to final position
you don;t need a repeating task unless you are doing more animation than just moving it up, then shooting
you add a add method to the Skills class
so you can add any new Skill
also add a get method in Skills
i'm sorry. how should i incorporate this in my code?
start with one display
get it doing what you want
before you attempt multiple
like run a delayed task (2 ticks later)java Transformation transformation = entity.getTransformation(); transformation.getTranslation().set(0, -5, 0); entity.setTransformation(transformation);
if you do that in a runnable 2 ticks after you spawn the display it will make it move up 5 blocks
it won;t actually move it, but it translates it. it's still at the original spawned location
entity.setInterpolationDuration(20); would make it take 1 second to cover the distance
Aim to make everything more generic
You don't need concrete character classes
As each "character class" (probably / should) consist of
- A skill tree
- Metadata (display name, color, icon etc)
On the skill tree, each skill has effects, with different trigger conditions (on click / on player join etc)
They can be things like buffs (on join -> apply speed buff), or active effects (on click -> cast a spell or something)
This structure allows you to separate everything, re-use skills across classes and make derived classes (Evolved Archer is just an archer with more skills, for example)
public class Warrior implements CharacterClass {
private final Map<Integer, Integer> abilityExperience = new HashMap<>();
private final Map<Integer, Integer> abilityLevels = new HashMap<>();
private int classExperience = 0;
private int classLevel = 1;
Another thing I was wondering, the current system has a class object (mapped to each player when/if they decide to make said class) storing the exp and level to fields, this works but is it better to store the exp/level data somewhere else?
int, int?
To simplify the writing I just mapped like 1,2,3 etc kek
ah magic numbers
I love having to go back to the ability class to remember which one it is kek
I'd like to separate your data structure from your player data
Namespaced each
This would take a solid hour to write
Now that you say this yeah, I mean all the player data is stored with the class object so
public interface Skill {
String getName();
SkillUsageRestriction getUsageRestriction();
void apply(SkillCaster caster, SkillCastingContext context);
}
hm
SkillUsageRestriction would dictate when apply should be called
I assumed that yeah
(ON_PLAYER_JOIN, ON_PLAYER_CLICK)
Either that or we make skills components
Which is also viable
public class Berserk {
private final Player player;
private final double damageBoost;
private final int duration;
private final EnhancedRPG enhancedRPG;
public Berserk(Player player, double damageBoost, int duration, EnhancedRPG enhancedRPG){
this.player = player;
this.damageBoost = damageBoost;
this.duration = duration;
this.enhancedRPG = enhancedRPG;
apply();
}
private void apply() {
Attribute attackDamage = Attribute.GENERIC_ATTACK_DAMAGE;
if (player.getAttribute(attackDamage) == null) {
return;
}
player.getAttribute(attackDamage).setBaseValue(
player.getAttribute(attackDamage).getBaseValue() + damageBoost);
Bukkit.getScheduler().runTaskLater(enhancedRPG, this::remove, duration * 20L);
}
private void remove() {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cBerserk mode has ended!"));
Attribute attackDamage = Attribute.GENERIC_ATTACK_DAMAGE;
if (player.getAttribute(attackDamage) == null) {
return;
}
player.getAttribute(attackDamage).setBaseValue(
player.getAttribute(attackDamage).getBaseValue() - damageBoost);
}
}```
the ability structure is a bit redundant as well, considering the character classes already have a useAbility method
public interface SkillComponent {
String getName();
void register(SkillCaster caster);
void dispose(SkillCaster caster);
}
public interface ClickableSkillComponent extends SkillComponent {
void handleClick(ClickContext context); // Would contain the target entity, click type, held item
}
Would the get look like public Skill getSkill(Skill skill) { return skill; }
@eternal oxide ?
@EventHandler
public void onInteract(PlayerInteractEvent event) {
SkillCaster caster = ...;
ClickContext context = ...;
for(ClickableSkillComponent clickComponent : caster.getComponents(ClickableSkillComponent.class)) {
clickComponent.handleClick(context);
}
}
Which is how I do my entities nowadays :)
I think the skill component would be better in the case of expandability no? I could think of a couple ways to implement the server op to create their own abilities
It can work if you engineer it well
return skillMap.get(skillKey)
(excuse the kotlin) here's how I do mine at work
Abstraction goes crazy
Oh it's so lovely
I also have an "entity template" system that gets to apply components to an entity
And I can save templates in PDC so that when an entity loads in the world they get their components back
A system like this isn't just limited to simple stuff like "if I click on this entity this happens", I also use it to apply custom models and have some holograms around for things like health displaying
Barely
ah so instead of Hashmap we're replacing it with set<Skill>
The way I created it involves re-using the same component instance for multiple entities so most components have a Map<ComponentEntity, Whatever> internally
I have a TickableEntityComponent that just ticks on every entity
And for example, my "HealthRenderingComponent" just inherits that and updates the display on every tick
When the entity dies, the component gets disposed meaning I know to nuke the display
I got my final lesson from trooper today for a while, went over his lib and previously netty + oop concepts
Though per rolyn's advice I kinda wanna try some game dev
It'd look something like this
public class HealthRenderingComponent implements TickableEntityComponent {
private final EntityHealthTemplate template; // What's used for rendering the health
private final Vector displayOffset;
private final Map<ComponentEntity, PacketEntity<?>> displays = new ConcurrentHashMap<>();
public HealthRenderingComponent(...) {
this... = ...
}
@Override
public void tick(ComponentEntity entity) {
Entity backingEntity = entity.getBackingEntity();
if(!(backingEntity instanceof LivingEntity livingEntity)) {
return;
}
double currentHealth = livingEntity.getHealth();
double maxHealth = ...;
PacketEntity<?> display = this.displays.computeIfAbsent(entity, (irrelevant) -> createDisplay(livingEntity));
display.setDisplayName(template.renderHealth(health, maxHealth));
display.teleport(livingEntity.getEyeLocation().add(displayOffset));
}
@Override
public void dispose(ComponentEntity entity) {
PacketEntity<?> display = this.displays.remove(entity);
if(display != null) {
display.dispose();
}
}
private PacketEntity<?> createDisplay(LivingEntity entity) {
return ...
}
}
p much it
skills.add(new Mining(p.getUniqueId()));```
something like this?
private UUID uuid;
public void add(Skill skill) {
skillMap.get(uuid).add(skill);
}
public Set<Skill> getSkill(Skill skill) {
return skillMap.get(skill);
}```
Is the displayOffset ever different?
passed on the constructor
For example we have some crawling zombies at work
Their backing entity is a real zombie with a custom nms hitbox
If I were to use the default value the display would be too high
private HashMap<UUID, Set<Skill>> skillMap = new HashMap<>();
private UUID uuid;
public void add(Skill skill) {
skillMap.get(uuid).add(skill);
}
public Set<Skill> getSkill(Skill skill) {
return skillMap.get(skill);
}
}
Hmm someone give me a PacketType from packet events to play with, preferably from Play.Server
ahaha i am now confused at my own code
@eternal oxide im confused now lol
should the skills class be a new instance?
would you guys say it's an anti pattern to name for example the table Playername's id as playerId or should it just be id?
idk
personally: I wouldn't use java or kotlin
but if I had to
playerid makes more sence
im talking about for dbs
ig same idea though
why lol
how do I add nbt tag to player object?
?pdc
yep
how do i get from a set?
well i have this
private final UUID uuid;
private HashMap<UUID, Skill> skillMap = new HashMap<>();
private Set<Skill> skills = new HashSet<>();
public HashMap<UUID, Skill> getSkillMap() {
return skillMap;
}
public Skills(UUID uuid) {
this.uuid = uuid;
}
public Skill getSkill(Skill skill) {
return getSkillMap().get(skill);
}
public void add(Skill skill) {
System.out.println(skill);
skills.add(skill);
}
}```
i'm trying to figure out how to get into
```private Set<Skill> skills = new HashSet<>();```
nvm
Does anyone know what the best way to use models in a plugin is? Right now i'm thinking of using an invisible armor stand holding an item and then using a texture pack to replace that item with a model texture.
Use @torn shuttle FreeMinecraftModels
It will be way too much of a pain to make your own render system
It’s a big job
@drowsy helm can u help me in dms rq
Just post it here
@eternal oxide Mining mining = new Mining(); Skills skills = new Skills(p.getUniqueId()); Skill skill = skills.get();
What am i doing wrong?
Oh okay
do ya @worldly ingot ?
Have fun!
xD
Well, you have a Set of Skills, do you not? 😄
Fun is not this and I think you know that kek
Thank god world edit exists eh?
Couldn't imagine hypixel to have invented it
Is there a way to have a config string be read in a format like "0-800:0.6" the 0.6 being a 60% chance for an entity to spawn and the 0-800 being the ticks in a day cycle.
No the builders have WorldEdit and whatnot
That's a pretty standard tool that most builders expect to have regardless of where you are
Yeah sure, I think my biggest issue is gonna be the plot permissions
Unsure what your skills.get() is for, but each time you create a new Skills(), you're initializing a new (empty) HashMap, your skillMap field
Probably not what you want
I want to keep all plots in the same world and just attach offsets for loading them in when a player wants to transfer to the plots world, that being said the permissions aren't going to be world based but region based right? I wasn't sure of how to go about this
World guard probably?
Well are you recreating housing? Or are you recreating a plot plugin?
It's supposed to be like housing
@worldly ingot thats just getting values, get is setting the skill public Skill get() { return getSkillMap().get(uuid); }
in the Skills constructor its adding it to a Hashset public Skills(UUID uuid) { this.uuid = uuid; //Add skill classes Mining mining = new Mining(); add(mining); }
Right now I'm trying to get the foundation work done meaning plots for the players build area correct? Then moving forward to plot placement within a world when a player transfers to said world, I could spawn them at like a default 0,1,0 or whatever and have some npcs or buttons wtv to dictate housing options such as the visiting and whatnot
I could attach an offset to each plot location when loading it in to keep proper spacing and then use world guard for individual region permissions yeah?
I guess I have to ask what makes housing well housing then?
Well it’s all separate servers
Actually I doubt that’s true
It’s probably a bunch of servers with a few worlds each
I see. Well if your Mining is storing any data at all, then it as well is being initialized each time you create a new Skills object. I think you're designing this a bit backwards
Ideally the skills should be pretty stateless and have one instance in the JVM because they provide really nothing more than information such as a name, description, maybe a max level, etc. etc.
Yeah definitely just split the delimiters
Then you could store some state stuff in a separate object, maybe a Map<SkillType, Integer> or something to hold the level of a skill type
I feel like that just means it's plots across different servers?
Take for example Minecraft's blocks. There's only one instance of the sand block type. It holds no data. Just acts as a stateless information class that has methods that can do various things.
Only one instance of it is ever created though and it's constant in the Blocks class
@worldly ingot can i dm you?
It means the entire plot is stored externally in a database
Specifically I imagine they use the slime format for that
is there a limit for velocity speed
What server you talking about?
hypixel housing
vector.multiply(5) is the same speed as vector.multiply(100)
I dunno, can you 👀
I feel like the only reason they do this though is because of the expecting player base?
Housing is basically skyblock with less sky
We can make a thread here if you'd like to consolidate things
Still plenty of block tho
Thank you, I try my best
Considering maybe 50 players is yml forgivable for persistence? (Specifically for individual plot data)
I mean this is just an idea, but you could use slime worlds, and have them stored somewhere, this will also make it future proof for migrating the houses to a blob area, or similar. As you can make it so there's around 16 houses per instance. Or if in a single instance just have a slimeworld per player. (Not sure how it handles the world instances or whatever, but that could work.)
I just thought of this but what about just scheming a region (the players plot) and attaching that somewhere in their player data
Then just save / load like that
the idea of all of this is to store the level and xp for each skill so i made a data class "Skill"
private int level;
private int xp;
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getXp() {
return xp;
}
public void updateXp(int xp) {
this.xp = this.xp + xp;
}
public void setXp(int xp) {
this.xp = xp;
}
}```
and then we extend each skill "Mining"
```public class Mining extends Skill {
private final Server server = new Server();
private HashMap<Material, Integer> materials = new HashMap<>();
public Mining() {
}
public HashMap<Material, Integer> getMaterials() {
return materials;
}
public void addMaterialXp() {
for (String mat : Main.instance().getConfig().getConfigurationSection("Level settings.Materials").getKeys(false)) {
if (!getMaterials().containsKey(mat)) {
getMaterials().put(Material.getMaterial(mat), (Integer) Main.instance().getConfig().get("Level settings.Materials." + mat));
server.sendConsole(String.format("Added material: %s xp: %s", mat, Main.instance().getConfig().get("Level settings.Materials" + mat)));
}
}
}
}```
finally we need a way to get all the data "Skills"
```public class Skills {
private final UUID uuid;
private HashMap<UUID, Skill> skillMap = new HashMap<>();
private Set<Skill> skills = new HashSet<>();
public HashMap<UUID, Skill> getSkillMap() {
return skillMap;
}
public Skills(UUID uuid) {
this.uuid = uuid;
//Add skill classes
Mining mining = new Mining();
add(mining);
}
public Skill get() {
return getSkillMap().get(uuid);
}
public void add(Skill skill) {
System.out.println(skill);
skills.add(skill);
}
}
Can I dictate where the schem file goes?
the issue is getting the data.
Do you think this is a valid approach?
Probably fine assuming you don’t need any cross-server functionality
And the storage space isn’t a huge concern
^
Ok cool
Lastly, should I load the plot data when the player joins the server or should I load it when they transfer to the world?
I'm not quite sure on whether or not they are going to dedicate a server to plots reason I'm asking
I'd suggest transfer so the server doesn't have to use any extra resources for example alt accounts or bots
Yeah that makes sense
the idea of all of this is to store the
so im trying to make an arrow that, when you fire it, it makes you ride the arrow entity. the current way i am trying to make this happen is by using entityshootbowevent, with setpassenger. However, I cant seem to find out how to track the arrow once it's fired
so how could i go about doing so
Does the player ride the arrow? Do you see any instance of this happening?
What exactly do you mean "track the arrow" in what way? What does it need to do?
i need the get the arrow entity after it's fired
^ if you can already attach the player then it should just ride out to where it was fired no?
