#help-development
1 messages · Page 814 of 1
I'm put of btd6 monkey momwy 😭
can you make a gui slot with an item not display anything on hover
or there has to be something, eg. empty space
f
core shader
ok nvm xD
That hover info is client sided
yeah
Resource packs can be applied with plugin though idk the big deal
Woooo
Well, you always want to set the first 9 and the last 9
And then you only want to set slots where slot % 9 = 0 or slot % 9 = 8
Is it possible to show a map to a player without the map being in their inventory?
No
While loop for less iterations 💪
eh?
Is there not some sort of packet to show a map to a player?
no
InventoryMoveItemEvent doesn't seem to fire when I transfer items between inventories
pretty sure thats not for players moving items
I am once again asking if any epic pro knows how to intercept/change a block's breaking sound (when hit, not when broken)
javadocs are saying thats for entities
so I tried it
if its for Players it will generally say Players
It's for hoppers and hopper minecarts
Entity refers to everything else
Moving items is just click/drag events
ooh
thanks
Hello, I am using hikari to handle connections to mysql db, I am running 4 servers and all of them connect to the db and work really well with it but once I try to launch 5th server, it starts throwing such error https://i.postimg.cc/pdGkQLh2/2023-12-01-174332.png
HikariPool-2 - Starting... [16:39:10] [Server thread/ERROR]: HikariPool-2 - Exception during pool initialization. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections" at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_392]...
Literally tells you the issue
Indeed
I am just wondering if I extend the amount of connections in the mysql config is it gonna solve the issue or I need to do something else?
I do not really understand what is supposed to be max amount of connections in this case
You are probably not returning connections to the pool after use
not closing connections
You need to close connections when you are done with them
yes
no
many factors affect what permissions a Player has, such as world, area, even time of day
if they are offline they are not in any world
thats kind of fucked up XD
if you directly query the permission plugin you can get the perms for the player in a specific world
or query Vault
hmm
How can I create a LivingEntity from a class?
Yeah that's what I am trying to do, I have a function that will create and spawn my mobs based of a class of values. I can pass the entity I want. I don't just want LivingEntities, so I am using the Entity class and any sub classes of that.
I just need what the entity is, so I can create it. so if a creeper is passed I'll spawn a creeper with the values, at the location provided.
World#spawn
that'll work thank you.
so if I use Vault then I can retrieve all player permissions?
yes
yeah i forgot now works
it doesnt work, what do you mean by that
it builds but i dont see net.milkbowl package
Does it still have the stupid old ass bukkit api dependency?
its a service provider
Look on the github page and it shows an example of how to implement it
I did what it says here https://github.com/MilkBowl/VaultAPI
scroll down to implementing Vault
you only need the permissions part
not chat or eco
Yeah I'd do all of that already if It would find vault
no milkbowl
nvm forgot to click
with which metods i can avoid using Block get.relative method?
Why?
im using blockpopulator
and guys said that i dont need to use Chunk methods
only use LimitedRegion methods
and another guy said, that i also shouldnt use Block methods
but i need to check is it air near the block
i im trying about hour to find smthing
but cant
i find how to getMaterial of block
avoid using Block methods
ohh im stupid
So with net.milkbowl.vault.permission how can I retrieve players list of permissions
I dont see a function for it
you can do getType with your coords on the RegionAccessor yea
you want to do something like a getRelative with a block face?
yeah
don;t
blockface has coordinate offset getters on it iirc, you can use that to shift your coords
use LimitedRegion and you can check with getType using the x/y/z
i write this class - https://pastebin.com/iL4Mj2gC
Don’t think it has that
just make SURE it's isInRegion
isInRegion()?
if you are messing with x,y,z you could move outside your region
so if block is in region i can use Block.getRelative?
no
getType
i also need to check if it in region
check if IsAir
then how can I check if offline player has a permission homes.limit.<number>, number can be anything from 1 to 28. should I just create a for loop and do "homes.limit.<i>"? XD and in each loop check if they have it
yes
Sure
am i misisng something? what is wrong with this sql syntax MySQL server version for the right syntax to use near 'WHERE id = '1138378079409033246'' at line 1
Also, since the player is offline, there is no other function that does the same as this one (picture) and I'm wondering if it will still return true if player has a permission I'm looking for but it's not explicitly set to a world but is allowed everywhere.
ahhh
i had the same problem
the way i used
is imported luckperms api
and
checked it with that
Show whol
If it's allowed in all worlds then it returns true
Yeah but I don't want to use it I mean I want to make it support different permissions plugin
Don't implement a specific permission plugin API
Native bukkit perms or vault
Vault if you want Offline
welp then i cant help u
well u got a better solution
id just implement all popular permissons plugins
and wildcards
So whats your idea on my problem? xD
how would you solve it
getting offline players permissons
I already told him how to get offline permissions
i'll play around with this and see if it works as I want and if not im coming back to this chat
how do you do that? there's no function that returns a list of offline players permissions
but then I also need to get the number
general question
does vault have a getInt?
why dont u use a database for this?
so my idea was to go from 1 to 28 which is basically the max number, with a for loop and in each loop check playerHas and the permission would be homes.limit.<i>
I mean that would work but it would look really dumb
a for loop doesnt look dumb
what do you need to specific number for?
i still say u just use a database xd
So I have a homes GUI that displays player homes, and on top middle there's this item that shows you how many homes you've already created and the max homes you can create. and so when I'm making an inventory in the code, I add a lore to this item, which says something like "You have {homes}/{homesMax}" or if you type /homes <player> it's a bit different, it'll show "{player} has {homes}/{homesMax}".
dont use permissons for stuff like this?????
It makes sense vosss
then as they are offline and you can;t use effective permisions you' would first check if they have a wildcard (so some value) then loop to find it
mking 28 individual permissons makes sense to u
Yeah
it's a dynamic permission, homes.limit.<number> - sets the max homes a player can create
So now my question is #help-development message
Oo I see great
or null
Null works
why is region.blockState().setType(ORE_MATERIAL); might not work?
i have 0 errors
and code after this stroke working
because a BlockState needs to be updated
not sure if thats safe in a populator though
try it
i iwll try
thank u
never worked with blockstate
not working
region.blockState().setType(ORE_MATERIAL);
region.blockState().update();
nope, each time you call blockState you get a new state
yep
ty
hmm odd, the hit sound appears to be different when set to the block's own hit sound
the code i used for the sounds is ```java
SoundGroup soundGroup = customBlock.getMaterial().createBlockData().getSoundGroup();
Sound hitSound = soundGroup.getHitSound();
block.getWorld().playSound(block.getLocation(), hitSound, soundGroup.getVolume(), soundGroup.getPitch());```
BlockState regionBlockState = blockState();
regionBlockState.setType(material);
regionBlockState.update();```
not working
no clue then
OfflinePlayer dude
yeah I already got an answer that's what I basically did and it works
Honestly the way you handle that seems like an anti pattern. Users may try and set homes.limit.34 even tho it does not exist and isn't clear. Also you restrict yourself to 28 homes which users or yourself may want to change in the future. I'd opt out of using permissions and use a different technique if I was you.
That's not my consern, config.yml explains everything very well 🙂
if you've got a better solution by using permissions, please post it here and I'll take a look thanks
guys, can i show my current project in gui (wpf + c#) here?
Do as you wish, only warning you since this code seems very inefficient to me
do you have a better idea?
with permissions
looks fine
There's multiple other solutions. One would be to store the maximum number of homes in a separate file. Other with permissions would be to initially when a player joins iterate through all players permissions and match the highest number by parsing the number out of the permission string (may want to use regex for that). This would allow you to use unlimited numbers of homes
I don't want to use unlimited numbers of homes, 28 is the maximum
Storing homes in a separate file would be the dumbest idea I have ever heard, permissions are there to be checked, I'm using Vault for it
Then it's fine as is
It is a one-paged GUI with a list of homes
I store homes (location, name) in a per-player config
well it's a better idea resulting in O(1) than to iterate over all possible permission combinations resulting in O(n).
Storing a maximum amount of homes can differ per player also, I dont see a point in handling all of that when I can just read the players permissions
Also if you start the iteration with 28 and subtract you can break the forloop early without having to iterate over each possible combination even tho the result won't change
Resulting in a more efficient loop
I think it's the same thing, player can have 1 home as a maximum as well
Imagine a player has 20 max homes, now you iterate 28 times even tho 20 is the maximum
You get what I mean
That I agree, I can make a function that returns when it finds a permission
or if it doesn't, it exists the for loop and returns 28 instead
but I don't think there's going to be much difference
at least noticable to human
No it's not but it's just simple things that make your code more efficient, just trying to help
I appreciate your help thanks
similiar to this (ofc refactor it to your needs):
int maxHomes = 28;
for (; maxHomes >= 0; --maxHomes)
if(/* has Permission */) break;
if (maxHomes == 0) maxHomes = 28; // default
I've been playing too much lethal company
I read this as "hoxxes"
guys, maybe who coding on wpf (c#):
how i can make custom checkbox?
?whereami
Hey i can not find the mistake.
Error:```java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.zyrox.Main.getCommand(String)" is null
```OnEnable:
getCommand("homecrate").setExecutor(new CreateCommand());
CreateCommand Class:
public class CreateCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
Player player = (Player) commandSender;
if(player.hasPermission("Homes.create")){
Block block = player.getTargetBlock(null,5);
Location location = block.getLocation();
player.sendMessage(block.getType() + " " + location.getY());
}else player.sendMessage(Main.prefix + " Du hast keine Rechte hierfür!");
return false;
}
could you pls help me with that?
foud it had a typo
i have concluded World#locateNearestStructure() is terrible
yes it locates a structure, but it completely ignores the radius parameter
does anyone have a different method to check if a structure is present within a given radius
if u interested in i only needed to update(true)
Are you using the correct radius?
Note that that radius is in chunks, not blocks
yes im using chunks
i gave 8 chunks in this case and it still found an ancient city 450 blocks away
i also specified to not include unexplored structures and this it seems to be ignoring also
seems that two of the method's parameters are at least conditionally ignored
i did it again (2 chunks) and it found a jungle temple well over 1000 blocks away
how can I translate exceptions with a database
I read online, and the article said "IOException" is too low level
is that even true
why
wtf kinda article is that xD
lol
so
if I have something like this
are these acceptable exceptions
I might remove throws NoSuchElementException and just include them in docs
that doesn't even do anything iirc, since NSE is an unchecked exception
ya that's why I suggested that for myself
You have to think of it more this way - do you want to force callers to handle a checked exception? If so, mark it as throws
I would also remove it from get() because it seems a little unnecessary
ez database library lets go this might be the first project that has actually gone to plan
Looks like QueryDSL
oh true
But still a cool project from what ive seen
oops accidentally pushed this
thx

also it caches shit locally so its not just query abstraction ig
Do you cache using caffeine?
A caching library
Abstract everything. Start with Atomos. The smallest possible component.
ight got it let me just abstract java.lang.String
@lost matrix pls give me a better name for this method
ig doubleBacked is redundant with MappedList
but still sounds weird
looks similar to ORM Light
im reinventing the wheel for like the 6 millionth time it probably looks like 7 billion other libraries
No idea about the name but i would probably create a concrete impl for your DataCache
that is a lot of words
you mean instead of an anonymous clas just have a normal impl class
i assume
right
.
I believe hotbar is 0-8
The future is now old man
doesnt really matter bc i cant see this being very fast
so when I teleport the player this pops up
and chunks are loaded since it's like 10 blocks away, I don't really understand why it comes to this
I'm using player.teleport()
Is it possible to use base64 in object[]?
ehhh
like three view creations and then your normal iter
you can tehnically base64 anything
but having array of object already seems odd
yeah but also the fact its iterating a map, idk how the cache is implemented internally but i think for lookup they would use some kind of hashmap-like thing
I'm making an application to open csv files that are in base64!
yea I guess
up to impl detail I presume
not that iterator is gonna be the wildest thing out there anyway if you are searching for performance
very true
but id say ArrayList.iterator() is probably comparable to for (int i = 0; i < l; i++) ... if you removed all the other shit in the iterator
which i might do
rn
custom iterator
save yourself the hastle and just fastutil ?
isn#t that exposed in the API anyway ?
eeeh might be paper
this isnt for spigot specifically but i could make a fastutil cache impl
I mean, their ArrayList iterators are literally just index counting up
which I guess is what you were after
famous last words
no idea
ima use a concurrent linked queue tho bc it needs to be thread safe and locking the whole object is probably not the best idea
iterator is probbaly slow ash tho but whatever
Won't work for the last element
oh true i need to start at -1 and do ++i
but i removed that code already
no but if the size is 3 and i = 2 that will return true
ig that works if you leave the other code
like postfix ++
yh
wait until you find out Cache is actually a view of the ConcurrentMap that Cache#asMap gives you :^)
🪄 implementation detail 🪄
i love relying on implementation details !!!!!!!!!!!!!!!!
Thank god you don't design APIs 
verify when?

how does one say "i like being white" without it sounding racist
no
i like having a white name
Change the color 
hmm
"i like being white more than the darker colors"
Sounds the same
yeah i think im fucked either way
be purple and unverified in stead
who do i bribe
md
Say a lighter tone is what I prefer
Does anyone knows if there is a way to use native Minecraft LootTable system? I have a few dozens of loot_tables from resourcepack and I want to use them to generate loot on Spigot server. Afaik I cannot access those internal methods of net.minecraft to parse my JSON and then execute the loot table to create loot?
Or can I?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Bukkit.html#getLootTable(org.bukkit.NamespacedKey)
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/loot/LootTable.html#populateLoot(java.util.Random,org.bukkit.loot.LootContext)
declaration: package: org.bukkit, class: Bukkit
declaration: package: org.bukkit.loot, interface: LootTable
Thats not what I am lookin for. Thats only for native loot tables or loot tables written in code. I am aiming to use existing JSON loot tables from resourcepack I have.
I was making them few years back and those loot tables are huge. I do not want to rewrite all of them in different format 😄
That works fine with json loot tables
Just load them with a datapack first
ohhhh... I totally forgot about datapacks on server 😄
right so does anyone know why this occurs solved
here's a better vid ig
odd, none of the sounds i tried from https://pokechu22.github.io/Burger/1.20.2.html#blocks:shroomlight seem to be the right one?
burger
By holding down the destroy button while the player is within range of the target block and while selecting the block, the player's hand begins swinging, making a repetitive "thump" sound as the player hits the block, and cracks appear on it while being broken.
does anyone know the actual delay between sound plays
or does the client wait until the sound has finished playing
3 ticks p sure
nuh uh
lets go
ok i just realized the fucking counter in the lore is broken bc editing lore sucks but ignore that
is it even beneficial to abstract data classes
like if I had an Animal class with fields like name, age, breed
if you would later have multiple animals which share those fields, sure
At times myea
Altho I’d never go for that design
Yea that shits hella lit
u fr?
IAnimal 
AnimalImpl
what is the best way to check if a block would be in a player if placed there
i was thinking uhh
blockBoundingBox.overlaps(playerBoundingBox)```
but nuh uh
i mean yes
well apparently not because thats returning false where it should be true
oh wait
i think im using the wrong block rofl
yes
yeah idk it seems like it aint working lol
i have uh
Block[76, 79, 17]
Player[76, 80, 17]```
and when using java BoundingBox blockBoundingBox = currentBlock.getBoundingBox(); BoundingBox playerBoundingBox = event.getPlayer().getBoundingBox(); if(blockBoundingBox.overlaps(playerBoundingBox)) { return; }
its returning false
what is currentBlock
the block with the position i just sent
or you mean the material or smth
because the material is air
whats the bounding box of the block
must be offsetted 0 0 0 1 1 1
cause then ofc it will return false
those do indeed not overlap
amazing
i mean quite obvious huh
i mean a block of air should have a block bounding box imo but thats just me
well how else should i check if a player is occupying the space then if there's no bounding box for air
?xy
Asking about your attempted solution rather than your actual problem
i mean this answer will always be yes
im manually setting a block at a point in the world where id rather if there isnt a player
a player always has a bounding box since a player is always occupying space
okay so simply when you set the block get its bounding box and check if it is overlapping with a nearby entity
but you just told me air has no bounding box
im not gonna set the block if there's a player there 😭
bc then the player gets pushed down and has a funni animation
im not placing it randomly
BoundingBox.of(Block)
Makes a full block sized bounding box
tldr im trying to prevent this
thanks lol
and if the block is air does it still work or shoot itself
thankz
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
yeah, just realised what i did before i sent the code 🙄
yh
how can i add to some block which will generate in world custom texture?
you'll need to use resource pack
i will try to use rp + display entity
Depending on your needs, you might also abuse "unused" block states (note blocks, tripwires, etc.) instead of an entity
More performant for the client
i need to create textures for custom ore
i know about block states but want to try display first
just what I needed to make working on this resource pack math more interesting, a migraine
Does anyone have any ideas on how to make the location search more customizable using this algorithm so that, for example, the range does not include coordinates from 500 to -500 (the center is 0)
https://paste.md-5.net/anagafikew.cpp
adapt to this #minimum and maximum coordinates (not less than 0!)
xMin: 500
xMax: 2000
zMin: 500
zMax: 2000
so you basically want to search in a square ring and not the full square?
what are you searching?
location
yes square
but anything specific with location
because searching each block in such a large area is a lot
although a circle is possible
x,z random coordinate
yes rtp
optimize it more accurately
make a more uniform randomizer
I took the code from here but I don’t know how to make it more customizable - https://github.com/DailyStruggle/RTP/wiki/Why
So you want a square with a circle removed from it?
what?
I don't understand what you mean by optimizing
if this is displayed on a plane, then I want to make a donut with a customizable hole inside
or a square donut
i would just pick a random coord within a circle(or square) 2x the radius as your ring width, subtract 500 from the x and z so it centers the circle, and if the x is positive add 500 and if negative subtract 500. same with z
im not a math guy but im pretty sure that would select a rough circular area without the center 500 radius
The problem with this algorithm is that the radius of the “donut” cannot be adjusted; it has a certain constant
Just generate a random radius within your range
Then take a random point from that circle
what
?
actually no my solution wont create a donut it'll create 4 segments
You just need a random radius from your range, then you generate a random number from 0-1 and calculate a point on the circle with that random radius
why a random radius
how would this make a donut shape
getting a random point on a circle isnt the issue
yes thats what he wants
Yeah so he needs a random radius from within that range
oh i see what you mean
Which would give you 1 of the infinite circles in that donut
my bad yeah that would work
if I have the PlayerItemConsumeEvent, how would I know if the player has eaten food and how would I know what his new and old hunger and saturation levels are? Is there some other event that extends it and contains that data?
hm i will try
looks like the event has the Hand that was used
should be able to check what item was used from there
is the event fired right before the finishing the food or right after?
this is a thing
there's also FoodLevelChangeEvent which you could listen to
right before finishing the food
If the ItemStack is modified the server will use the effects of the new item and not remove the original one from the player's inventory.
i just check their food level at and 1 tick after the event
allows me to make custom foods out of consumable items that dont give food points like potions or milk
does anyone know what the LongSet in ChunkAccess#getAllReferences() means?
in the context of structures it returns a Map<Structure, LongSet> but what does the longset mean
might just be a set of longs?
i mean they're just numbers lol
kinda hard to just look at some numbers and derive some arbitrary meaning
hi everyone, how to sort the tablist using teams in 1.8.8?
trying to create an armour stand using World.createEntity
this.display = (ArmorStand) world.createEntity(location, EntityType.ARMOR_STAND.getEntityClass());
this.display.setInvisible(true);
this.display.setInvulnerable(true);
this.display.setAI(false);
this.display.setArms(false);
this.display.getEquipment().setHelmet(displayItem);
this.display.setRotation(0, 0);
this.display.setHeadPose(new EulerAngle(0, 0, 0));
world.addEntity(this.display);
but I get
java.lang.NoSuchMethodError: 'org.bukkit.entity.Entity org.bukkit.World.createEntity(org.bukkit.Location, java.lang.Class)' when trying to run this code
That method does not exist in a jar
oh :/
Check your deps
I thought it was a part of spigot's API
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Like your jar in server folder
oh right... I think I'm using paper 🤦♂️
I forgot
why the heck did they remove it...
createEntity has yet to be pulled into paper
it is a rather terribly new API
not that whatever you are using it for requires it either
just use spawn with the consumer overload
what if I want my plugin to support spigot as well?
spigot has those methods too
the main reason I was trying to use createEntity is because otherwise it is visible for a few seconds before becoming invisible...
yea use the spawn overload
can't find world.spawn in the docs...
declaration: package: org.bukkit, interface: RegionAccessor
idk how I missed that :/
world.spawn(location, ArmorStand.class, a -> {
// This is run before the entity is added to the world
});
Thank you!
Is it possible to allow trailing comma in Gson? I couldn't find a surefire yes/no answer and the setLenient() in GsonBuilder is ambigious
is it possible to change the max hunger bar amount?
so that the max saturation is for example 22 instead of 20
nothing happens
it won't send me to lobby
am i messing something?
nvm , found the fix
1.20.2 is 1_20_R3 right?
unless you track and manage saturation yourself no you cant
alr ty
Client side can only show 20. But you can use NMS to change hunger mechanic.
Or use spigot api
blocking the main thread on disable is probably a good idea right
Yeah
you would need to manage it yourself still, right
there's no setfoodlevelscale or setsaturationscale or what have you
you can only set the food and saturation values, and food is a bit inconvenient because its in integers and not floats
so you'd need to track those levels yourself if you want to do it custom, and use the food and saturation as value indicators
can vault permission calls be ran asynchronously
because when i run it with a scheduler i dont get the expected result
Depends on the implem from the permissions plugin
if I use LuckPerms?
so here's the thing. I'm checking if offline player has a permission and apparently it loads some time
I would just use luckperms api if ur relying on it
So luckperms gave me an error saying this
Then it wants u to do em async 👌🏻
I did but then I also need to update the lore with the value
so I just move the entire for loop in a scheduler?
Run it async then do a sync task to set the lore and stuff
Btw
So a separate scheduler for lore
A seperate scheduler for setting the item back etc.
sooo I guess just runTask?
Sure
Spexx…
i don't know my way around with schedulers
?paste ur method
So
Move the async call to the top
Under inside the async call
Spawn a new task
And pass all the crap from the method in
Well’ish
Nvm don’t do that
But move the runTask thing inside the async call
Remember, you need to get the permission async. Then spawn a new task
does anyone happen to know what the LongSet in ChunkAccess#getAllReferences() represents? i figured it was probably locations, but converting those longs to locations produces wildly inaccurate locations
The new task will then need to create the item and set it back into the inventory
Ok, I'll try it
in this context im trying to find structure references in a chunk which produces a Map<Structure, LongSet> but im not sure how to work with that longset
No I still don't get it
I'm bad with schedulers
Is it a lot of code changing? Can you change it? XD
Not atm am on phone
Remember the async won’t run right as you ask it to so the variable you get from there won’t be gotten before after x period
When it’s gotten you should then create ur inventory
Ohh I see
So you switch to an async context to get it and then spawn a new task to switch to a sync context to edit the inventory etc. based on what was received
I guess I have to use CompletableFuture
because then I can do thenRun() after the async has completed
Suure
why am i getting java.lang.IncompatibleClassChangeError for jetty in spigot even if the version is the same?
?stack
How am I supposed to return the inventory from the function
just at the end? out of completablefeature scope
Ideally you wouldn’t return inventory
Return a completable future or smth else
No, but if it works it works
Hey here
can anyone recommend a sound similar to a cannon shot?
and besides the TNT explosion? The gun just fires first, and then the shell makes the sound of a TNT explosion
sec, lemme find a mc jar so I can go through all sounds
public static void addRecipeToServer(){
ShapelessRecipe shapelessRecipe = new ShapelessRecipe(NamespacedKey.minecraft(
"new_netherite_ingot"), new ItemStack(Material.NETHERITE_INGOT));
shapelessRecipe.addIngredient(4, Material.STRING);
Cekc.instance().getServer().addRecipe(shapelessRecipe);
}
this is not working, no errors in console
ig something like a long anvil hit sound
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
Are the snapshot Obfuscation maps available anywhere, specifically for the latest version 1.20.3 release candidate 1?
It used to be that each snapshot would get a page on https://minecraft.fandom.com/wiki/Minecraft_Wiki
but it seems ever since 1.20.3 they only publish release versions now
Fandom wiki is dead
You're supposed to use the actual official wiki
was not aware of that
the version manifest provides them (https://piston-meta.mojang.com/mc/game/version_manifest_v2.json -> fetch the manifest for the specific version -> the url to them is somewhere under a server_mappings/client_mappings property in there)
This is the only official wiki now please disregard the Fandom one it'll continue to become more out dated and wrong
Apparently. Thanks
is there any net.minecraft.server mojang-remapped wiki for 1.20.1?
Compare different mappings with this website: https://mappings.cephx.dev
Every single version yes
?nms
nope bro
i want to know like what exactly what is this class doing
like spigotAPI javadocs
or somethings about that
no such thing
some mappings have javadoc comments, but definitely not anything that'll be a game-changer
When working with nms you're mostly on your own
Why would Mojang be nice and give us javadocs
so i got a bunch of structures and their bounding boxes now, and i want to figure out which structure is the closest to a location in terms of bounding box. would it be a fine approach to expand those bounding boxes to touch the comparison location to figure out the distance, or is there a better approach?
doing so would require me looping through all the bounding boxes in a structure which might be overkill
hi , i need help with redis iam trying to achive is :
the Map selector should , show all arenas of solo in that gui
but , if 2 servers have the same arena name , it should add 1 itemstack and say :
amount of servers [number of the same arenas with the same name].
i got this but , it does not work
if anyone know how , please mention me , iam gonna go study now .. :p
any of yall have experience with spawning modified entities with nms
Ask away
hey what is the undeprecated way to set armourstand armour / holding
well thats kinda it im trying to spawn a custom entity using nms but i nor get an error neither does it work
like at atll
?paste
what's not working
What could cause ItemDisplay to work differently in different dimensions?
also i havent really found a way to spawn an entity and also get it as an object in nms which i also need
Your code probably
i have two classes for my display entities
but i built code that only relates to place itemdisplay
how does dynmap hanlde so many blocks?
its asynchronous and it uses caching, also the map is divided into tiles and only the tiles that need an update are rendered
wouldn't that require huge amounts of storage though?
well yeah
wait this doesnt even spawn the entity at a certain loc does it?
depends on your definition of huge amounts, but no it doesn't require a whole lot
checking each xy coord and storing the top block if there are air blocks below that it also stores those below that air block (for the 3d stuff)(with a minimum y level to prevent cave), this for every new chunk that gets loaded, any blockupdates like placing breaking etc, will store them aswell.
would the concept be something like this? or am i missing something huge that could speed up/ make it more memory efficient
it only needs to remember 16x16 blocks per chunk
if you're working only in 2d yes
like how i mentioned this?
any blockupdates like placing breaking etc, will store them aswell.
armor stand does not extend entity??????
It does
maybe a cast fixes the problem?
It should
could you be passing NMS entities to bukkit methods?
yh i am
does that not work?
no
there is usually methods to transform them
You might be able to convert to a bukkit entity
yep like getBukkitEntity()
are there no attributes in craft entites
this alll is making me cry soon
why are there so many types of entities
attribute are probably living entity
oh wait attributes are for items
player attributes are different in nms probably
well how
i havent used nms attribute stuff so no idea
any way i can get a normal entity from a craft entity
cast it
wdym by Normal Entity?
depends normal?
bukkit entity ig
do you mean NMS or Bukkit?
nothing no casting needed
if Bukkit you just cast
just use the CraftEntity
i have a bukkit entity that i got from nms
there really is no reason too though
no the re is
yep no reason but it was his question
i cant use atributes on bukkit entites
there is no conversion Process from CraftBukkit -> Bukkit Bukkit implies CraftBukkit in most cases, exceptions being ItemStack and Location
cast to a Bukkit interface just reduces the methods available to you in the object
entitys dont have attributes in bukkit
Entity is not attributable
only items
yes, if it IS a LE
yh i just spawned it
im gonna become shizo
for some reason my entity isnt null
but
it also isnt there
how does that work
How can I control a ridden entity with wasd?
Any good tutorials out there I’m missing?
Or can someone just steer me in the right direction
basically
client sends a vehicle steer packet
you listen to it and apply your own physics
was something like
float ahead = readFloat(0)
float side = readFloat(1)
ahead 1 = front
ahead -1 = back
side 1 = left
side -1 = right
might be inverted
mess around and find out
?paste
why cant i give a zombie a potion effect
Cannot resolve method 'addPotioanEffect' in 'Zombie'
public HashMap<BedWarsTeam, List<BWPlayer>> createTeam(int playersPerTeam) {
// Assicurati che ci siano abbastanza giocatori per formare almeno un team
if (players.size() < playersPerTeam) {
System.out.println("Non ci sono abbastanza giocatori per formare un team.");
return null; // o gestisci in modo diverso la situazione di errore
}
// Mescola la lista dei giocatori per distribuirli casualmente nei team
Collections.shuffle(players);
// Calcola il numero totale di team
int totalTeams = players.size() / playersPerTeam;
// Crea e popola la mappa dei team
HashMap<BedWarsTeam, List<BWPlayer>> teamsMap = new HashMap<>();
for (int i = 0; i < totalTeams; i++) {
BedWarsTeam team = BedWarsTeam.values()[i % BedWarsTeam.values().length];
List<BWPlayer> teamPlayers = players.subList(i * playersPerTeam, (i + 1) * playersPerTeam);
teamsMap.put(team, new ArrayList<>(teamPlayers));
}
return teamsMap;
}
it is correct?
You could rework it so the math isn't as complicated
Also you should aim to return Map instead of HashMap in case you decide to switch the impl later
I still haven't understood the difference between HashMap and Map, and List and set
One's the interface / contract and the other is an implementation of that
Why is it better to use one instead of the other? Is HasMap no longer optimized?
It allows you to switch the impl without redoing the whole codebase
is it possible to get the death cause aswell or no?
rip
delete them 🙂
setVisibleByDefault
is there a spigot guide/page on TextComponents? (such as run command on chat click text, hover, etc) I don't 100% trust chatgpt
add the invis mobs to a team and hide them
yeah that may only be name tags
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Does anyone know if there are reasons why a item wouldn't be able to be enchanted in the enchantment table? Is there a exact thing a material needs to be enchantable? Same with the anvil.
what better method for find random coordinates - https://paste.md-5.net/dajerahaka.cpp
man got no lapis larzuli
thanks
get 3 random ints in a certain radius?
actually i haven't had issues with the enchantment table, im trying to use enchantment books with items in an anvil and its not working.
I would like to implement a plugin that would prevent the use of the /repair command from repairing it with an anvil, as well as using repair. but Idk how to do it, tell me some events or libraries
repair isnt a default command is it
just dont give the people the permisson lol
2
why 2
becuse y not need find
but i want y
y need for find solid block
btw is it possible to make it so only a portion of the message is hoverable/clickable? Not the entire message
yes but i dont know how
you would send the portion you don't want clickable as a normal message that isn't a component
or maybe you could do it with two components one clickable the other not
use teh component builder
I checked and 1 method is surprisingly faster than 2 if my calculations are correct
- 7800ms 2) 278900
i was just use random...
just intercepting the command
hmmmmm???
Wrong import
I just need a plugin that prohibits repairing a certain item, I want to know how to make it, I have no ideas
i didnt import anything yet, let me do it
get the item the player is holding
make a list with allowed item
if the item is not in the list dont repair it
player.spigot.sendMessage()
no
this?
yeah
ok what about now?
ok I used the builder I'm still confused on what im doing wrong
everything must be a component
you cant have ChatColor.color + string it must be a component
Just use mini message or something to create it ?
ah so it has to be (tpComp+fixComp+intComp)
GIven the amount of deprecation there, you are using paper-api right 
no clue
i think
ok I removed the strings
can I not have multiple components in one message?
you can't join them via the + operator
rip
you gotta join them with in a parent component
and how may I do that?
dunno 😅
Maybe something on the component builder again ?
sorry I only know Minedown
sorry, did you just link a fucking emoji

I just beat the system
ComponentBuilder.joiner
save all emotes as gifs
does anybody have some idea on how I may make players(builders) define complex sections of blocks in the world?
thanks
"this house consists of the square of blocks between xyz + the square of blocks between xyz + the square of blocks between ...."
Yo it works thanks
Does this work for all mobs, or just mobs with built in steering like horses and pigs?
all mobs
config/new.yml:
join-reward:
item: IRON_ORE
amount: "1"
display-name: "Join Reward"
lore:
- "Line 1"
- "Line 2"```
```java
private YamlConfiguration config;
@Override
public void onEnable() {
// ...
getServer().getPluginManager().registerEvents(this, this);
config = YamlConfiguration.loadConfiguration(new File("config/new.yml"));
// ...
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public void giveReward(Player player) {
ItemStack reward = new ItemStack(Material.getMaterial(config.getString("join-reward.item")), config.getInt("join-reward.amount"));
ItemMeta meta = reward.getItemMeta();
meta.setDisplayName(config.getString("join-reward.display-name"));
meta.setLore(config.getStringList("join-reward.lore"));
reward.setItemMeta(meta);
player.getInventory().addItem(reward);
// ...
}
@EventHandler
public void onJoin(PlayerJoinEvent e){
giveReward(e.getPlayer());
}
}
Error: Material cannot be null
Why new.yml is doesn't load?
what should i do for create it
i created new.yml file in resources
Cause that file wasn't ever written to disk. If you include that file in your plugin, use #saveResource() to write it to disk.
Well, file is created but still the same error: Material cannot be null
Hey everyone, I'm currently trying to set the Velocity of an armor stand but it's not moving for whatever reason, does anyone have an idea why?
no way its darthmango
armorStand.setVelocity(velocity);
player.setVelocity(velocity);
On the player it's working but not on the armostand
?
What do you mean?
You're the whereami person
Back to the question, I have no idea why
How are you spawning the armorstand
Idk - maybe you need to set the AI? But that'd be a mojang moment
Nonono I just have the same name and the same profile pic but that doesn't make me that person
ArmorStand armorStand = Location.getWorld().spawn(player.getLocation().clone().add(direction), ArmorStand.class);
Anything else?
Some changes on the armorStand
Which are?
armorStand.setVisible(false);
armorStand.setGravity(false);
armorStand.setMarker(true);
armorStand.setArms(false);
armorStand.setBasePlate(false);
armorStand.setSmall(true);
Geavity?
Yeah I didn't want it to fall down
Does it work with gravity
Maybe we should send him there
Hey, we already mentioned that
hey i was late actually
Do we really need to bully that person to death?
but it should still move if you set a velocity on an armorstand without gravity or am I wrong?
Did you try?
It's alright, not everyone can says he's a meme on a 10k Member Server XD
The only change I could expect could cause issues is the marker thing as they might not tick, but I am not 100% sure
heyy
I thought the same but it didn't work with and without
PlayerLoginEvent
getHostname() -> does client send this data or the server gets it?
Basically can be edited by client?
Or the server gets it so it can be trusted?
Yes
Yes client or yes server?
Server
Check your file path then. Typically you'd use JavaPlugin#getDataFolder() and then pass in the name of the file.
File file = new File(plugin.getDataFolder(), "data.yml"); (Assuming this file is in the parent directory and not a subdirectory)
Yoo it's the paper guy
Nice
what was PacketPlayInKeepAlive replaced with?
Compare different mappings with this website: https://mappings.cephx.dev
I still have no idea
how to search in this stuff
I am not sure whether this is the right way to make custom damage amount:
@EventHandler
public void entityDamageEvent(EntityDamageByEntityEvent e) {
if(e.getDamager().getType() == EntityType.FIREBALL) {
e.setDamage(random.nextBoolean() ? 2 : (random.nextBoolean() ? 3 : 1));
}
System.out.println(e.getDamager().getType() + " aSDASDOASHDKJAHSDKUZsgdfKJGHYsbdfgJIYBDVKHJHYSDBZGUKFBsku");
}
it is
Sure
Click the version you are developing for and type in the name of the packet you are using. It'll work with either spigot names or moj-mapped names.
What fo you want the chances to be
ok thanks and chances are correctly set up
Searching for packets across versions is not something that I'm aware exists on that site, but one approach I use is to select the version that the packet name does exist on and it will bring me to the mojangmapped name.
What version does that packet exist in?
[21:15:26] [Server thread/INFO]: Is Directory: false```
I call a function in the main class that is supposed to read the files from a folder, but when logging the results it tells me it isn't
Yea, @grim hound, spigot is moving towards the mojang mapped names.
why tf
did they change the package as well
If I use Player interact event can I implement logic to check if the interaction was equipment of armor? I'm trying to make a custom armor plugin...
Yes

