#help-development
1 messages · Page 1197 of 1
You can even see the normal vectors on the triangles
though I guess they'll just hide the player when it is completed
I mean you can send a camera packet and trap the player in a boat so that they still send them movement packets
and then move the camera marker
hmm
Tho I did see some fancy shader that allowed some roll
Yeah wasn't that from the JNNGLSSGGFNUgn guy
that's a name
I thought it was just a long ass acronym lol
nny?
you what
there once was this guy with a christmas hitler pp, reminded me of him lol
this guy
I’ll go for this approach I suppose,
My purpose for this is a server that I have with my friends and there isn’t any good custom food plugins so I decided to make my own so I’m adding a bunch of custom foods with item textures made by some artists
And possibly custom crops down the line
I liked NNY. he was funny
So many ban evasions. He was the guy who refused to die.
@shadow night are you seeing this
he was a cool dude, just some racist over-the-top comments
but other than that a cool dude
yep
Yo @torn shuttle where do you do the pathfinding stuff in elitemobs I want to copy you
It’s all proprietary right
Crazey
yeah it's in the super secret repo called EasyMinecraftGoals
which is definitely not hosted and maintained on github
and if you touch it you owe me 1 mil
I’ll hack the mainframe and steal it real quick
?
Plz update the auctionhouse plugin from 1.20.4 to 1.21.4
I’m guessing you would need to speak with the author of that plugin
hey
real shit!
@molten hearth @rough drift go update it NOW
Can you change how command input looks like with a resource pack?
how about you check
no
you could try shaders but I don't think the commands have a seperate depth from chat
What about: if the client starts typing /do some stuff
It'd look like /do different word?
what
not programatically and commands only
When typing a command
you could go through the pain of studying GLSL and minecraft's text renderer and then doing that for the entire game but yeah no
what the fuck is the xy tho
oh you use offline mode
Is it possible to reset every attribute of a player(maybe using a method/itterating)?
(i did try to do it but it didn't work, because i guess it couldn't get the default value?)
how can i make a way to go to different servers or worlds in one singular world? i wanna be able to do /server build to have a build server to make maps and arenas and stuff like that
bungeecord
multipaper is another way if you want to use a "singular" world
I need help, this code doesnt work and idk why
try {
UUID fakeUUID = UUID.randomUUID();
WrappedGameProfile fakeProfile = new WrappedGameProfile(fakeUUID, fakePlayerName);
PacketContainer packet = Minerium.getInstance().getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
packet.getPlayerInfoActions().write(0, EnumSet.of(com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction.ADD_PLAYER));
PlayerInfoData playerInfoData = new PlayerInfoData(fakeProfile, 1, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText("Fake Player"));
packet.getPlayerInfoDataLists().write(0, Collections.singletonList(playerInfoData));
Minerium.getInstance().getProtocolManager().sendServerPacket(receiver, packet);
Bukkit.getLogger().info("Fake player added to tablist: " + fakePlayerName);
} catch (Exception e) {
e.printStackTrace();
}
}```
This code uses protocollib 5.3.0 mc version 1.21.4
it's failing to write the player info action for whatever reason
Is Frost walker enchant part of leaf decay? Or some event that can be cancelled.
When I use it, the ice won’t go away.
EntityBlockFormEvent is triggered for frost walker turning water into ice
i kinda wonder if it's possible to use mixins in a PLUGIN
Ignite:
there are various mixin loaders for spigot nowadays, ignite is the most popular one
Do note that it needs to bootstrap the server
Figured maybe that too, I just can’t figure out which plugin I have that in lol. I wish there were a way to debug where the cancel is coming from
people don't usually use them because of that reason
since it has to load before everything else
oh you mean to say that some plugin is cancelling the event?
Yeah I mean just use a fork at that point
well, just print the handlers
eh, that's work
Yeah I agree that mixins are really nice for quick stuff
like for a fork you need to edit, rebuild patches, publish, pull, change your server jar
but like is it a plugin and mod at the same time or what
no
it is neither, but if one were to pick, it'd be a mod
a
tbh i want to make a vanilla mc server using plugins
but like
im more addicted to forge modding
xd
so that's why im asking if it's possible to create plugin like a mod but in vanilla mc
I mean, there's no reason you couldn't use forge/fabric instead of spigot for a server and just use their API instead
as long as you don't add anything to the client-side, it'd still be just as vanilla as spigot
plugins are just server-side mods for that matter
well, I should be more clear, "as long as everything you do adheres to the vanilla protocol" is a better way to word that
im a bit confused but i feel like that means i join vanilla minecraft client (minecraft launcher), into fabric server if my mod is SERVER only
i'd rather have plugin server instead of modded one :/
I don't get what you want honestly lol
i want to use mixins like in modded inside a plugin
(spigot plugin)
what for
server
that isn't very specific
what functionality is spigot's API missing that you require of a mixin
there is no reason to have a mixin if the API supports it, is what I am trying to get at
same goes for fabric and forge really
who is it
wich plugin you're using?
auction house
i was telling
wait
yes\
you should ask author
who is author
why
but it's at right side of plugin page
i was trying to find his media on his resources but i think he has none
only yt
yes i know is name now but how do i contact him
Please report all issues by starting a conversation. If you post in the discussion forum, it may get overlooked as we are getting more discussion now.
i wonder in pure Entity-Component system, how would you represent a minecraft block? is it an Entity, is it something else
i mean it does have collision
so it must have CollisionComponent so it must be Entity
im pretty sure if mojang implemented pure Entity-Component system it would destroy both the tickrate and the fps
at the same time how would you represent the World mesh
Just because you have an ECS does not mean everything needs to be in it
since it has specific attributes to it
why not
If you put them in your ECS I believe you'd be making the BDCS (brain dead component system)
Imagine the lag if every block is a tile entity kekw
☝️
i know
the main difference in mojang's entities and ECS entities, is that they have tick() method
meanwhile in pure ECS you would have Tickable Component
Is it really an Entity component system then because such entities would be inanimate thus not entities
what if that block is animated
like water
or has certain features like damaging player on touch
That'd be client sided rendering so it'd be silly to include it
Graphics can handle that
I mean in theory minecraft can use Flyweight design pattern where they would represent everything in world in compressed and optimized blob, but accessing that particular data it would expose it under proxy object which represents as an ECS entity
World.getEntity(): Entity
Entity.hasComponent(Living.class)
Entity.hasComponent(Static.class)
Then it's just a component system and not really an ECS because not everything is an entity thus not everything is ECS
You can't make everything an entity either things such as world generation and rendering are largely inanimate
They have no life in of themselves
World Generation and Rendering are Systems
Blocks, and living mobs can be Entities with certain components
World would be a blob container for entities
But blocks aren't mostly alive or animate
but they can be
I feel like you're stretching the meaning of entity
have you considered not making an ecs
If you're going to add components like this to everything it's nolonger anything to do with entities
Infact the components meanings are largely devoid of entities
ECS is hot rn ig
Petty sure Ike is making something too lol
is there a way to check if a player has their inventory open, like for this code i need to be able to stop players removing items from their offhand slot, which has id 40, however id 40 can also be a slot in a double chest
package io.github.mrnameless666.vanillaPlusEngine.listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
public class InventoryClickListener implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
event.setCancelled(true);
}
}
player.getOpenInventory().getTopInventory() == bottom
just check the type of the inventory
or something like that
they're trying to prevent clicking from the offhand slot itself so that wouldn't work
it depends how you use the first part
player.getOpenInventory().getBottomInventory() is always the player inv
ah nvm
i see what you mean
what is always executed first (no matter the event priority): EntityDamageByEntityEvent or EntityDamageEvent? I THINK it is EntityDamageByEntityEvent but I am not sure.
it doesn't have its own handlerlist, so it would be called at the same time
but in which order
maybe the execution is still custom
there is no order, they're called at the same time
in a single thread there is an order
there is a single event being called
ah hmm
and there being only one thread doesn't mean it can't be concurrent, all events are happening in a single (main) thread yet they're called simultaneously
but if it is a single thread how can they be called simultaneously, one is always called first
in this scenario, it is a single event instance so it doesn't matter
ok so you are telling me that if I put the EntityDamageByEntityEvent to the highest priority and EntityDamageEvent to the lowest, the EntityDamageEvent would always be called first because they share the handlers?
no, since the priority of the handlers are different
if there is no explicit priority definition, then they'd be called at about the same time (as long as they share the same Listener class)
yes if they have prio then the lowest is called, if they don't its random (or as you said concurrent?)
to make it clear, it is like having two handlers of the same event
hmm
these two:
@EventHandler
public void onDamage(EntityDamageEvent e) {
if (e instanceof EntityDamageByEntityEvent event) {
/* do stuff */
}
}
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
/* do stuff */
}
are the same
yes that is what I wanna know. So because they share the same handlers, the prio of EntityDamageByEntityEvent will affect the EntityDamageEvent and vice versa?
if you have a EntityDamageByEntityEvent handler (A) which has priority highest, and a EntityDamageEvent handler (B) with priority lowest, any changes in B will affect A, if that's what you are wondering
so they are chosen by random and tolerated as the same event or what
i think priority is also shared
what is your issue exactly, because I feel like we're going in circles
he wants to see which one is called first
yeah but I assume that's for a reason and not just pure curiosity
if order mathers priority for entitydamage event should be the same i think
well my issue is that I need to know the exact priority because I have a main trigger for player death events (custom made before a player would actually die), now I want to set the priority of some other EntityDamageByEntityEvent (it is not the same as the EntityDamageEvent below here!!!!) to always be executed first, thus if they share the priority I can simply set the EntityDamageByEntityEvent to lowest, otherwise I need to create EntityDamageEvent from it and cast it into EntityDamageByEntityEvent if possible
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void mainDeathEvent(EntityDamageEvent e) {
System.out.println("main death event! ");
if(e.getEntity().getType() != EntityType.PLAYER) return;
Player diedPlayer = (Player) e.getEntity();
if (diedPlayer.getHealth() - e.getFinalDamage() > 0) return;
GamePlayer GPDead = GameHandler.getGamePlayer(diedPlayer.getUniqueId());
if(GPDead == null) return;
e.setCancelled(true);
Game game = GPDead.getGame();
if(e instanceof EntityDamageByEntityEvent) {
game.handlePlayerDeath(Game.DeathReason.KILLED_BY_DAMAGER, GPDead, diedPlayer, ((EntityDamageByEntityEvent) e).getDamager());
} else {
game.handlePlayerDeath(Game.DeathReason.DIED_PEACEFULLY, GPDead, diedPlayer, null);
}
}
i looked here and i think handlerlist share priority for the same event with handlerlist
did you try setting a different priority for your entity damage events?
in short, you just want another handler for EntityDamageByEntityEvent and make sure its changes persist for mainDeathEvent
yes
exactly
@EventHandler(priority = EventPriority.LOWEST)
public void entityCustomDmg(EntityDamageByEntityEvent e) {```
you don't have to set it to lowest for that to work as mainDeathEvent handler has HIGHEST priority, meaning anything lower than that will work
but yes lowest would essentially work for your purpose
it must be at least LOW tho because of other other EntityDamageByEntityEvents
well, I am not aware of any other handlers you might have so that's up to you
if you want it to affect those other handlers as well then yes
idk ik what you meant so no problem
but rn I will try to change the priority now and test if that actually changes the priority because I want to be sure
yeah they do share the priority I flipped them for a bit
so in short: till now I tought EntityDamageEvent is called and then subevents but it turns out they are all simply called without any priority cause they share handlers
Does anyone know how to create a custom entity for 1.21, I've tried looking for examples but they are all for older versions with stuff that has been renamed?
i love me an AuthorNagException
lol 😄
?mappings
Compare different mappings with this website: https://mappings.dev/
You can use this to look up old names ^^
do you know of any tutorials or guides or something?
for creating the basic structure of a custom entity (like what they all need)
Old guides still work fine
ok
The method of doing so hasn't changed
just the names of the calls but you can look that up using the link above
@lilac dagger @sly topaz thank you for help
no problem, i hope i was of help
i get this on a github action, but if i click on the maven.pkg.github.com link and authenticate, i can get the file normally. This is my workflow config and build.gradle.kts. I have another repo with the same workflow and it works fine. How can i fix this?
is it preferd to use IntelliJ data sources to host my DB?
intellij data source to host your db?
pretty sure those are just to connect to your db
Is there a way to edit the content of an already-sent message to a player's chat? Perhaps using the signing feature?
When people add entities like TextDisplays and HumanPlayer NPCs to their servers, where do they put the code that spawns them in? How do I maintain entities that are meant to be permanent across server restarts?
Should I check if each entity is there on server start and spawn it in if it isnt?
Feel like that would break the concept of liability
NPCs won't save so you're responsible for persisting them
You add them to some manager class that holds their refs, and you handle the destruction on disable
how
A good approach is to save your entities in the chunk nbt and spawn them in the chunk load event
what if the server crashes and onDisable isnt called, wouldnt that result in duplicates?
There’s a packet to delete a signed message iirc
ah
I’m currently working on a plugin for my smp and I’m planning to connect it to my website, if anyone would like to help with my project please ping me
There is. We don't expose API for it because we don't have API to get the signature of a message lol
so just get it
Does PlayerInteractEvent not fire the RIGHT_CLICK_AIR Action if the player doesn't have an item in their hand?
Correct
Gotcha, ty
Path pluginPath = InvisPractice.get().getDataFolder().toPath();
Why is this going outside the server directory
have u tried printing it out?
or maybe u use it from another base dir or sth? (where toAbsolutePath() might help)
yuh like go to is just toPath() toAbsolutePath() and a nice normalize() does the trick on incoming paths
[19:46:08 INFO]: C:\Users\skinn\Documents\Development\MC Servers\invis-practice\plugins\invis-practice
[19:46:08 INFO]: C:\kits
Path pluginPath = InvisPractice.get().getDataFolder().toPath().toAbsolutePath().normalize();
System.out.println(pluginPath);
this.kitStoragePath = pluginPath.resolve("/kits");
System.out.println(this.kitStoragePath);
I'm on 1.8 and Java 8
lol
Is there any way to get physical keycodes in java
case InputKey.ALPHANUMERIC_6 -> List.of(KeyEvent.VK_6, KeyEvent.VK_CIRCUMFLEX, KeyEvent.VK_DEAD_CIRCUMFLEX); // The '6', '^' key.
case InputKey.ALPHANUMERIC_7 -> List.of(KeyEvent.VK_7, KeyEvent.VK_AMPERSAND); // The '7', '&' key.
case InputKey.ALPHANUMERIC_8 -> List.of(KeyEvent.VK_8, KeyEvent.VK_ASTERISK); // // The '8', '*' key.
case InputKey.ALPHANUMERIC_9 -> List.of(KeyEvent.VK_9, KeyEvent.VK_LEFT_PARENTHESIS); // The '9', '(' key.
case InputKey.QUOTE -> List.of(KeyEvent.VK_QUOTE, KeyEvent.VK_QUOTEDBL); // The ''', '"' key.
case InputKey.COMMA -> List.of(KeyEvent.VK_COMMA, KeyEvent.VK_LESS); // The ',', '<' key.
case InputKey.MINUS -> List.of(KeyEvent.VK_MINUS, KeyEvent.VK_UNDERSCORE); // The '-', '_' key.
case InputKey.PERIOD -> List.of(KeyEvent.VK_PERIOD, KeyEvent.VK_GREATER); // The '.', '>' key.
case InputKey.SLASH -> List.of(KeyEvent.VK_SLASH); // The '/', '?' key.
case InputKey.SEMICOLON -> List.of(KeyEvent.VK_SEMICOLON, KeyEvent.VK_COLON)); // The ';', ':' key.
case InputKey.EQUALS -> List.of(KeyEvent.VK_EQUALS, KeyEvent.VK_PLUS)); // The '=', '+' key.
case InputKey.LEFT_BRACKET -> List.of(KeyEvent.VK_OPEN_BRACKET, KeyEvent.VK_BRACELEFT); // The '[', '{' key.
case InputKey.RIGHT_BRACKET -> List.of(KeyEvent.VK_CLOSE_BRACKET, KeyEvent.VK_BRACERIGHT); // The ']', '}' key.
case InputKey.BACKSLASH -> List.of(KeyEvent.VK_BACK_SLASH); // The '\', '|' key.
case InputKey.BACKTICK -> List.of(KeyEvent.VK_BACK_QUOTE, KeyEvent.VK_DEAD_TILDE); // The '`', '~' key.
doing something like this looks stupid
AWK's key event only return virtual key codes
i want physical ones
what exactly does entity#setPersistent do?
Hello, if I'm making a biome provider, is it possible to get what biome would normally be in a location using the vanilla provider? Basically I want to change biomes above a certain Y-value but leave biomes below that Y value the same as the vanilla generator.
No no spigot naming is weird
its not?
setPersistent controls whether the entity gets saved when the chunk unloads
ah fuck me
Despawning is setRemoveWhenFarAway iirc
too much nms for me my bad
is there a guide for adding custom entities to your server? I need to have permanent TextDisplays and NPCs that always exist, but i need to create them in my plugin's code. How do I code their creation so that there is always exactly 1 of each entity for every server restart?
if I created the on server start and deleted them on disable, then server crashes would cause duplicates to be made
Set them to not be persistent
setPersistent(false)
Then spawn them on chunk load or keep the chunk loaded
how do i make a furnace recipe with a itemstack result?
Doesn’t the recipe constructor take an itemstack
apparently not from what i can tell, its material or a recipechoice which im guessing ill need to use recipechoice but how do i pass a itemstack to that
sorry I'm dumb i meant input
There’s RecipeChoice.ExactChoice
But idk if it works on furnace recipes
The docs say shaped recipes only but you can try it
question, is the only way to detect when a player starts mining or cancels mining through packets? or is there a way to do it withought?
oh cool, is blockdamage event only on start mining, or is it constant while mining?
Start
ok, thanks
yep this works
public static final ItemStack RAW_CHICKEN_NUGGET_ITEM = new ItemBuilder(Material.CHICKEN, 9)
.setDisplayName("Raw Chicken Nugget")
.setCustomModelData(8)
.build();
public static final Recipe RAW_CHICKEN_NUGGET_RECIPE = new RecipeBuilder("raw_chicken_nugget", RAW_CHICKEN_NUGGET_ITEM)
.shape(" R ", " ", " ")
.setIngredient('R', Material.CHICKEN)
.build();
so i found an added side effect of a dupe glitch
because i based the nugget off the raw chicken and it uses the raw chicken in the recipe
am i going to have to use a prepareitemcraftevent to check that the crafting recipe for the nugget isn't a nugget? or is there a different way?
I think he means if you put the nugget back in you get 9 back out?
since the ingredient is a chicken
and you get a chicken back out
so you get 9 chick out, put 1 of those back in for 9 more?
I'm just guessing
am I dumb because I am not getting it
if they're using exact choice, you couldn't just get a chicken out of a chicken, since they don't have the same metadata
sorry this is for the cooked chicken furnace recipe
well, use exact choice for the crafting recipe too
wait, I actually don't even understand what that recipe is supposed to do
ah, you get 9 chicken nuggets out of a chicken
put raw chicken in and get 9 raw chicken nuggets out
so yeah, if you use exact choice for the recipe it should be fine
is there a reason it is a shaped recipe even
doesnt need to be its just the builder that i had already made
when a new version of minecraft is released
how can i update my plugins to that version?
so exact choice for the recipe can you put material into exact choice?
If you don't use nms update the dependency in ur build system and fix and deprecation, if you use nms run bt and deal with it
if you are using a build system, you'd just up the version in your build configuration file, be it a pom.xml or a build.gradle.kts
if you aren't, then I'd recommend start using one
Who uses buildsystems anymore just write asm
usually if it is a simple enough plugin, you don't have to do anything and it'll just work
.setIngredient('R', new RecipeChoice.ExactChoice(new ItemStack(Material.CHICKEN)))
so like this?
should work, yeah
👍
worked great
public static void registerAllRecipes() {
Bukkit.getServer().addRecipe(CHICKEN_SANDWICH_RECIPE);
Bukkit.getServer().addRecipe(CHEESE_RECIPE);
Bukkit.getServer().addRecipe(CHERRY_PIE_RECIPE);
//Bukkit.getServer().addRecipe(HONEY_GLAZED_SALMON_WITH_RICE_RECIPE);
Bukkit.getServer().addRecipe(CHOCOLATE_BAR_RECIPE);
//Bukkit.getServer().addRecipe(SUSHI_RECIPE);
Bukkit.getServer().addRecipe(BOBO_TEA_RECIPE);
Bukkit.getServer().addRecipe(RAW_CHICKEN_NUGGET_RECIPE);
Bukkit.getServer().addRecipe(COOKED_CHICKEN_NUGGET_RECIPE);
}
i think this might get a bit full
Guys
Can I do blocking methods in PAPI requests
(Without killing the main thread)
Pretty sure all papi requests are on main thread
No use caching
I need to make an initial request tho right
you could just make your RecipeBuilder#build method add the recipe really
I thought you shouldn’t register the recipe inside the build method
how do i access block tags (https://imgur.com/LYVYnhK) with the api? i see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Tag.html but im not really sure how to access the tag from the block
Tag.FOO.isTagged(block.getType()) afaik
yep
I don't remember there being a way to get all tags a material is tagged with
may be wrong though
there is no way to get which tags apply to a material, no
it must be stored somewhere though, given F3 shows them
NMS I suppose
is there any way i can detect custom keybinds? any key pressed
i think not but maybe nms... pls help
Don't think so
No
And from what boq said, this will never be a thing - no server side keybinds.
who is this boq person
A Mojang developer
sad...
i see servers detect middle clicking, is there a specific way?
in what context
holding an item and middle clicking it
it is probably impossible to detect middle clicking just air, I doubt any packet would be sent from client
basically what i'm trying to do is creating a map that gives you a stick
you can left and right click to select the corners of the map region and then confirm it somehow with a middle click
but i think it's impossible
Just use offhand for that
Hmm, am I reading correctly that I can't create an Inventory or InventoryView title with components?
not without NMS, no
Bummer.
then again, the most you can do with components in the inventory title is translatable components I guess, so it isn't too bad
??
Have you never seen custom inventories with font magic ?
I was hoping to change the font, which is supported natively
ah, I always forget you can do that nowadays
I guess Lore can't do it either
using components in spigot requires NMS for the most part, as the API for it isn't there yet
there is a PR open to solve that, however it's been in the works for a while now
https://paste.md-5.net/ivohabocon.coffeescript
I'm trying to get the player skin on a player head. The head loads correctly if the player is online but it's default when the player goes offline.
Excuse me, but wtf is "ass-pressure"?
Don't look up the block state for fire
nor the dolphins grace effect
LOL
A lot of the newer effects have funny descriptions
Didn't someone go through those and remove them some time ago ?
does anyone know any resources for for "simulating players" via puppets or something in order to perform certain types of plugin testing that would usually require real players to be logged on? anything like this exist?
via puppets?
and no that is not a thing
you can use offline mode if your setup doesn't depend on uuids
You can use Mineflayer and offline mode to help automate testing
Anyone?
How are you getting that player profile
The name is not guaranteed to be known if the player is offline
you'd need to use the
API to fetch skin data if it's not cached
Iirc you can make a profile with the uuid only
You can
Actually doesn’t OfflinePlayer have a getProfile?
Yeah OffinePlayer#getPlayerProfile
Yeah but that won't have the skin data
Calling update on it will
It will if you complete it
isn't the completion and stuff paper only
No
oh it's just their player profile stuff then
Spigot has #update
Ah wait I see they're not awaiting the player profile update?
It's a completable future
Oh yeah
.join() time
They should be using thenRun or whenComplete
Yeah or join it in the async task I guess
I unironically do this in command handlers
though those are async
blocking the scheduler thread for no reason is uh less than ideal
(not the bukkit ones)
I need a plugin that allows me to customize the logout screens, like for wrong version or something else, does it exist? I need it
Why cant I import Plugin into my BungeeCord project? I have it added in my pom.xml but I guess net.md_5.bungee.api.plugin.Plugin isn't in the API? But...
That's what I wasn't sure of
I believe it might be on https://hub.spigotmc.org/nexus/content/repositories/snapshots/
https://www.spigotmc.org/wiki/spigot-gradle/ has all the repos on there lol
it shoudl also be on sonatype https://www.spigotmc.org/wiki/create-your-first-bungeecord-plugin-proxy-spigotmc/
I figured it out
what else would they be identified by
Nickname
That can change
it's literally world/data/<uuid>.dat
Only in offline mode does the name have any effect on player data
but that's because the server generates a uuid based on the name
i want to make a command which sets (sets to config) material of a Block Player is holding, but when a Player holds for example a potato its different because potatoes as Block are called POTATOES, how can i do this
What version are you using?
1.18.2
eh
Modern versions have ItemType vs BlockType
You might need to manually map yours
Filter Material by isBlock
Does someone know a good cross version particle library? That supports creation of this:
Many static and animated shapes.
Display images as particles.
Text to particles.
Complex shapes like tesseracts and double pendulums.
x-series has cross-version particles
cross-version particles is the name of the lib?
There's also ParticleLib but it's outdated
what ?
its different material
if u understand
If you want a list of blocks grab the values of the material enum and filter them isBlock
Player is holding" potato" but i need "potatoes"
ah I see
i need to map it
Manual map it is then
Have you checked if Spigot handles it for you?
I recall having to do manual conversions for one of my open-source contributions
There’s BlockState#getPlacementMaterial iirc
does anyone know how to cap the armour prot level to prot 3 for my smp?
Don't post in every channel
ah yes chatgpt
fix, combat timers dont work properly, they dont refresh on each hit and its a total mess. Don't make your own "quality of life" updates just make it work
i love telling people to fix shit and just make it work
just gonna forward this rq
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
AI can't code well you're digging yourself a never ending hole

this sounds kinda crazy
but why not use an existing plugin like combatlogx
instead of failing to write code and failing to get ai to do it
no
use the plugin
no
use it on the server
is it for your server or are you trying to pubish a plugin
taps sign
anyway for both:
you dont know how to code it. you shouldnt be making it without being able to make it urself, even if you do make it work it will mostly not contain any good features that would entise a large amount of people to stop using already existing plugins that they know how to use and like it
so report it to them
its an actively updated plugin, so tell them the issues and it gets fixed for everyone
My code :
PacketContainer metadataPacket = protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
int entityId = npcUUID.hashCode();
metadataPacket.getIntegers().write(0, entityId);
// Création de WrappedDataWatcher
WrappedDataWatcher watcher = new WrappedDataWatcher();
WrappedDataWatcher.WrappedDataWatcherObject entityFlags =
new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class));
watcher.setObject(entityFlags, (byte) 0x00);
WrappedDataWatcher.WrappedDataWatcherObject customName =
new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true));
watcher.setObject(customName, Optional.of(WrappedChatComponent.fromText("§eMon NPC").getHandle()));
WrappedDataWatcher.WrappedDataWatcherObject customNameVisible =
new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class));
watcher.setObject(customNameVisible, true);
List<WrappedWatchableObject> watchableObjects = watcher.getWatchableObjects();
metadataPacket.getWatchableCollectionModifier().write(0, watchableObjects);
protocolManager.sendServerPacket(viewer, metadataPacket);
logInfo("Metadata packet successfully sent to " + viewer.getName() + " for NPC with ID " + entityId);
} catch (Exception e) {
logError("Error sending metadata packet: " + e.getMessage(), e);
}```
My error :
Error sending packet clientbound/minecraft:set_entity_data
Does anyone know how to solve the problem?
is Player#getInventory().removeItem(item) removing all items that 100% matches the one that is given(name, lore etc), or it only takes type and amount into a count?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/Inventory.html#removeItem(org.bukkit.inventory.ItemStack...) Looks like it tries to remove any matching
declaration: package: org.bukkit.inventory, interface: Inventory
Hi kat
hi rad
wanna vc
#.getInventory().removeItem(new ItemStack(Material.EXAMPLE_MATERIAL, amount_here));
You can define a specific amount
Should definitely be more to that error
Explain?
Sounds like whatever you're doing needs to be a valid class fully qualified name
idk what that means 😭
you really need to give us some context
ok i changed something to lowercase it worked nvm
I love the internet lol
uh
real
like nms/spigot
i have a bit of an issue with economy, i am using essentialsX using this math and timesing it by .01 and it doesnt come back with the right decimal number its like 0.009999997 instead of 0.01... i tried using big decimal in java as well with no avail
I just wrote a staffchat plugin using the BungeeCord API. I can toggle it on and type in staff chat, but whenever I toggle it off I get
'Chat had an invalid signature. Please try reconnecting.'
I have enforce secure chat off on both the proxy and the spigot. How can I fix this?
Oh boy, floating point and currency
You need to do your math with BigDecimal
Or store fractional values separately as an integer
Or a byte, whatever. Could technically fit it into 7 bits lol
I'll try that, thanks. I tried doing the math and then using big decimals to round it up, but that didn't work. I understand big decimals now, so I will give this a go; thanks. And if that fails ill use integers
Integers and doing everything as cents is another option
Do integer math but the least 2 significant digits are actually the decimal part
So your integer is 1050, but the 50 is the decimal part
that could work, i can store the cents in my plugin and put the dollars in essentialsx and just convert it back and fourth as needed
I mean tbf, BigDecimal is basically just this
At least internally
just divide in the output by 100 and call it a day, its a fake decimal
Anyone know?
I've updated a plugin from 1.21.0 to 1.21.4. The plugin adds custom biomes to the world. In this case, a debug biome "test:raw" is added. I made some change to the code, adjusting it for the latest version, and for the life of me I cannot figure out what I'm doing wrong here. The code in 1.21.0 worked perfectly, and it seemed .4 just changed the names of some methods. I suppose not.
The variable biome is built in a separate method I have confirmed works fine.
The code concerned: ```
public void implement() {
newKey = ResourceKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath("test", "raw"));
changeRegistryLock(false);
Registry.registerForHolder(getRegistry(Registries.BIOME), newKey.location(), biome);
getRegistry(Registries.BIOME).freeze();
}
private void changeRegistryLock(boolean isLocked) {
MappedRegistry<Biome> materials = getRegistry(Registries.BIOME);
try {
Class<?> registryMaterialsClass = Class.forName("net.minecraft.core.RegistryMaterials");
for (Field field : registryMaterialsClass.getDeclaredFields()) {
if (field.getType() == boolean.class) {
field.setAccessible(true);
field.setBoolean(materials, isLocked);
}
}
} catch (ClassNotFoundException | IllegalAccessException e) {
e.printStackTrace();
}
}
private <T> MappedRegistry<T> getRegistry(ResourceKey<Registry<T>> key) {
DedicatedServer server = ((CraftServer) Bukkit.getServer()).getServer();
return (MappedRegistry<T>) server.registryAccess().lookupOrThrow(Registries.BIOME);
}
implement() is the primary method.
Here is the error: ```
[15:20:50 ERROR]: Error occurred while enabling Surreal3 v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalStateException: Tags already present before freezing
at net.minecraft.core.MappedRegistry.freeze(MappedRegistry.java:312) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
at surreal_3.jar/cyrei.surreal3.debug.biome.BiomeMakerDebug.impliment(BiomeMakerDebug.java:86) ~[surreal_3.jar:?]
at surreal_3.jar/cyrei.surreal3.Surreal3.onEnable(Surreal3.java:43) ~[surreal_3.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202)
The error occurs on server startup. If anyone is able to help, it would be greatly appreciated!
do NPCs trigger PlayerInteractAtEntityEvent ?
Depends on how they're implemented
cool
U N S A F E memory in java
IntBuffer buffer = MemoryUtil.mallocInt(1)
Try unfreezing (unbounding) the TagSet
If I’m being completely honest here probably my main issue is I haven’t used registries in forever. How do I unfreeze a tag? I’m guessing I do this first?
The registries aren't designed to be modified this late in the load process hence the mess required to unfreeze and hoping it works
Swapping allTags for MappedRegistry.TagSet.unbound() would get rid of the error
Might cause loss in registry entries so uh you'll have to tinker with it
Awesome thanks
I packaged my plugin and when i attempt to run it on my server i get the following error. I opened the .jar file in 7zip and it is right there
[16:39:06] [Server thread/ERROR]: Could not load 'plugins\LammPluginMc-1.0-SNAPSHOT.jar'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:158) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122) ~[spigot-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R3.CraftServer.loadPlugins(CraftServer.java:468) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:235) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1032) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[spigot-1.21.4-R0.1-SNAPSHOT.jar:4409-Spigot-33ece3e-e28af08]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
someone can teach me
my plugin.yml looks like this
name: LammPluginMc
description: allow users to call /lamm and run lamm code
author: minneelyyyy
version: 1.0
api-version: 1.21
main: com.minneelyyyy.LammPluginMc
commands:
lamm:
description: run lamm code and return the result in chat
usage: /lamm <code>
and like i said, the jar file clearly has plugin.yml in the root
how can I import the net. for the minecraft imports for gradle
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
ah, i dont have a spigotmc account
Second part then
thanks
Could you show the jar in the plugins folder
i just rebuilt and copied it
Just in case
oh right, I remember that, last time I asked about how to make a server side item "backpack" custom texture, what was the most easy to do? if it was fabric one or do a plugin one , without making the user download when join or upload to a page , but send as a packet network. i was kinda loss
You can’t have a custom texture without a resource pack
Well, you could use a custom player head but that’s limited
i see, i mean you are right need a resource pack, but i was not sure doing a plugin or a mod fabric what was the one that can manage to send as a network packet without making the user download or updload to a page.
Just to confirm (I’m sure I sound stupid here) by tag set do you mean the list of tags?
Both spigot and fabric can host a resource pack locally
yes
well TagSet is the class
oh, nice
allTags is the list
First you need a web server to host the resourcepack
and then you can use setResourcepack with the resourcepack url
oh, so still needs to upload it to a page?
Just somewhere for the client to download from
If you want that could be the server itself
I was like setting sort of a localhost , and port of the same server
yeah, i dont know how to do that
if you want same ip and port as the server you can use Inject by @blazing ocean 
Personally I recommend using the Javalin example
Just make a route that responds with the resourcepack zip file
shameless self promo goes brr
were you reloading instead of restarting?
no i was stopping the server and replacing the jar, im sure i messed up somewhere stupid
at least it works now
guess that is what matters, it works lol
so I would need only these compileOnly("io.netty:netty-all:4.1.97.Final") compileOnly("org.slf4j:slf4j-api:1.7.30") compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")?
no not really
Not sure why the first two are there
I blame @blazing ocean 🔫
Check the main README for dependency information
Then the javalin example code
Yeah but not in that module
Anyone know?
okay, I sort of get it ... i not sure when mapping to the resource pack.zip it needs to be wrapped alongside with the plugin or outside on the server directory file.
haha
That's up to you
You can have it in the jar if you want
or if you want your users to be able to edit it you can put it in your plugin folder for example
oh, glad to ask
at least make it does not pop up that download resource window when join will be fine
Ok I’m really sorry to keep bothering you. I’m looking at the MappedRegistery class rn and I’m not seeing any child class called TagSet. I’m probably just blind lol
CraftPlayer craftPlayer = (CraftPlayer) onlinePlayer;
PacketPlayOutNamedSoundEffect packetPlayOutNamedSoundEffect = new PacketPlayOutNamedSoundEffect("ambient.cave.cave6", onlinePlayer.getLocation().getX(), onlinePlayer.getLocation().getY(), onlinePlayer.getLocation().getZ(), 1.0f,1.0f);
craftPlayer.getHandle().playerConnection.sendPacket(packetPlayOutNamedSoundEffect);```
did i do something wrong
im trying to play a specific cave sound for the player
Why not use the api
spigot 1.8.9
^
💀
I see
Also I don’t think the sound works like that
Pretty sure the variant is determined by the seed
It's an inner interface of MappedRegistry
version: 1.21.4, hash: c47a87cce7
There are two anon implementations in there as well
Because the classpath is missing netty and the API doesn't include slf4j for some reason, spigot at least
doesn't need to be kept in for paper
Because it's missing on the classpath
no
not with compileOnly
that configuration is not transitive afaik
compileOnlyApi
Ah
(java-library plugin)
Oh I see now. Thx. I’m just trying to figure out now this. My method getRegistry() returns a MappedRegistry instance, yet it doesn’t appear I can access TagSet
it's package private
olivo did you see I added velocity support
I was gonna do that tomorrow
along with probably bungee and forge
man this is gonna be a pain to maintain
You can skip regular Forge 
yeah I kinda just wanna get like a load of platforms working
modded ones are practically free because all I need is a mixin
what
Again, sorry, but how do I access it then?
Reflection
It's mostly copying from PE since their injectors are good
Ah fun
did that for velo
The the heck did Mojang change this….
For safety
I suppose
Locking down the registries after they've fully loaded is the correct way to handle that
Problem is Spigot plugins don't load early enough
Paper plugin loaders can though so if that's your target it's easier
True.
I should look into making it load earlier I suppose, which might help. I’ve been taking a break from plugin dev for like a year and maybe this wasn’t the first project to resume XD
what kind of implementation would it work for?
I'm talking human player NPCs with nms
If it's a properly registered entity it would probably work
?tas is the best way to check
Anyone Know?
How could I make a book like this? With the crafting grid to show how things are made?
A resourcepack with a custom font
You have characters for each of the different icons and then use offsets and negative space to get them in to position
is there any vid guides on texture packs or like website guides
I have one for Inventories, same concept
does anyone know how to set a PlayerEntity's position in CraftBukkit?
it seems like it used to have a #setLocation method but it doesnt anymore
.teleport
?jd-s
You can often reverse engineer it by looking how it ties into usage in craft bukkit classes and spigot api itself
Why do you need NMS to move a player
thanks
does anyone know what to replace these classes with for 1.21?
import net.minecraft.network.protocol.game.ClientboundAddPlayerPacket;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
?mappings
Compare different mappings with this website: https://mappings.dev/
I believe add player was merged with add entity
And the other one isn’t a mojmap name
Should be something like ClientboundPlayerInfoPacket
^^
PacketPlayOutSpawnEntity and ClientboundPlayerInfoUpdatePacket 👍
thanks
Does anyone happen to know how to make a placeholder display if a bungee server is Online, Offline, or Whitelisted? Whilst also being able to set each of these to different colors. IE- Online-Green, Offline-Red, Whitelisted-Orange.
Yeah u could easily make this
How would I do this? I am not really a coder, I was wondering if there is mainly a plugin, or a configuring way of doing this?
You're in the development channel, this is for developing plugins, #help-server is where you ask for configuration help, or utilizing existing plugins.
This channel would be a suitable place if you're asking how to use the Bungee API to make your own placeholders.
Ah, alright
Anyone know?
does have any sort of yt tutorial video?
for some reason, my dependency library (jar-jni) is not being included in my jar file and its crashing whenever i use my slash command with a java.lang.ClassNotFoundException: io.questdb.jar.jni.JarJniLoader
this is all i have for jar-jni, i dont know why its not part of the jar
and yea the jar archive does not seem to contain it
you need to use maven shade plugin
or add the library to plugin.yml libraries section
how do you get if the tool being used is the right tool for the block on BlockDamageEvent (EX: pickaxe on stone is correct tool, pickaxe on wood isn't)
Block.isPreferredTool
ty
so... i added a main class and figured out how to do that with maven properly, and it worked, i then decided to see what would happen if i copied that over to my server and the plugin worked without the UnsatisfiedLinkError... i am not quite sure what the difference is
i think java will just forever confuse me...
just somehow "statically linking" (in the archive) instead of relying on spigot to load the library up works
Spigot wont load the library unless you add it to plugin.yml too
i did that
either, add shade plugin and shade or add it to libraries
you dont need to do both
So I'm trying to use MappedRegistry.TagSet.unbound() to effectively "unfreeze" the registries to add custom biomes in 1.21.4 I attempted to use reflection, my code here: ```
try {
Field field = MappedRegistry.class.getDeclaredField("allTags");
field.setAccessible(true);
Object object = field.get(getRegistry(Registries.BIOME));
Class<?> tagset = Class.forName("net.minecraft.core.MappedRegistry$TagSet");
Method method = tagset.getDeclaredMethod("unbound");
method.setAccessible(true);
method.invoke(object);
} catch (NoSuchFieldException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) {
e.printStackTrace();
}```
unfortunately, that's my weakness and the registry is still "bound" Does anyone know what i did wrong? thanks (:
If anyone has further questions, i'd be happy to provide further info (just didn't want to bloat the channel)
u know what just kill me
Use a data pack?
I’ve been updating this plugin for several versions though, and I’d like it to continue coinciding with some other plugins I’ve developed
I’m porting it from 1.21.0 to 1.21.4
Alright, I need a second opinion. This works fine:
AreaEffectCloud cloud = (AreaEffectCloud) w.spawnEntity(location, EntityType.AREA_EFFECT_CLOUD);
cloud.setParticle(Particle.BLOCK_CRACK, Material.AIR.createBlockData());
But I want to set the particle before it spawns, to avoid the default size for a split second. I found an answer online that said to use a consumer.
However, this errors with class org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.material.MaterialData
AreaEffectCloud cloud = w.spawn(location, AreaEffectCloud.class, new Consumer<AreaEffectCloud>() {
@Override
public void accept(AreaEffectCloud cloud) {
cloud.setParticle(Particle.BLOCK_CRACK, Material.AIR.createBlockData());
}
});
Any ideas on what I could be doing wrong?
does plugin.yml have api-version set
use a lambda please
Wait, is it because I create the consumer with Consumer<AreaEffectCloud> when it should be Consumer<> because changing that fixed it
oooh, no it doesn't. solid catch.
Doubt it
please use lambdas instead of that
w.spawn(location, ..., (cloud) -> {
// do your things
});
my first goal was just getting it to do the thing based on the first example I saw. cleaning it up is stage 2.
appreciate the code snippet 🙂
Yep, setting api version fixed it. Damn. Thanks. 😅
This is what happens when I resurrect a 9 year old plugin of mine without doing the basics. <_<
who the hell coded the new adventure api to create "better" json formated chat msg with click and hover event ?
this is far away from beeing easy to understand .... nothing works for me currently -.-
i managed to create a Component with text but how do i send it to Players ?
Audiences.players().sendMessage(Component.text("Hello, players!"));
players() is not a function of Audiences and i can find any other information about this ...
this is all i got ...
BukkitAudiences
i doesnt know BukkitAudiences
.
i need to add a new dependency ? but why ? half of the shit is already given in the normal api .... i dont like this
yeah but they could provide it just for the spigot api too ... i dont like the idea of saying the old bungee chat api is deprecated but you need to add other stuff to make it work with the new system ...
what?
they could just add the bukkit adventure api to the spigot dependecy
wha
bungeecord chat isn't deprecated, just not complete yet™️
well, not completely supported
by who
spigot
it's only supported in like two places
the rest is still strings
component PR™ when
well, yeah that's what I mean by not complete
well the bungee chat impl itself is complete iirc
?whereami
are you using Paper
they are
they implement adventure, so you don't have to use it as an additional dependency like in spigot
I thought you were trying to use adventure in spigot
hmm paper was in pom but not used in any way
anyhow, you're better off asking in the paper discord on how to use adventure, but here's their documentation on it if anything: https://docs.papermc.io/paper/dev/component-api/introduction
thanks for your help btw ^^
I need some netty help, I'm trying to forward an HTTP request to my backend servers (am proxying http requests to my proxy), for some reason this returns an HTTP/0.9 response. I've tried printing the response, it says it's HTTP/1.1, but 99% of http clients will just refuse to accept it since it's 0.9 apparently. https://pastes.dev/nQjdZU4LMV
that documentation page is kind of annoying, it goes to explain the broad concepts which is fine, however I had hoped the examples would be more clear cut, like actually showing how you can send a message, be it with components or MM since that's the main way people use components anyway
Interesting, the first char in the response byte buf is 偋
shouldn't there be a status line?
missing encoding and keepalive(not sure if you need the connection to remain opened)
headers().set(HttpHeaderNames.ACCEPT_ENCODING, HttpHeaderValues.GZIP);
I only need to send that one request and then close it again
https://pastes.dev/g9ZafogwJM still getting this
I've just tried writing the status line manually like this
response.readerIndex(0)
response.writeCharSequence(httpResponse.protocolVersion().toString() + " " + httpResponse.status().toString() + "\n", StandardCharsets.US_ASCII)
response.resetReaderIndex()
but I still get the exact same error
curl localhost:25564/games/packs/global -v -o global.zip --http1.1
still, same error
you are doing something wrong then, what are you connecting to?
Minecraft server, it responds to HTTP normally if I curl it directly (using inject)
curl localhost:25565/packs/global -v -o global.zip --http1.1 is completely fine
Yeah, that's my backend server
Yes
so why are we trying to proxy requests now?
My backend servers are the one that serve resource packs, and those are not going to be externally accessible so I need to proxy them and redirect to the backend based on the request path
I could maybe move the pack hosting logic to the proxy
Could probably serialise the resource pack to a protobuf and send it to my proxy via websocket
tbh that's probably the better solution
Serializing a ~10mb resource pack object and sending that via WS feels a bit silly but yeah
Make a resourcepack microservice
I read that as microwave
of course
anyone aware of a good youtube video showing how to create custom NPC mini bosses
no, what even is an npc mini boss
an npc that can attack with custom abilities
Hi! I'm trying to add something to an interface in org.bukkit.block.data package, and I have a few questions.
- Should I cange it in Bukkit, or Spigot-API, or both?
- The interface I'm modifying is implemented in packages org.bukkit.craftbukkit.block.data and org.bukkit.craftbukkit.block.impl. I modified the proper class in org.bukkit.craftbukkit.block.data package, but the one in org.bukkit.craftbukkit.block.impl package has a comment that says: 'Automatically generated file, changes will be lost.'. How do I regenerate the contents of that file?
how do I add thing to autocomplete for my commands
if you're using command executors, implement TabCompleter
ok thx
you should use a TabExecutor then you can put the command and autocomplete in the same class if you want
You can do that with TabCompleter and CommandExecutor as well
just in Bukkit is fine
TabExecutor just combines them
as for the second question, who knows, doesn't seem to be documented anywhere
didn't even notice those were generated sources lol
I searched all over the project(s) and there doesn't seem to be anything about blockdata generation in buildtools or similar, so I am unsure of where it is actually being generated
Alright thanks, in worst case scenario I'll just modify the file manually
hello, do you guy have any plugin that i can use for unloading a world and loading a world for minigame? i was trying to use slime world manager but its too outdated
If you’re wanting to add something to the block data subtypes, just open a bug report instead. Might just be that md needs to regenerate them
Bukkit#createWorld and Bukkit#unloadWorld?
thank you! i will look into api docs for more infomation
what event listener get all the droped items?
what
a location is a vector
i mean like
have it move when interacted with and use a vector to modify that movement
do you mean velocity
yeah in that case just apply velocity
BlockBreakEvent
even the items droped by the player?
Yeah it works fine tho
If you’re talking about dropped by the player, then PlayerDropItemEvent
you can use ItemSpawnEvent for any items that just spawn
would be nice if that event provided a reason tbh
yeah but I want all the dropped items by entity players and blockj
then listen to both
^^^
how can I get block in the chunk of where a player is
like search for a specifi block
You would have to iterate over all the blocks in the chunk. I'm not sure what else you expected 
yeah but how do I do so?
depends what "Block" you want
A hopper
You can use player.getLocation().getChunk() to get the Chunk object they're in, then it's just a matter of iterating from chunk's getX() to getX() + 16, getZ() to getZ() + 16, and world minimum to world maximum
a Hopper has a TileEntioty so searching is quite simple
Chunk has getTileEntities(), so it might save you some iteration times :p
like that ?
if (block.getLocation().getChunk().isLoaded()) {
Arrays.stream(block.getLocation().getChunk().getTileEntities())
.filter(tile -> tile instanceof Hopper)
.forEach(tile -> {
Hopper hopper = (Hopper) tile;
});
}
Arrays.stream(chunk.getTileEntities()).filter(Chest.class::isInstance).map(Chest.class::cast).collect(Collectors.toList())```
do for hopper, will give you a List<Hopper> of Hoppers
thx
Guys do you have any idea about this:
PingPacket packet = new PingPacket(player.getPing());
if (player.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_9) {
player.unsafe().sendPacket(packet);
}
I tried to send a PingPacket to client with BungeeCord API
But sadly [Kolleen] disconnected with: EncoderException : java.lang.IllegalArgumentException: Cannot get ID for packet class net.md_5.bungee.protocol.packet.PingPacket in phase GAME with direction TO_CLIENT for version [767] @ io.netty.handler.codec.MessageToByteEncoder:-1
I installed vias on spigot
My client is 1.21.1 and BugneeCord is 1.21.1 too
Why are you sending that packet manually?
Because proxiedPlayer.getPing() is not on time
wdym not on time?
this ping updates once per several seconds
yeah that's normal
I m making /ping command
Just use getPing
But MCCIsland made a new type of /ping
They're also not using bungee
their /ping command seems sending ping packet manually
They are using modified Velocity i think?
yep
But you can send ping packet through SpigotAPI with packet events
WrapperPlayServerPing packet = new WrapperPlayServerPing(packetId);
PacketEvents.getAPI().getPlayerManager().sendPacket(player, packet);
We can't do this through BungeeCordAPI?
Okay
Well I found out that MCCIsland is sending ping packet through their modified Paper instead of Velocity
Because their /ping cooldown period updates on server switching
lol
Yeah having it on the proxy is less than ideal
I have a method from chatgpt which takes the x y and z vaslue from a location and turns it into a string but it only gives int values. for example if the y value is 361.7 it does 361, i dont know why pls help
return location.getWorld().getName() + "," +
location.getBlockX() + "," +
location.getBlockZ() + "," +
location.getBlockY();
}```
thank you very much
Im just using chatgpt for some parts. the main part of the plugin im doing myself
that's like one of the easiest parts 😭
im using it to save hashmapss in yml files
Bukkit serialization handles all that for you
whats that
uh thanks ill try to understsnd it
it is pretty simple, if you are using Bukkit's configuration API (that is YamlConfiguration or the getConfig/saveConfig in JavaPlugin), then anything that implements ConfigurationSerializable will be serializable into yaml for a given YamlConfiguration, and all you have to do is use the generic get/set methods and cast the inputs/outputs or getObject which does the casting automatically
most of bukkit objects implement ConfigurationSerializable so for common objects like locations, you don't have to worry about it
i need to save a armorstand
Maps and Lists are also automatically serialized I believe, into a configuration section and a yaml list respectively
i have a hashmap Location, Armorstand
Locations are serializable but entities not quite so, you'd have to just save the UUID of the entity instead
unless you want to spawn the entities out of the yaml configuration, in which case you'd have to create a format for your armor stand properties
i want to save it when restarting so i can still remove the entity after an restart
with entity.remove
if you are going to respawn the entity, why not just leave it in the world
that way you'd only have to save the locations for any specific logic you may have on them
ah, I get what you are trying to do now, yeah just saving the locations should do
i use the armorstand as a hologram
if you are in a newer version, I recommend using text displays, they're far better for that purpose
im still 1.20
idk but i prefer armorstand cuz i thionk ill downgrade my plugin to 1.16
what I'd personally do is have a UUID <-> Location map saved in a file, be it a configuration file or whatever
that way you can just do Bukkit.getEntity(someUuid) and possibly load the chunk if it isn't loaded yet with the location to find the entity
i didnt knew this works
could you probally show me how i can save and load a location into a hashmap
Any specific reason why you want to downgrade? Also it's probably best to already code in the specific version you want your final plugin to be if you haven't done much already
https://pastes.dev/roZChFYDTM most of it was done with chatgpt so you have to check whether it did some things properly but it should serve as an example for the most part
THANK YOU SO MUCH
Because I want that the plugins works on 1.16-1.21 servers
It's not worth supporting 1.16 @clear elm
There's no mojmaps
It has a weird jdk range limit
Jdk 11 or something like that
Is 1.17 worth it?
That's a question for #help-server