#help-development
1 messages · Page 2291 of 1
If you need access without loading teh world, yes
YAML will likely be a tiny bit slower, but will be human editable
It really depends on what you want out of it
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
human editable is nice
if you load yaml files on startup you wouldnt notice too much a difference tbh
and then save files from cache async every 5 mins + on shutdown
There won’t be a ridiculous amount of difference either way
youll have overhead creating new files tho
thats all as long as you cache all config files you need starting up
For the amount you are going to be accessing/changing yaml is perfect
yeah it doesnt sound like it wont be much data
like 100 lines of yaml at max it sounds like
indeed
Bukkit also has a getter for Location in yaml
especially if you async it
it'll depend on exactly what the minigame is but it shouldn't be too much
oh that's nice
shouldn't need to do that but good to know
its aids
oh no wonder, I forgot mavenLocal in my gradle
but can be useful
if I made something like hunger games I'd need to store chest locations and spawn locations, that kind of stuff
Although serializing item stacks is on the less human editable end of the spectrum
yeah its total aids
However you are likely not going to be able to use it. Your worlds will not be loaded so creating an actual Location for an unloaded world will fail
LocationReferance with a Location Getter bam
It should be fine on this front
There’s no getter for Vector is there? I can’t remember but it would be great for this
well folks it was a good run, 5 years of making plugins without ever touching NMS code but today I have to look at that because I need to mess with bounding boxes and hitboxes (I think hitboxes might be impossible but bounding boxes I must change for sure)
Vector is ConfigurationSerializable so its fine https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/Vector.html
Hitboxes are client side by entity type
yeah I thought something like that might be the case
I'll just cheat for the hitboxes
wait, so when a location is stored in a YAML, it stores the world too?
If I try and load a location from YAML will it not work if that world is not loaded?
no, it stores teh world name. When deserializing the Location object attepts to pull a World
Well. A Location is inside a World. How would you construct a Location without a loaded world?
Specifically, the name of the world iirc
Use Location.toVector and store that
If it stores the world name then I thought it may not need the world to be loaded, then I can just set the world of the location to the one I want
right
then turn that back into a world
so YAML can store vectors?
ok sick
It can store everything, just serialize it
Vectors specifically are already serializable, you don’t need to serialize it yourself
👍
I'm not familiar on how to serialise things which aren't already serialisable
vectors should be fine based on what Alex just said though
Keep in mind that the rotation then falls off
worry about that after 🙂
yep, just pitch and yaw
kk
Then create your own pojo and let it implement ConfigurationSerializable
pojo 🤔
plain old java object
plain old java object
oh lol
smh not again
F
hmmm?
The new favourite acronym of the month.
oops well this is a bad start, 5 seconds into trying to look into nms custom entities and I realize the guide I'm following is probably horribly out of date
classic
👍 👍 👍
certified hood classics
NMS moment
nms and malding, name a more iconic duo
public record Position(Vector vector, float pitch, float yaw) implements ConfigurationSerializable {
// TODO Constructor or static deserialize method
@NotNull
@Override
public Map<String, Object> serialize() {
Map<String, Object> map = new HashMap<>();
map.put("vector", vector.serialize());
map.put("pitch", pitch);
map.put("yaw", yaw);
return map;
}
}
ty
spigot development and crippling depression
nah nms blows that shit out of the water
record?
New Java thing
right
Imagine being me
forcely
records are nice
I think I'm on java 17 🤔
it feels like being a blind person in a maze except the cane you have is red hot the maze walls are electrified and the maze layout changes every time mojang sneezes
doesn't seem to know what record it though :<
Would add
public Location toLocation(World world) {
return new Location(world, vector.getX(), vector.getY(), vector.getZ(), pitch, yaw);
}
As well
This is why we have mappings
Doesn’t include pitch and yaw
lmfao
Well
Ah yes. Looks good.
Hello @lost matrix @hybrid spoke !
I have a little information for you about the thing I asked ↑
There's a way to get project informations inside YAML files with Maven himself !
Just use references as if you where using property refences, with "project" as base key.
For example, if you want your project version, use ${project.version}. For project name, use ${project.name} etc...
imagine tagging..
Yes. We already suggested that...
Didn't you suggested me to create a custom plugin ?
do I look like I know what a jpeg is?
ok I'm doing something wrong here
I'm on java 17
you would use maven shade plugins filtering for yaml variables
We gave you 3 Options depending on if you wanted to change files inside or outside of your project.
And for specifically the plugin.yml we suggested the macro ${}
Oh alright, so now I know that we can use macros in every yaml file ^^'
Sorry for this waste of time
all good
no import for ConfigurationSerializable
If you're using intellij (idk for eclipse), I think you should look at your language level
kk, will do
First is your java version
Second is your language level
The fact that the import is missing is the real cause of the issue
hence it will not be able to understand the override annot etc
hey cool kids 😎 what's lit 🚬 anyone got some real cool 🏄♂️ build.gradle files with the remappings option they can share? I'll be over in the corner flossing while I wait 🕺
paperweight-examples
I wouldn't use gradle to be honest
It's fucking trash - doesn't even support ftp OR sftp with key auth
well I don't want to go back to waiting for 2 minutes on every compile
Gradle touched me inappropriately.
show me on the codebase where gradle touched you
That's why you use your own build tool
I don't want to waste my life messing with the build system, I want to waste my life resolving my own bugs
'perfect! A different error!'
it is really annoying how everything is posted in a maven format
If you have issues converting between those two formats, you might be unsuited for gradle
Maven is king for nms
I usually get around it just fine, I've just never messed with a lot of the options remapping requires and was hoping I could just yoink them from somewhere instead of having to do something filthy like thinking
If you are using gradle, paperweight is the only option
I'm going to have a fun time when I realize the remappings don't cover what I need anyway lol
I’ve seen some GitHub projects that claim to do it with SpecialSource
Remapping anything yourself is a fool's errand thanks to tiny-remapper's hidden "features"
Idk if they work
Probably using mojmap with nms
fine whatever I'll go back to maven for this project
I want to create custom entities with custom bounding boxes
arent bounding boxes part of the spigot api
mhm
can't modify them on existing entities as far as I can tell and have tested
which is a crying shame
no i meant, can you project a bounding box
just display an invisible armor stand with no collision thats immortal to hold your graphics, then project the box around that
I need to utility that a custom bounding box gives
i.e. how it moves through the terrain considering the new size and where it suffocates and stuff
also ultimately this is going to lead into me downright creating my own behavior for these dudes which unless the api has changed is still not possible to do with the spigot api
eh fair point
yeah I've not been holding back on this for 5 years for nothing
if there was any conceivable way of doing it through the api no matter how jank it would be I'd go that way instead
now im curious but i dont have the energy to try myself
on which version are you doing this anyways
19?
yeah happened to be on 1.19 but it is probably going to target 1.16 and later
not much changed since in my estimation
maybe 1.14 if I am feeling spicy
Nah, I'd stick with 1.16+
But multi-version nms is a bit more difficult than you might thing
reflections right
it's fine for this one because I just need one thing
mr oinkers with a custom bounding box in multiple versions
when I get to doing AI that's when I will probably reconsider my life
I don't think you can go that route with what you want to do
You need to have a multi-module project or a project with multiple source dirs
I've not even really looked at it yet but if what I am looking to do is viable through the mappings is this going to save me any work?
Hello i have a little problem, my plugin wont load and it says that :
https://paste.md-5.net/niwafumape.css
is any possibility to send message after player click on hyper-click?
doing it with mojmap is the prefereable alternative to using obfuscated names
I don't think you can perform two actions at once
meh, the problem under [click here] is value to copy, but player dont really see if something was copied
even mouse cursor not changing look
Ask mojang to change it, perhaps you'll get lucky
hmm maybe there is some minecraft command which i can use to copy a value to player clipboard
so then i could both copy value and send message
is there any method that returns me what type the block is? example: BlockStairs, BlockLadder
https://gyazo.com/cc427610ed7ee68ae52553b2e9eda98a
I get that I should add a cooldown but it should trigger straight away so there isn't a need for one but I will add one later to avoid double messages
if (this.plugin.getSpawnController().getCuboid().isIn((player))) {
if (outOfSpawn.contains(player)) {
Vector vector;
vector = player.getVelocity().subtract(new Vector(3,0,0)).multiply(-5);
player.setVelocity(vector);
player.playSound(player.getLocation(), Sound.NOTE_BASS, 100, 100);
player.sendMessage(ChatColor.RED + "You can not go back to spawn");
}
}
.getClass()?
is there a way of uniquly identifying an item via a uuid, i looked at NBT but i cant seem to understand if it helps
What do you want to do in the first place though?
PersistentDataContainer
Would anything bad happen if i redirected 50 players each (together 100) to another server?
is not working
Though you'd need to use NBT for versions below 1.13, and there is some funky class for 1.14
what exactly are you doing?
So redirect 50 players to another server twice at the same time
Right now you have only proven me that those classes exist, but I do not know what those are nor whether you have an instance of those
Well you probably don't have an instance of that class, so go fetch one first
Then call .getClass and the issue is resolved
Though keep in mind that this method is private, so you may have a few issues
then what prevents you from doing blockNms.getClass()?
but then I wouldn't have the methods? outside that I shouldnt define what type the block is?, because in some classes there is no method y()? it's weird to think that way
would someone mind helping me out?
Where is that code running? If you want to keep someone out I assume that's the player move event?
In a player move event
there is nothing to hide here, it's just alot of unrelated code
!paste
?paste
You need to map those on a per-class basis
Bump. Does anyone know how I can do this?
when the worldgen plugin almost works correctly but doesnt
boys ngl
it seems like I have forgotten all about maven in the... 3 years I haven't used it
good old use it or lose it memory
same with java, need to retake courses 🙂
Is it better performance-wise to write good skripts or bad plugins?
Well you can go very very bad with plugins
depends on how good the skript is vs how bad the plugin is
Wdym
I'm getting unsupported class file major version 61 when compiling with maven even though supposedly I'm targetting 1.8
the hell
are you shading ?
yeah
make sure you have the latest shade plugin
Bump
latest shade version is 3.3.0
who asked you
3.3.4 ? xD living in the future lol
how did that even resolve
Here is the issue I'm having, with a video
like a lyrical genius once said, I'm on that next shit now, I'm so three thousand and eight, you so two thousand and late, I got that boom boom boom, that future boom boom boom, let me get it now
🙏
Switch to a better language like JS. Never compile again 
🤘

Hey, I have 11 seconds of build time on one of my projects
So don't be all too disgusted by 1.4 seconds
You clearly are not spending enough time writing code if you worry about a few seconds compile time. Write better code, compile less often 😉
Just stop coding bugs... simples
this project is like 5 files large
my main project is several hundreds of classes large, last I tested maven on that it took several minutes
From experience I can tell that actually compiling something takes not that long
Yeah, Maven hates you for being a traitor
yall just jealous I can compile >60k lines in .1 seconds
She's a jilted lover. You still use her repositories but you never come by to say hi anymore.
I left her for her cool, younger, more hip daughter too

gradle babyyy
15 mins initial build
I assume you have never written anything beyond the bare minimum of gradle buildscripts
that was years ago I don't even remember that
also not 15 minutes that's for sure
nah thats my situation rn
Oh yeah, the initial build times with gradle are humongus for some projects
I mean the whole point is that you only compile what you need once you do the initial one
how many initial builds are you doing a day
for massive projects
Afaik paper's build time is also in the tens of minutes despite them using gradle
Does anyone know if it's possible, and if so, how to get the added enchantments from the EnchantItemEvent ?
?jd-s
There's a method #getEnchantsToAdd which returns a map
yeah
Those are the enchantments that could be added if I'm not wrong tho
If you just want the enchantment inoke .keySet on it
any way to detect when a player has loaded into a world after sending them there?
I mean- paper has to do a LOT of initial stuff. If we were to use maven you'd be waiting that long a lot more often xD
or do i just have to use a runnable
basically im trying to display a title after the loading screen disappears
I don't think that invalid values are added there by default
It's only other plugins that can add those
That was the event
display a title the first time you see a move packet
#getWhichButton() and then that int from #getEnchantsToAdd() ?
The int is the level
It's a hashmap - there is no order
And that map stores the enchantments that will be applied
So basically there's no way to see which enchantment was added in that event?
Get map of enchantment (levels, keyed by type) to be added to item
Why do you believe that it does something else?
that method does exactly that
Alright, thought it lists all enchantments available in the table
That would be nonsensical
ikr
Even from a design perspective - why would you want to know what could've been?
idk
how do i transfer a player to another server? (bungeecord is installed)
How to get an enchantments name? enchantment.getKey(). ??
as #getName() is deprecated
.getKey.getKey
damn okay
Then you might want to do some magic to bring them from the fire_aspect format to the Fire Aspect one
(though with translated components you might be able to get away with that)
Will anything bad happen if i redirect 100 players at once?
Get key of the key
Who will get the key of the key of the key?
hey guys some french here ?
Non
Well any available bandwidth will be gone if you do that
Well I can read and understand french. Not so much write though
How could i optimize? How could i send players in batches?
so i can write in english don't worry
(though in spigot spaces you should stick to the english language)
Depends
i need help for some plugin someone can help me ?
Go on big man
so i try to do some custom tab and scoreboard and on the every plugin i can found i can't place my logo on the both and on scoreboard i don't find how to remove the number in red
xD
You can;t remove teh number, that is the score
Ohhh
ohhh
xD
you can set them all to zeros
ok so why on a french serv where i play he don't have the number ?
Packets/resource pack is my guess
ohhhhhh
so if i want to put my logo on the scoreboard and the tab i need to to ressource pack or packets ?
Yeh probably. Dont get into packets. It will ruin ur liking of coding for minecraft
show a pick of this scoreboard with no numbers
i can't on this chat :/
!verify
Usage: !verify <forums username>
Oui
!verify L3onis
A private message has been sent to your SpigotMC.org account for verification!
i try to do this thing
Thats a resource pack
definitely
for the rank too ?
how i can do it i never do custom texture pack
They might be using that
Pretty sure there plenty of tutorials on yt
for custom texture pack ?
Yes
ok thx i gonna check
Np
i see itemsadder cost 20€ xD
Yeah…
How would I go about getting the amount of levels the enchantment cost?
Or is it always level 1: 8 lvl, Level 2: 10 lvl, Level 3: 30 lvl?
what exactly do you mean?
?peint
or is there sth else i need to add in code of a plugin
?paste
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Name/IdeaProjects/FreeMinecraftModels/src/main/java/com/magmaguy/freeminecraftmodels/customentity/CustomEntity.java:[3,34] cannot access net.minecraft.world.entity.EntityType
bad class file: C:\Users\Name\.m2\repository\org\spigotmc\spigot\1.19-R0.1-SNAPSHOT\spigot-1.19-R0.1-SNAPSHOT-remapped-mojang.jar(net/minecraft/world/entity/EntityType.class)
class file has wrong version 61.0, should be 52.0
huh how does this even happen
is that a java version issue?
java.lang.IllegalStateException: Duplicate recipe ignored with ID minecraft:snow
at net.minecraft.world.item.crafting.RecipeManager.addRecipe(RecipeManager.java:93) ~[?:?]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe.addToCraftingManager(CraftShapedRecipe.java:58) ~[paper-1.19.jar:git-Paper-58]```
the code ```package deepsmp_plugin.deepsmp_plugin;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
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;
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("snow"), Ball);
recipe.shape("SSS","SHS","SSS");
recipe.setIngredient('S', Material.SNOWBALL);
recipe.setIngredient('H', Material.DIAMOND_HOE);
Bukkit.getServer().addRecipe(recipe);
}
}
@noble lantern yo i think your a good support guy can you help i will really appreciate it
you need to use your plugin for the NamespacedKey, not minecraft
ask that already exists
how can i fix
wdym ?
i'm not using main class to do that
let me sing to you the song of my people
??
https://paste.md-5.net/oxuluvuben.java the error and the codde in this link
any support ?
https://media.discordapp.net/attachments/580083630995537961/998614440209567764/unknown.png
Is it possible to add a bar like that, without mods?, with Spigot 1.19
bos barr ?
boss bar ?
look img
as stated, ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("snow"), Ball); is the problem
minecraft:snow is already being used
so do i need to change it ?
the plugin was working but when i added the Bukkit.getServer().addRecipe(recipe); it starts givin me this
if i tried NameSpacedKey(this, "snow")
this will give me red line
pass it your plugin's instance
search in youtube you will find many videos
hey guys, does anyone know that glitch when you are on an edge and when you break the block, (the block break error is cancelled)
but you get teleported to that block y level, basically if u keep mining down and down you are floating on an invisible edge
i want to cancel this
https://paste.md-5.net/oxuluvuben.java the error and the code in this link
any support ?
Hey, I have an issue, I'm calling an EntityDamageByEntityEvent using public static void ninjaHit(EntityDamageByEntityEvent e, int time) { Main.instance.getServer().getScheduler().runTaskLater(Main.instance, new Runnable() { public void run() { ((LivingEntity)e.getEntity()).setNoDamageTicks(0); Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(e.getDamager(), e.getEntity(), e.getCause(), e.getDamage())); } },time); } and it actually triggers, but for some reason the damage is not executed
basically im trying to do like that when smbd hits someone it hits him twice
https://paste.md-5.net/oxuluvuben.java the error and the code in this link
any support ?
.
as stated, you need to use your plugin's instance INSTEAD of using NamespacedKey.minecraft("snow"). Please read what I am saying to you instead of asking constantly for help
he cut off his error, but his error is from using the same namespace as another recipe
i cant understand what you mean
you need to put your plugin's instance there
the code ?
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;
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("snow"), Ball);
recipe.shape("SSS","SHS","SSS");
recipe.setIngredient('S', Material.SNOWBALL);
recipe.setIngredient('H', Material.DIAMOND_HOE);
Bukkit.getServer().addRecipe(recipe);
}
}
i have 4 classes
lol
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?spoonfeed
bruh I cannot type commands
I am not going to write code for you that you won't understand
Bro give me something easy to understand
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
read that
Static abuse 💀
Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
there it is
ikr
some day i will come back
or maybe after a minute
im acc gonna kill myself
i keep getting IllegalArgumentException
but the arguments are perfectly within the java laws
If you don't wanna be open to learn feel free to stop trying to code it requires code 🥲
Send the code throwing the exception and the exception
^
public List<PotionEffect> getEffectsFor(int deathNumero){
potionEffectList = new ArrayList<>();
this.config.getList("deaths." + deathNumero).forEach(__effectList -> {
List<Object> effectList = (List<Object>) __effectList;
potionEffectList.add(
new PotionEffect(
PotionEffectType.getByName((String) effectList.get(0)),
Integer.MAX_VALUE,
(Integer) effectList.get(1)
)
);
LivesMain.getInstance().getLogger().log(Level.INFO, effectList.get(0) + " is the effect name, and " + effectList.get(1) + " is the amplifier");
});
return potionEffectList;
}```
i was literally doing that my brother
the config is
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
deaths:
'1':
- ["speed", 12]
- ["haste", 10]
this is the config
no its formatted wrong
Get string list instead of casting
Also a better format would be like haste:10
no thats just gonna be confusing
we already did this yesterday with Maps
&callEvent problem
alr
Explain what you are trying to achieve. End goal. As you seem to be changing your approach every day
You seem to just be getting all the effects in all the sections under "deaths" and adding them to a Big old List
ok am back
https://paste.md-5.net/oxuluvuben.java the error and the code in this link
the player cannot write to the chat, while an error is displayed in the console
"sent message with invalid signature"
I use the plugin Chatty
Does anyone know how to block this kind of movement (yes, the server does know about this)
https://paste.md-5.net/oxuluvuben.java the error and the code in this link
supporttttt i will die
?paste
Thats not the whole error
minecraft:snow already exists
- Use Dependency Injection
- I don't know what kind of error it is
- don't abuse static make a proper singleton
- use proper naming conventions your naming conventions are off
- Use your plugin for namespace not minecraft
new NameSpacedKey(JavaPlugin plugin, String key)
haha Y2K_ remember the time u beat me in trivia cause u typed faster
guys if an inventory gets closed for everyone and not saved in any list or hashmap, will it cause any memory leak if i have some player objects in it's holder ?
do i type new NameSpacedKey(JavaPlugin plugin, String key)
?
NameSpacedKey is an object your not passing through your instance because of the way your code is set up
i just want to know WHAT THE HELL DOES minecraft:snow is duplicated
means
.
its the way your supposed to use NameSpacedKeys using minecrafts namesapce is not supposed to be used by plugins
you are just so up your own ass
this guy is an idiot and unwilling to learn properly
^^
I guess those two are the same thing
they are
yes i am idiot
my pc sucks
i love you
its takes ages to open google
can agree
if it takes ages to open google, how are you playing minecraft
^^
you'll never beat me in united states trivia
its takes ages too
recipes cannot overlap with names
i play on 30 - 20 fps
eyo bro u challenging me?
i actually learnt all the countries the trivia bot asks
yes
how can i change the title of an inventory in 1.17.1 api
you can only set the inventory name when it's created, you can't update it after
can't with api
though u could use nms and packets
ok but which packet
no clue just know its possible
a lil bumpy bumpy
lmfao 2 ages to teach me how to fix while me fixing it in 2 seconds by using my big brain skills
;)
depends normal cancel break event shouldn't have that level of lag
what are you doing
you open an inventory with the same menu id
but different title
horribly hacky
but oh well
Wonder if that resets the cursor’s position on the screen
Hacker 

wdym
SO SHE SORRY DO SEE STILL A SAIDHUH
there is a massive delay between the break and regeneration no way your not using something besides e.setCancelled for that
try the lowest priority
its quite normal, this glitch is used a lot
or just set their gamemode to adventure when you don't want them to build
wont lowest make it go last?
its kinda like World Guard
thats so ironic
not really?
it makes a lot of sense
declaration: package: org.bukkit.event, enum: EventPriority
why is highest in the bottom?
if highest means highest priority, it should be on the top no?
oh my bad monitor is last lowest is first
yes
What is a menu id
This pretty much explains it tho
HIGHEST -> "Event call is critical and must have the final say in what happens to the event"
menu id is in NMS its not API
the container id/syncId is how the server and client know what inventory is meant
read the javadocs
How can i get it
Cast to craftinventory
GetInventory
And then
is that Lego Batman
My pfp?
yes
Thats general kenobi
Don't lie to me. I can see it's Lego Batman.
I'm so thirsty bro but I don't wanna get up
AbstractContainerMenu contains the id
Can you tell me what to do pls?
ahhhh
does that even exist
Paperweight userdev
Altho that adds paper api to your classpath
But you get access to cool stuff
its net.minecraft.world.inventory.Container
ok how can i use this Container thing
basically easiest is nms's Player.containerMenu.containerId. Returns the current open inventory container id
doesnt work in the slightest
ok
test:
- i_love: lean
- asd: abc```
lets say i dont know what the values inside test are
me too bro
#DehyradtedButStillBinging
get the key, and then get its value
.get keys(true)
isn't the containermenu the player's inventory ?
because you didn;t setup your yml as I showed
i did 💀
i changed the yaml
deaths:
'1':
speed: 12
haste: 10```
btw guys, how does one make an array of objects in yaml
I DID
thats not looking like yours Giorno
[a, b]
so long as your effect name is correct that code is fine
or
- a
- b
how would u add props to a?
props?
Wym props?
what is this gmod?
Lol
properties
what kind
Reduced to atoms >:)
Reminds me of the async repo
Hehehehe
arr:
- myObject:
dingus: yes
- objectNumberTwo:
dingus: no
smth like this
Yes
a list of objects with have properties in them
my eyes
@small current https://github.com/PaperMC/Paper/pull/7979/files
or as a key val pair
Or if you want it more compact
yep
It's actually really convenient
[{k1:v1},{k2:v2}]
Ok then just store java in yaml
oh no no god no
Json is yaml basically
So go for json if you want to
lets store json in the database
Yaml accepts that
I store json into MySQL / Sqlire
good
can relate
or, just use json files as database
speed? we dont have that
so there is a method for that
in paper
You have to use valid names yml deaths: '1': SPEED: 12 JUMP: 10
You will also need to increase those values as those are in ticks
theyre the amplifiers
what is this
ah yep, using max int for duration
but not the haste
haste is not a valid effect
Haste is SPEED
im using getByName
yes, still needs a valid name
trying to make always-visible nametags, with a negative sized slime and an armorstand (they are visible purely for testing purposes)
how can I make the name closer to the head of mob, perhaps even adding multiple lines?
Isnt haste DIG_SPEED ?
yes it is
so SPEED and FAST_DIGGING
What version?
the name is "haste"
no, the in game name is probably haste
bruh
this right here says haste
the effect name is from this table https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html#getByName(java.lang.String)
do i need to make it caps too
1.19
You can do a lot of different things with different entity hitboxes.
One entity can have multiple mounts at once.
Why?
NamespacedKey key = new NamespacedKey(this, "bottttle");
ItemStack itemStack = new ItemStack(Material.BOTTLE);
CampfireRecipe recipe = new CampfireRecipe(key, itemStack, Material.MAGENTA_BANNER,100);
Bukkit.addRecipe(recipe);
Cannot resolve constructor 'CampfireRecipe(NamespacedKey, ItemStack, Material, int)'
Which spigot version are you using?
sorry to push- but what do you mean?
ok it works
for minecraft 1.19
no errors too :O
i'm not connecting the dots ahah
Do you have vault as a dependency?
hmmm probably becase thats nota valid constructor
vault ??
I am new in the dev java with spiggot
Also: Your constructor is missing a float
that it ? (float) 100);
CampfireRecipe(NamespacedKey key, ItemStack result, RecipeChoice input, float experience, int cookingTime)
CampfireRecipe(NamespacedKey key, ItemStack result, Material source, float experience, int cookingTime)
oh sorry
i'm in 1.19, what do i need to activate chat preview?
only in the settings file
or is there sth else i need to add in code of a plugin
Isnt this a client setting?
oh, wait i see what you mean with multiple entities, but i'm not sure how hitboxes can affect the offset of the armorstand nametag
bigger hitbox = further up
It should be a marker anyways. So the hitbox will be 0
pretty sure it's a server thing too, the true reason mojang added that was that so servers can't modify messages after they are sent, they could only modify it while the message is being typed (and the player would see the preview live), so that mojang can sign the message (goes along their report system too)
haha lemme go look up what a marker is
do i need to modify the hitbox of the marker?
because I don't see how to do that
would it require another nms implementation?
.setMarker(true)
oh, i'm changing the ARM
armorstand
into a marker
i thought marker was a seperate entity ahah
Believe that was the initial implementation plan for mojang
But they altered it to that
is it possible to make zombies target passive animals?
Yes
I would try Mob#setTarget(LivingEntity)
If that doesnt work then nms ai tinkering
yeah it doesnt work
why cant i give a player an effect when they respawn
try delaying it a little
you can, at teh correct time
Code pls. Sometimes you need to do stuff one tick later.
oh alr
ie, not in the respawn event
its the one tick, for respawn things it is 99% of the time
is it cancellable?
dont think so
nvm its not
During the respawn event you are neither dead nor respawned. You are not even in the getOnlinePlayers().
Events are generally called before something happens. Unless its phrased as in the past.
For example PlayerChangedWorldEvent
Because the event can alter the outcome.
oh yeah the delay works
so if the event isnt cancellable
that means the event is triggered after the stuff has happened?
Doesnt matter. You could still change parameters.
i should give up programming and become a bakery owner
Generally, if it is cancellable it fires before the actions. However the respawn even it not cancellable ut does happen before you respawn, so you can alter the respawn location.
generally no
Events are always fired before something actually happens.
Unless the phrasing implies otherwise. Eg
PlayerChangedWorldEvent
I don't think anybody answered you. There is a server setting called previews-chat=false in the server.properties. However this feature is in 1.19**.1**, not 1.19
Kinda. PlayerBreakBlockEvent actuall yfires after the action, but before the server processes it.
cc @vivid cave because I didn't ping in the reply out of habit
i mean yeah
its fired when the client actually breaks it
Yes all events act from the servers view ofc. The client just predicts the outcome for some actions like block breaking or movements.
So its still fired before something actually happens.
In the BlockBreakEvent specifically, it's actually called after iirc and the result of the event is updated on the client after the fact
I'll double check that, but yeah, generally it's before the action occurs
That would be super weird. Why would you break the block and then go out of your way to fix it?
Mojang
because of all the various edge cases and conditions that occur when breaking a block
I think it prevents the breaking server side and then sends the client an update based on the outcome
Does anyone have a resource for world generation. Im ready to dip my toes in the ocean. Google no help
thoughts on using vim/vsc instead of intellij/eclipse?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch#168-176
It's creative mode that updates the client pre-emptively before calling the event. Survival mode is as expected
I knew it was handled differently than most
but yeah, it's called mostly after
Depends on how much of a masochist you are or if you are over 50.
@eternal night the inventory is empty
I just like how vsc is so minimal, but love the features of intellij
did you resend contents to remote
you did not
hey so i have a question.
I have 2 different classes.
In each class, i have a command called /ns
in each of them, i create like a different thing happenning for each args.
Ex : in class 1 i say what happens for /ns test
ans in class 2 what happens for /ns create.
How do i import BOTH of them in my main class (in the onEnable thing).
Will having that command in 2 classes create a problem?
you don't
why are you splitting them?
For high level languages i would not want to forgo the features of a good IDE
oh
you use one registered command handler per command, then farm out args as you want
so i can juste register that command?
You understood what he was asking? Because i dont.
?jd-s
onCommand(... ) {
if (args.length > 0) {
switch (args[0].toLowercase()) {
case "test":
ok so if this is my first class
package template.uhc.uhctemplate.roles;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class RoleN1 extends JavaPlugin{
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
if(command.getName().equalsIgnoreCase("test")){
player.sendMessage("test passed");
}
return false;
}
}
do i implement it like this in my main :
package template.uhc.uhctemplate;
import org.bukkit.command.CommandExecutor;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import template.uhc.uhctemplate.roles.RoleN1;
public final class UhcTemplate extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
this.getCommand("test").setExecutor(new RoleN1());
}
}
?
I thought your command was /ns
You cant have two JavaPlugin classes
None of this should compile. You IDE should yell at you.
i am just testing rn
none of that code will work, but you are only registering a command called test. nothign like what you asked
i am just testing rn
so how would i create the RoleN1 class
like what would i put after public class RoleN1
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
what's dabbin kids 🖖 anyone have a cool 😎 guide that is up-to-date on a sane 🤯 way of doing nms with mappings 🗺️ plus probably reflections 🪞 for multiple minecraft server versions that doesn't make me want to 😃 🔫 game end myself?
?ban
interface struggle
?expel
mbaxter has an example on github for a multimodule nms
is it similar to something like this? there's, uh, a lot in this page and I sort of wanted to make sure it's a sane way of doing things before getting invested
I've not seen that
I also really do not envy people trying to compile this garbage from source considering it seems like it would require running buildtools with mappings for every single version I deem fit to support
you can do that with a simple script though
yeah I can 😎
guess maybe I'll play nice and give people the script in the source
alright well
off I go on an adventure
yes
ok so :
if i have 2 classes
first one :
package template.uhc.uhctemplate.roles;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
public class RoleN1 implements CommandExecutor, Listener {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
if(command.getName().equalsIgnoreCase("test")){
if(args[1].equalsIgnoreCase("test1")){
player.sendMessage("test1");
}
}
return false;
}
}
second one
package template.uhc.uhctemplate.roles;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
public class RoleN2 implements CommandExecutor, Listener {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
if(command.getName().equalsIgnoreCase("test")){
if(args[1].equalsIgnoreCase("test")){
player.sendMessage("test");
}
}
return false;
}
}
what do i put in my onEnable
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
so this ?
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
this.getCommand("test").setExecutor(new RoleN1());
this.getCommand("test").setExecutor(new RoleN2());
}
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
And no: One executor per command
like that
you have ONE class registered to handle /ns
then use teh code I showed you to pass off arguments to any class you want
do i put that in the class where the command is registered or in the one where i want to put the args
/ns is the command. Everything afterwards are the command arguments. A String[]
So you register one executor for /ns and then handle all sub commands by working with the String array.
that goes in the class you registered as the CommandExecutor
you could make a basic constructor to switch it
like if true put false and otherwise
idk if ! would work
like put the opposite ?
what's the line containing ! ?
i mean you could try it out
no
getBoolean gets a value
ok so
i'd say yes
and you need a playerConfigMap.set to change a value, you can't change one through a get
Is it possible to make a yml file variable both a parent path, and a variable holder ?
like slot: 1 player:someone
Thats invalid
the value cant be both a config section and an integer
then should I make slot1, slot2... then get the last character of slot, and toInteger() it ?
or something like that
you put your scheduler in the BlockBreakEvent
ok lemme read and understand all of this
ah thanks for the info, so we can't have any chat preview in 1.19.0 ?
but my client (1.19) does have this setting
Just so you are aware, changing the skin on a player and respawning them also breaks their Op setting if they are. You have to deop and reop them.
F3+F4 breaks after a skin change
ah 🙂
okey ! i think i get it ! thx so much for the help today
animated skin won't be on mc for a while i guess 😄
I did try a few tings, like sending an update packet for their profile, but that kills the client as it only accepts it during login
oh good try
make the scoreboard on a seperate class/function, not the BlockBreakEvent one. During the BlockBreakEvent, change the value you need changed, and call them from the config afterward in the scoreboard function
also i noticed that if we do that for other players only, (refreshing the player thanks to .hidePlayer(player) and .showPlayer(player)), it will slightly move their player orientation, so it's fine if we do it only once, but if we do it every 100ms for animation yeah its not gonna make it
I guess i can put them in their last orientation but i feel like doing that too is overkill
yeah, nightmare
What would still be very possible to do though is animate only the head
With a player head worn as helmet its just about updating the player's equipment tbh
I have already done that in a previous project (animated rainbow armor project with customizable color stops & durations) and it worked successfully
whats wrong?
So the program would split in two parts, uploading the frames to mineskin (so each frame are signed) and updating the helmet every 100ms
i remember this was working
did 1.8 support action bar?
I do not think so
is there any like event on bungee that does "ah a new player is connecting but not connected yet"
yes
Very much yes
?jd-bungee
?jd-b
?jd-b
oh right i forgot about javadocs
eff you words
?jd-bcc
?jd-bcc
of course not
idk ig this might work just fine
use tenery operators
so
ServerInfo info = ProxyServer.getInstance().getServerInfo(c == 0 ? "lobby1" : "lobby2");
no its a tip
Sometimes if the expression is small it might add readability
yes true
or u can do
ServerInfo info = ProxyServer.getInstance().getServerInfo("lobby" + c+1);
Another way lol
Sounds like a true programmer
You may want to use teh actual player count if you are distributing players https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/ProxyServer.html#getOnlineCount()
yeeee
If you dont have any problems, just make some 
hmmm
delete the whole building championship plugin code that took me like 100 hours or so to make
anyomee use google cloud
-100 /s
🥲
Can anyone send me tutorial to learn java fast ?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
fast af
U have video?
Breh
im looking thro geekforgeeks for the whole day now, nothing better to do :(
There is a 12h video. Just watch one hour per day and try to play with everything that was being worked on.
You'll be through in 2 weeks if you are really dedicated.
Doesnt get much faster
Imagine he made video “you will learn all java in 1 video “ - showing us how to do print 😂
And look at something referentially
one day they be like printing hello world and the other day they make a video on how to make a self driving car from scratch
How
Truth be told, you cant learn Java in 1 day
i learned java with PogoStick29Dev
Huh?
Thats impossible, anyone who says or claims that lies
Lole
Yes i found that
If that was so easy people wouldnt tell you the secret of how to learn X thing in Y minutes
I will check it out tmr
