#help-development
1 messages · Page 2290 of 1
i forget about it if i dont go in it for like 2 days
and before you know it its been 3 weeks
Hi guys.
I'm creating an alpine docker image that runs, amongst other things, buildtools to build spigot 1.12.
During buildtools execution I have 2 issues:
- java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
=> I saw the advice in https://www.spigotmc.org/wiki/buildtools/#issues-and-common-concerns
Sadly adding those elements did not solve my issue :
- Dockerfile
```
SHELL ["/bin/bash", "-c"]Runs entrypoint script
ENTRYPOINT ["/bin/bash", "-c", "/root/entrypoint.sh"]- entrypoint.sh ``` export SHELL="/bin/bash" - The execution is very slow. I may have badly configured docker but I have no idea how to increase buildtools execution speed.
Do you run this on ptero
you would have better Luck IMO
having just core libs on the docker image
like gradle, maven, java
and have a seperate install script that runs all this
Doing it in docker is a little aids just for debugging wise
especially certain alpine images
cause some are like 300mb
how can i create a non-static library? ive seen vault and they use public methods with a variable Economy which controls the api, how is it possible to do something like that?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Use di ^
ServicesManager
Yes so you make getters for your API in your main class for anything you need
Make a abstraction API where users hook into it via class inheritence
Or services manager
ServicesManager is what vault uses
ok ty
i just want it to look cleaner instead of having to do Class.<method> instead you do what vault does
okay then defo do ServicesManager if you wanna copy that
do i need to add extra code to my library or is that the person using the library that needs to do that
Me personally i dont like that method
I prefer class hierechy or just a getter for plugins main class instance
You do need to register your service
cant rly find anything online
So having a raw instance of the api would be faster yes?
instead of running it through services manager?
I build it on a volume (like a mount) so the size is not an issue.
I use zulu8-ca-jdk-headless (like suggested in the buildtools wiki).
I can't do it in ptero if I want to fit my needs
Yes but that’s irrelevant
i haven't updated my plugin to 1.19 yet and i have never updated a plugin before, is it difficult or easy
The point of services manager is to provide a loosely coupled way deploy an implementation to an abstraction
Yeah, but well else the classic getter works fine
My Apis are instance based so i just extend on the JavaPlugin to the plugins main class
Ah ye
eg Plugin extends BurchAPI extends JavaPlugin
Why vault api doesnt have examples lmao i really hate because i need to lost minutes of life just reading their javadoc
and BurchAPI controls the entire thing
😡
To make an armorstand rotating on itself I need to put a code inside a Bukkit runnable timer that changes the yaw and the pitch of the armorstand and teleports it right?
and provides to Plugin
I beileve
ArmorStand has rotate methods?
y
burch any idea?
I never used pitch and yaw, I hate the "location math"
Vault api has examples wym
wheere
You dont need pitch
pitch is like looking up and down
i read full ghb and not find anything only their javadocs url
Lol.
Thanks a lot, I'll give a try.
and the yaw is left to right
you dont need to read the docs tbh its extremely simple and common sense just instance.getBalance for example
registering it is the main thing and creating your own economy abstraction class
is there a way to make the ender dragon fly faster? I tried ajusting movement speed and fly speed attributes, but both seem to do nothing
if i am writing my plugin in intellij how do i update it to 1.19
yeah that youd need the github for
haha really
i just search"Vault api spigot" and its first google result
tbh it is quite confusing vault has 2 githubs 1 for the plugin and 1 for the api which is weird
scroll down so i can see your address
and dont gnerify
WHY NAME? LMAO
Can't find a method such as getRotation() method .
deprecated
My eyes wanna jump down from my head
yeah you have to set the yaw in Location sadly
deprecated
never
ahah
I know but its really funny to see how people used to use it
Vault uses OfflinePlayer now
hey guys how do i update my plugin to 1.19 o_0
do you use nms
no i don't think so
about deprecated, can't actually find a way to put an helmet on armor stand, the only way is using a deprecated method and suppress the error.
Change the library to 1.19
in maven or gradle
how to do :D
then you probably dont need to update anything at all
and compile/check for errors
Lol
stand.getInventory().setstuff
*.getEquipment()
i dont have a 1.19 maven or gradle import handy
thinking of players :p
would have to google it
It has not inv.
wow nice maven
where click what are the x y
Somehow the greatest compiler and editor "IntelliJ", THE BEST OVER MINECRAFT DEVELOPING, gave me error in the .getLocation() method, that's why I asked. xd
you need to find the 1.19 import somewhere online
likely user error
show the code if you still have it
yes and idk
it should
Fixed punching pc and the screen meanwhile IntelliJ was updating the libraries.
no reason why it wouldnt
👍
however 1.19 may not work on 1.18, 1.17, 1.16 etc
it might
just depends how you used the api & java version compiled against
so do i literally just change the line in my pom.xml to <version>1.19-R0.1-SNAPSHOT</version>
yes
yes
no downloady
and api-version if you are using that
wowe EZ
button in the top left here is the one to press after changing it
Trying to figure out who uses Gradle in the 2022 when Maven exists.
what
literally anyone who wants to compile something in 200ms
im using maven
where is gradle
gradle is like maven but more keyboard smashing
To add my yaw on the location I need like to make it vector, and so on?
wym
maven
my gradle file is small asf
I beileve so
?paste
what is easier to understand <version>oseoeieol</version> or the gradle version forgot what it is
what an excellent and well formulated point you have made
yeah that
groupId:ArtifactId:Version
So like Gradle is reserved for pro Developers. xd
more complicated to read and use
when i first saw pom.xml i thought it said porn 😎
not at all
i dont think ive ever heard that 1
but its nicer if you want things done quicker without as much configuration
in order to add in shading in maven the process is rather complex
You "quicker responder".
in gradle you just add shadowJar task
shadow java
You will be a good helper for one of my old project.
That somehow gives me a strange error.
not to mention, importing files in gradle is like
woooorlds easier
in maven you need to run a command first
then import
in gradle you just make a directory and: implementation fileTree(include: ['*.jar'], dir: 'libs')
You are missing that Gradle imports are less then Mavens one.
??
the most important thing is that gradle has a cooler icon
tf
ok i changed the line in my porn.xml and clicked the arrow wheel button now it is resolve dependencies
elephant
Sometimes gradle import is not present at all.
a elephant
shit looks like a rat to me
Sometimes there is only the maven import

No it always exists
you can convert ANY maven dependency import into gradle
throw any import at me, i will convert it
oh shit
how in the world do u
please help my dependency is not resolving
it is a elephant
think thats a rat
!!!!!!!!!!!!!!!!1111111111111111111111111111111
i never opened theyre website
I'll give you a rat can you convert it
still looks like an elephant
im prolly blind
probably tbh
+1
bad eyesight in my left eye
that explains it
how do i change intellig view distance?
Looks like the ghost from Packman giving you a fist wave
tf is intellij view distance
LMAO
what the hell is going on in this picture
it does lmfaaao
I have view problems and i cannot read small things
how do i fix thid problem
it said its resolving
resolving forever
give it time
AGES
give it MORE time!
real chads use ant
the bar is ant moving
restart intellij reload dependencies again
How to add the yaw to the original location of the armorstand like I need to serialize the vector and so on?
sure
the bar is moving
it has stopped moving it is done now
:D lets see if my plugin work
s
today i went on a walk with my mum and we saw a cat and it was nice to us instead of running away
build suces thanks buoys for your help
Hey, is there a way in the spigot API to make mobs like zombies attack each other or is NMS needed?
What event can I use to check if an item left a players inventory? I want to check if an enderpearl was thrown (thus leaves the inventory) and then get the inventory slot it was taken from.
Would assume this would be part of the InventoryInteractEvent
what's a good way of getting worn armor?
How does Entity#setTarget() work? I can't get my hostile mobs to attack eachother
Afaik setTarget can only target players.
NMS is your "friend" if you want to change that behavior
ah i see, thanks
how do i check if a player takes damage?
Depends on how much time it saves you
I've been trying to make a 1.8.8 PaperSpigot fork, but when running applyPatches.sh, I get a merge conflict on pom.xml, at patch 0001 Pom Changes
Does anyone know how to fix this?
Logs:
$ ./applyPatches.sh
Rebuilding Forked projects....
Applying SpigotMC patches to CraftBukkit and Bukkit
HEAD is now at 6a039faf #745: Expose more information about advancements
Resetting Spigot-API to Bukkit...
HEAD is now at 6a039faf #745: Expose more information about advancements
Applying patches to Spigot-API...
Applying: POM Changes
Using index info to reconstruct a base tree...
M pom.xml
Falling back to patching base and 3-way merge...
Auto-merging pom.xml
CONFLICT (content): Merge conflict in pom.xml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 POM Changes
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
1.8.8 :(
1.8.8
Has issue
Roll tide
this is a git issue more than a 1.8 issue
how do i get a runnables ID to stop it outside the runnable?
?1.8
Too old! (Click the link to get the exact time)
ok cool
try running buildtools in another dir
Like, move the bt jar & ur script into another directory and try it
i've already tried that, i've ran build tools in 3 different dirs (i even ran it on windows once)
When you tried it in other directories you are only moving the jar + script, nothing else right?
patches work fine for spigot, it's just paper's patches that don't work
oh
well sir this is a spigot
?paperdev
Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)
tip: if you are working with paper you should use their build system
the paper forums just told me that 1.8 is old
they aint wrong
i mean yeah
i mean yeah but a lot of servers are still on 1.8
it is Minecraft 1.8.8 is 6 years, 11 months, and 26 days old today.
6% are on 1.8 (bstats)
i still make tf2 mods, and the last major update was released 1732 days ago, and counting
well that makes sense, you're running the latest major update
you're running 1.8 which is what, at LEAST 10 major updates behind?
yeah but it doesn't mean because something is old that we can't mod it
but i think the error comes from my inexperience with git
You won't get support from most here due to it not running latest; you're also attempting to use Paper patches with buildtools for some reason?
Rephrased the last part of that as it wasn't 100% right
All I will say, is you should be using Paper's system if you are using their patches, as I doubt buildtools and Paper patches are comptable right out of the box
papermc ver/1.8.8 just adds the Spigot-API-Patches and Spigot-Server-Patches directories
I haven't found much info on creating paper forks
anyone got a good forum/example on how to save a inventory to a database?
Hey guys! I'm just wondering if anyone knows how I can change what a type of sound is? For example... the default 'player.playSound()' always plays it at a super loud volume and the only way to change it is by turning down Master Volume in settings, whereas the '/playsound' command in-game has options to pick what type of sound it is, for example if I pick 'music' I can turn the Music option up and down to change the volume. Is this possible on the Spigot API?
playSound() let's you specify a volume
But that volume has 0 use if you're applying the sound directly to the player, pretty sure that only has a function if you're playing to a location
someone?
That's the best way to do it
but that will interfere with flying...
?jd-s
so i cant...
Well, depends how much you care about exploits
mhm
how do I only make this trigger once?
when the player keeps sprinting it keeps triggering, i know its in a player move event but there should be fix
new BukkitRunnable() {
@Override
public void run() {
if (event.getPlayer().isSprinting()) {
Stamina.removeStamina(player, 0.07);
if (Stamina.getStamina(player) <= 1) {
player.sendMessage(ChatColor.RED + "You are out of stamina!");
event.getPlayer().setSprinting(false);
Bukkit.getScheduler().cancelTask(this.getTaskId());
}
}else{
Bukkit.getScheduler().cancelTask(this.getTaskId());
}
}
}.runTaskTimer(Wired.getPlugin(), 0, 20);
}
When it first triggers you need to add their uuid to a set if it's in the set ignore.
Then when they're not sprinting remove from set
ill just use a hashmap
Why a hashmap when a set works just fine
HashSet. It's like a HashMap but it only stores a key with no value.
this is valid java???
Hey all.
I'm noticing there no way afaik to know when a vehicle takes damage from the void. It neither triggers EntityDamageEvent nor VehicleDamageEvent. Neither does VehicleDestroyEvent trigger on any of this
Is there any way to track vehicles taking damage from falling in the void (or getting destroyed)?
How can I reset the world (remove the overworld, nether, and end and generate a new seed)
That sounds like a bug
delete ./world ./world_nether and ./world_the_end
remove any seed in server.properties
let it regen
Is that even possible to do from a plugin
Probably not since those files will be in use.
why
because I want to to be a feature of my plugin 🧠
just add rm -r world to the start script hehe
within a plugin
I suppose multiverse may be able to do that
yeah well doesnt apply to vehicles ig
how do i get the speed of something using the Vector?
I read that the Entity#getVelocity().length() does not work
You do realize that the Vector is the speed
but how can i get something like meters per second?
I dont know
is LivingEntity#getTargetBlock the equivalent of a rayTraceBlock call?
or well, can i use it the same way
Effectively yes, though it won't consider bounding boxes well enough
There's a more specific getTargetBlock() iirc that does
Yeah. getTargetBlockExact()
That one is more like a ray trace blocks
i was actually looking at that one and just forgot the exact part
https://img.olziedev.com/iW775151H757511ay_v.png currently updating a plugin from spigot 1.16.5, to 1.18.2. Whats the method to set their position and get their yaw/pitch using nms?
@ornate patio try unloading the world
(Make sure there is no player in the world and it can be unloaded)
Deleting the file and then loading and generating it
is there a way i can control the ender dragon's movement? i'm trying to make it faster, perhaps add some new behavior, is there any way I can do this?
Custom nms implementation
I'm not very familiar with nms, could you point me in the direction of some resources?
nms is a wasteland. You are mostly on your own and nothing you do there is supported.
For custom mobs there might be some tutorials but you mainly have to play around and reverse engineer.
well thats not very encouraging.... unfortunately i don't know anything about nms.. so ig i'll look into it
oh, i see, nms allows you to edit the minecraft server source code, if i'm not mistaken
How to add a yaw to a location?
the screenshot shows it all, heres the stack trace and also NullCheck is check Cannot invoke "java.lang.Boolean.booleanValue()" because "NullCheck" is null
at com.plugin.particles.particlesdesign.ConeClass.onDamage(ConeClass.java:73) ~[?:?]
Alpaca is alpaca
That’s what NMS means, it stands for net.minecraft.server
It’s messing around with the server internals to do things unsupported by the API
So I got an issue, I made a merchant.
And I spawn a villager with custom trades, the trades work,
but for some reason when I open the village it immediately closes the menu.
Merchant villager = (Merchant) p.getWorld().spawnEntity(loc, EntityType.VILLAGER);
List<MerchantRecipe> recipes = new ArrayList<>();
MerchantRecipe bread = new MerchantRecipe(new ItemStack(Material.BREAD, 3), 10);
bread.addIngredient(new ItemStack(Material.EMERALD, 10));
recipes.add(bread);
MerchantRecipe tntStick = new MerchantRecipe(ItemManager.CreeperGun, 10);
tntStick.addIngredient(ItemManager.Wand1);
recipes.add(tntStick);
villager.setRecipes(recipes);
}```
trying to make a basic Sit plugin just for fun... how should i go about making the player ride an entity? use bukkit api to spawn say an arrow into world and add passenger? but then how will i handle destroying the arrow when player is done sitting
i also considered packets so that the server (and me) wont necessarily have to manage the arrow but idk if it could break stuff
Are you making like a chairs plugin
or dynamic sitting
yeah just adding sitting on stairs to my smp
in that case i assume you have like a /setchair command right
/sit and then it raycasts to target block
ah so its dynamic
if its a stair it spawns arrow and adds passenger
in that case youde just store the arrow, and when the players jumps/shifts kill the arrow
As well as on server stop and player disconnect
shouldnt need to worry to much about arrows
cause MC clears them by default after x minutes
oh 60 seconds actually
i was thinking VehicleExitEvent but obviously an arrow isnt a vehicle so... what other event would call for leave?
ToggleSneak?
Hmm
lemme look at that event rq
yeah wouldnt call
is the event called ToggleSneak?
declaration: package: org.bukkit.event.player, class: PlayerToggleSneakEvent
PlayerToggleSneakEvent i think so
not that i recall
alr then should just handle sneak, player leave and server shutdown
hm
I cant remember but
Are players even able to dismount after getting used in addPassanger?
if they dont sneak event might not even fire tbh
and might need packets for when player send sneak packet to process the dismount
idk exactly how addPassanger handles that though
oh hey
declaration: package: org.spigotmc.event.entity, class: EntityDismountEvent
look into that
@buoyant viper
https://www.spigotmc.org/threads/disable-dismount-lshift-when-riding-entity.261383/
Seems that gets called when a player left shift after getting used in addPassanger
and from there you can just kill the arrow via getDismounted().kill()
also suggestion
Make it so when you shift right click on stairs with an empty hand it mounts instead of /sit 😛
java.lang.NullPointerException: null
plugin.config.set(member.getId(), true);
member is null
unless it actually is a field for config
ah
ah bungee
ye
i cant figure out why is it null
hello i need help whit goldencrates is it for 1.18.2 can someone help me pls
- this is #help-development
- if you need clarifications for this, ask the resource staff
- #help-server isnt the place either
This is still not the place to discuss this @sweet pike
hello so i was wondering how can i make a fire ball shooter gun But with recipe .
I tried to find how to but I couldn't find tutorial with recipes
Is it smart to store shit ton of data on the player's nbt
such as kills, balance, death, killstreak, private ender chests
or should I use a database
Many statistics are already stored so you don;t need to track them https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html
Best not to store inventories on the player as they can be sizeable
What do u mean
Which bit did you not understand?
sizeable = big = large = huge
each of those 54 slots can have an ItemStack, which could be a schulker box full with other items
Database is always most scalable
So use that if you can
Else Ig a flatfile system works, but is far from ideal
Good as a mock implementation maybe?
alright I will. thanks
if (!plugin.config.getBoolean("" + member.getUser().getIdLong()) == true) {
ty too
?paste teh actual code which is throwing the error
config could be null, member could be null etc
member is not null
i checked
Make sure the receiver objects are not null
getid returns me a thing
member is not null
wdym in config can be null? like empty?
either plugin, config, member or getUser() are null
The variable can contain the value null
I need some help with this code https://paste.md-5.net/iyaqabuzoc.java
I'm trying to halt redstone activity and then restore it
And if it does, running a method on that variable results in an exceptiob
but it is messing up the delays on repeaters and when its on redstone it sets a constant charge
but it is not
member.getUser().getIdLong()
this prints
744118201809371136
this
I'm not sure hold I the delay and dying time
I mean either you or your code lies
is plugin null?
Your config can;t be null from what you've shown
plugin seems to be a field though
That constructor definitely gets called?
idk?
wher do you instance Listener?
is your config field assigned before or after you create your Listener instance?
Where is this in yoru code?
how do i implement a custom persistent data type? I have a class which i have created that implements PersistentDataType and has all the correct methods implemented, how do i use this when setting something in pdc?
in main class
Then debug. your Method where you are getting the null, seperate it outjava sysout("is Plugin null: " + (plugin == null)); sysout("is config null: " +(plugin.config == null));
ok wait
config is null
but why?
check teh javadoc. Is.load() @smoky tinsel?
lel 😄
then your path to ticket.yml is wrong, or the file doesn;t exist
?jd
Been broken since ancient times now ):
md needs a slap
on Bungee
ohh
lol, bad time to do that
it's probably around 3 or 4 am his time?
uh
maybe later. around 6
xd
hello so i was wondering how can i make a fire ball shooter gun But with recipe .
mans leaves for days and then comes back with shit like this
i will really appreciate it
wut

anyways
You would just use the shootProjectile method
why does my config returns null?
i did it
but idk how do i make it as recipe
path is bad or file is not where you expect it to be
path is not bad. file is there actually
is it valid yaml?
The latter message was actually for me I believe
do you have any links for support ?
😊
You would have to use the Recipe and and register it as a crafting recipe to the server
i have to find the guide
i think so haha
how to check that?
u have a link for help or video tutorial ?
https://www.spigotmc.org/wiki/recipe-example/
Yes i was just looking for it
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
my file is empty lel
this is the hardest part to understand
thx
3 characters are what represent the slots
spaces = air
Letters = material which you assign later as shown in code
can I get some help with this code? https://paste.md-5.net/uhuxudadop.cs
wut
so the general idea is to stop redstone activity and then restore it
are you trying to power a piston before i even read all that
oh you were the one in here yesterday doing that huh
im here everyday
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
yes i know that
whats with the thread stuff?
so basically its messing up the timings and extending a 1 tick pulse to greater
and sometimes it creates a constant pulse
also if your catching this error i feel like theres a bigger issue at play
@EventHandler(priority=EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();
if(p.getItemInHand() == Material.BLAZE_POWDER){
Fireball fire = p.getWorld().spawn(event.getPlayer().getLocation(), Fireball.class);
fire.setShooter(p);
}
else if(p.getItemInHand() == Material.BLAZE_ROD){
//Do whatever
}
}
ok i have done this how can i make it recipe ?
i did
.
its really temperamental
how to make it not error?
facts
does anyone know this?
its hard to maintain code when it isnt modularized
Timings as in spigot/paper timings i assume?
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();
if(p.getItemInHand() == Material.BLAZE_POWDER){
Fireball fire = p.getWorld().spawn(event.getPlayer().getLocation(), Fireball.class);
fire.setShooter(p);
}
else if(p.getItemInHand() == Material.BLAZE_ROD){
//Do whatever
}
}```
ok how can i make it recipe?
if config is null use .load() it should give you an empty config
can i get a more bigger stack trace by chance
heres a better picture
I sent the article, you need to reister the recipe to the server
then from thre the result item should have some type of PDT identifier
that you from there check on your interact event, and then fire the fireball
in the article?
https://www.spigotmc.org/wiki/recipe-example/
You would create some type of RecipeHandler that would handle loading all your recipes in onEnable
so is there another approach to this?
Honestly
that codes really hard to understand if im being honest you send, idk what all the thread stuff is for
me?
yes
what thread stuff?
what is line
im not doing thread stuff, please show me what you are referring to
Whatever your doing in the first start of the event
.
which part?
Not sure what any of the thread stuff does
idk why i read that as thread mb
Do you having the timings you mentioned earlier?
its 4am lmao
Timings should have stacktrace to the method calls causing your timings issue
all g, and no, basically its 1 tick and, 1 repeater, then I halt and restore and then there are two repeaters powered
idk how to measure timings
Why halt the server?
ConfigurationProvider.getProvider(YamlConfiguration.class).load("");
Should give you a blank config
thx
what?
i read that wrong
any ideas, I know this is complicated
sry my discord keeps reloading itself
everytime i typeit reload and deleted my msgs smh
I would do java config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data); if (config == null) ConfigurationProvider.getProvider(YamlConfiguration.class).load("");
if I shared my screen briefly would it help you understand whats happening?
wait
yea i did that
I'm making a plugin that adds in the magic mirror from terraria, does anyone have any ideas on what Particle and Effect I can use for making it look and sound the part?
and this is firing every one tick you said?
when you want to implement server halting im like 99% redstone blocks lock when you set theyre power no? I could be wrong on that
just as long as no block updates happen nearby i would assume
that method seems rly heavy
now
lel
?paste some actual code then. Where you set config
config is null still
Holy crap
too much guesswork
your mailing in that loop?
config is null***
yeah?
hollyyy
whole listener is 800 line...
show me yoru onEnable
i've profiled it, there isn't any performance issues
?paste so its readable
there was before, but I fixed that up a lot of versions ago
why
Its just hard to figure out the codebase for that method
So its extending for one tick longer than it needs to be halted for correct
what check should i use then?
or somtimes constant
how to check if file object is empty?
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);
if (config == null) ConfigurationProvider.getProvider(YamlConfiguration.class).load("");```
!file.exists

use the exact code I showed you. no extra if tests
so this?
this redstone stuff seems to be more trouble than its worth
but I really want it to work
what event is called when a player joins the bungeecord server
if (!(data == null)) 😢
Many beginners mistake
like if (result() == true)
ItemManger.init
i'm trying to do the itemanager but its shwoing red line
ItemManager.init();
I mean which event is triggered when a player joins bungeecord not change or join spigot server
is init() a static method?
yes
Then you have some very bad design
public static ItemStack SnowBall;
public static void init() {
createSnowBall();
}
private static void createSnowBall() {
ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
ItemMeta meta = Ball.getItemMeta();
meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
List<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "Shoots Snow Balls");
meta.setLore(lore);
Ball.setItemMeta(meta);
SnowBall = Ball;
}
}```
we'd need to see whole code to comment
that init is a member of ShooterDesign not ItemManager
which event is triggered when a player joins bungeecord not change or join spigot server
Where is ItemManager?
Where is teh Class ItemManager ?
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new EntityKill(), this);
getServer().getPluginManager().registerEvents(new FrogKill(), this);
getServer().getPluginManager().registerEvents(new WitchKill(), this);
ItemManger.init
wdym
u want all classes
?
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class ShooterDesign {
public static ItemStack SnowBall;
public static void init() {
createSnowBall();
}
private static void createSnowBall() {
ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
ItemMeta meta = Ball.getItemMeta();
meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
List<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "Shoots Snow Balls");
meta.setLore(lore);
Ball.setItemMeta(meta);
SnowBall = Ball;
}
}
You are referring to something called ItemManager
which event is triggered when a player joins bungeecord not change or join spigot server
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Random;
public class WitchKill implements Listener {
@EventHandler
public void WitcheKill(EntityDeathEvent event) {
ItemStack WitchPotion = null;
double percentage = 0;
switch (event.getEntityType()) {
case WITCH:
WitchPotion = new ItemStack(Material.SPLASH_POTION);
PotionMeta meta = (PotionMeta) Bukkit.getItemFactory().getItemMeta(Material.SPLASH_POTION);
meta.setDisplayName(ChatColor.DARK_GREEN + "Witch Potty!");
meta.setLore(Arrays.asList(ChatColor.GREEN + "Drink it Drink it Drink it Drink it!!!!!!"));
meta.addCustomEffect(new PotionEffect(PotionEffectType.WITHER, 1200, 3, true , true, true), true);
meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
percentage = 0.15;
break;
}
if (WitchPotion == null)
return;
if (new Random().nextDouble() > percentage)
return;
event.getDrops().add(WitchPotion);
}
}
which event is triggered when a player joins bungeecord not change or join spigot server
?paste
package deepsmp_plugin.deepsmp_plugin;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class ShooterDesign {
public static ItemStack SnowBall;
public static void init() {
createSnowBall();
}
private static void createSnowBall() {
ItemStack Ball = new ItemStack(Material.DIAMOND_HOE);
ItemMeta meta = Ball.getItemMeta();
meta.setDisplayName(ChatColor.WHITE + "Snow Shooter");
List<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "Shoots Snow Balls");
meta.setLore(lore);
Ball.setItemMeta(meta);
SnowBall = Ball;
}
}
wrong
one
srry
wait
Yeah spam teh channel. That will be so nice.
sorry bro
That is ShooterDesign
You are trying to reference soemthign called ItemManager in your onEnable
which event is triggered when a player joins bungeecord not change or join spigot server
I already linked you to the jd for ALL Bungee events
naming is not proper
You have no ItemManager
I cant understand
how can i add one
can you tell me which one is triggered when a player joins bungeecord not change or join spigot server
You have ShooterDesign
yes so ?
so |f you want to call that method you use ShooterDesign.init(); not ItemManager.init
ItemManager != ShooterDesign
oh ok thxz
thx
ok worked
The PostLoginEvent is called once teh player has fully Logged in to Bunge and is ready to be sent to a server https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/event/PostLoginEvent.html
ok
are barrier blocks considered solid or transparent? Cant check rn
?stash
can someone help me find maven dependency for TabAPI 😭
solid = can be built on. Transparent = doesn;t block light
It is also isOccluding()
i thought about this tbh
ey hey! i've recently worked on a project that requires modifying the mob ai. i've come to a stage where I think my approach don't work. i want certain entities to not be able to go into certain regions. what is the best way to do this?
i've tried using a pathfinding goal, but it seems like it's way harder to modify each movement pathfinding goal to make sure that the entity doesn't walk in these certain regions.
i feel like its a lot smoother ngl
you can keep /sit too
and have it as a secondary option
I'm making maps for minigames, but I need meta data about each map like where the spawn locations are. I could hardcode this for each map and create an object in code for each map, or I could also store an additional file in each world and read that. Any suggestions on how I could store this meta data?
file per world
<worldname>-settings.yml
and store various things like that inside of it
right
spawn chunk PDC
alex has a library that saves per block pdc in chunk pdc
pretty smart ngl
Any idea how to fix this, texture pack is on the google drive in .rar format, and code is here
I'll look this up
did you forget to set the hash value?
is rar an accepted compression format?
i dont think so for mc
.zip
i do all my textures and stuff in .zip
never have issues
Use zip
ok i will try it
What are the advantages/disadvantages of a yml file per world vs a spawn chunk PDC?
PDC would be siginificantly faster
SpawnChunkPDC travels with the world, always.
and your not using IO as well to read/write from the files you would be using
even tho its only one read tho
still
Decoupling data is an advantage sometimes
main problem is that if you save stuff in pdc its significantly harder to read out
Worlds have pdc too
yea exactly
the fuck
what next u gonna tell me MinecraftServer has a container too
they do?
Mhm
How do I use it
yup
I mean having your own yml thing is advantageous because you decide when to read and write for instance
same as any other
?paste
also it's easy for me to go into the file and edit it
(object extends PDC).getPersistentDataHolder()
And well, if you use a binary format then it might also be quite fast additionally
smth like that
Location datatype https://paste.md-5.net/ohusimuqet.java
right
getPersistentDataContainer*
someone needs to make a bunch of custom data types and make a commit to spigot with them
like why isnt Location a pdt type anyways
Doubt it would be accepted
^
i doubt it too
no things to help api ever do 
still waiting for varags event registration
🤮
God imagine using a library
🥲
"Sorry i only write my own libraries"
Not like spigot is a library or anything

?paste
lol
AnyPersistentDataType<String, T>
Which is backed by Gson. You can throw literally everything at that.
isnt it s programming language
oooo pojo data types
This now gets confusing
nah its easy
cause I store a world for each map
gson handles it for u
my solution is to just turn it into a b64 string and convert it back
just have a pojo structure class and bam
the library just needs to know what object from and to
but everytime a minigame is launched it creates a clone
So what’s the problem?
?paste the error
well the PDC should be copied a cross if I'm cloning the world so that should be fine
?1.8
Too old! (Click the link to get the exact time)
can I write to the pdc even if the world is not loaded?
Why are you writing to the PDC?
I need to store meta data for each map
People still play and mod Skyrim and that’s from 2011
That’s fine, but surely the world is loaded when you’re doing that
no
Why not?
Yes but they use the latest version of Skyrim :p
The base world is only loaded when it's edited
Which (like 1.8) prevents newer versions and changes
https://paste.md-5.net/ofomipiqoz.cs i'm having error the error code and the server error in this link
otherwise it stays unloaded, and a when a minigame using that map is launched it copies the world then loads that world
To be fair we got a new Skyrim
ok
as you cannot copy a word whilst it's loaded
i feel we need more than one help-dev channel
Threads
But why would you be writing metadata to the world when it isn’t loaded?
Surely you only do that when you’re editing the map
Invalid key. Must be [a-z0-9/._-]: SNOW
very true
the ShooterDesign
Your NamespacedKey uses invalid characters
its this line
No caps allowed in a namespaced key
Could be anything. Try updating your os
ah yeah
And once you’ve written the metadata it’s written into the world files, which will be copied when you clone the world
wait no
yup
no namespace keys can have uppercase
So it seems like that would work for you
No they can’t
yeah it should
all lower case letters
I have to make tools which let me add various information in game though which is annoying
running buildtools should add the stuff required for nms locally right? where exactly is the ~/.m2 meant to be?
ah my bad
Think its in your user folder
??
If you’d prefer to edit it as a file you can just store the data as YAML instead
i thought ShapedRecipe was the namespacedkey for some reason i nthat example
its the library you build against if you dont move them. Also contains javadocs
C:\Users\%USERNAME%\.m2\repository
yeah seems to be in users thanks
wdym?
this line
ok so I just need to figure out how to configure gradle correctly...
namespaced keys can only be lowercase
A namespace must be all lowercase characters, nothing uppercase
how can i fix
Make it lowercase
sigh
change "SNOW" to "snow"
iirc you dont need to do more than to add the correct plugin. At least for maven, i dont need to link the libraries to my ide as long as theyre in .m2
[a-z0-9/._-]
a-z -> abcdefghijklmnopqrstuvwxyz
0-9 -> 0123456789
_- -> _ and -
sadly the plugin isnt on gradle
no special source gradle :/
yeah I could, how hard is it to read/write YAML?
I've not as of yet managed to get this to cooperate with me
Don’t forget .
Very simple
yes i got it but wdym with _- -> _ and -
Painfully easy, pretty much every config file is a .yml file
right
a lot of us tried converting that plugin to gradle no luck as well
Yes
maven only
_, - and . are also allowed
Since it allows someone to make a map without editing the code
so would a YAML be better than a PDC?
