#help-development
1 messages Β· Page 1227 of 1
you're stuck with plain text
that's how you know you're having a good time
unless of course, π
π
For example trying to make wooden sword display diamond sword's localized name.
you'd need nms for that to set the translatable component
unless..
if only there was a components api
Well, using only bukkit API you're screwed
quick question, if you provide Vector(2, 0, 0) as the direction and 1 as the max distance, will the maximum collision be offset by Vector(2, 0, 0) or by Vector(1, 0, 0) ?
it will use teh max distance
is that max distance defined as something you'd get with Vector#length() or something that you would put in Vector#multiply
which one of my provided options is that
what?
.
neither
tf
the vector is simply a direction. It doesn;t matter that you did not normalize it
okay so in here it wouldn't matter if I pass a normalized or non-normalized version of the same vector right?
the direction vector simply defines the infinitely-spanning line
Another question, is it possible to "raycast" a bounding box? or I could call it... bounding box cast badum tss without casting from all 8 corners?
Anyone has any ideas about this?
I wanna make a game where you get random items every ... seconds. To do that I've made this system that technacly works but the server is lagging extremly and eventually crashes even when the code currently just sends an message in the console every .. seconds.
Why is that and how do I fix it?
LocalDateTime gameEnd = LocalDateTime.now().plusMinutes(gameTime);
LocalDateTime nextDrop = LocalDateTime.now().plusSeconds(interval);
server.broadcastMessage(ChatColor.GOLD + "Game is starting...");
teleportPlayers(gameWorld);
gameRunning = true;
while (LocalDateTime.now().isBefore(gameEnd)) {
/*
Other stuff will happen here later
*/
if (LocalDateTime.now().isAfter(nextDrop)) {
nextDrop = LocalDateTime.now().plusSeconds(interval);
System.out.println("Item Drop");
giveItems(); //doesn't do anything yet but will give the items later
}
}
I mean... is it being run on the main thread?
Why not use the bukkit schedulers for a task like this?
Because I want to enable/disable it with a command and I haven't found a way to do that with bukkit schedulers
I have come up with a very funny way of placing blocks
can I do the screen tilt a player gets when they are damaged but without actually damaging the player?
0.1 also works
0 won't work with the vanilla command but might work via API /shrug
what should be the longest amount of time my splittable task should take in a tick
I guess the server's budget is 50ms right
1.0e-63 nanos
50ms minus the current mspt
I think if I do that some servers will never finish generating this
plus maybe a safety margin of say 5ms
capped to a minimum batch size of n blocks
basically you don't want your batches to be too small or else most of your time will be spent on scheduling overhead rather than placing blocks
is there even a realistic way of making sure a task runs at the end of a tick
feels like if I try to get a read on the current tick that's going to go sideways quite easily
paper has a tick end event, but apart from that, it shouldn't really matter; the start of the next tick isn't much different from the end of the current tick timing wise
and scheduler tasks run at the start of the tick
k so the only way to do it with the current mspt is heuristically
you of course can't predict how long that next tick takes, but with tps catchup, going over budget isn't really a big issue
if you go over budget your logic will allot a smaller time usage on the next tick, and the server won't sleep as long waiting for the tick after that, so you end up in balance
have we gotten a way to check current mspt, I think the last time I checked you had to calculate it yourself
you'll get some ~30ms jitter at worst, which isn't really noticeable
paper has a tick start event too
it does
so you can get tick start, store it somewhere and subtract stuff
if you were using paper, you could listen to tick start and tick end, and then calculate the time between to know how long you can place blocks for without going over 50ms, exactly
if I was modding factorio I'm sure there's also many other things I could do
on spigot i'm not sure if you can even get mspt
you can't really calculate it from a scheduler task, like you can tps
would be nice to at least have a tps check in here
then I could just express this as a % of a tick instead of ms and run it based on current tps
that'd probably be close enough
the issue with this is that tps is basically always expected to be 20
i'd uh maybe have a rolling number clamped to 2-40 and increase it by 1 for every tick that took <50ms and reduce it by 1 for every tick that took >50ms
that'd keep you at the 20tps redline
or, hear me out
I just set it to 10ms, ship it and call it good enough
they'll never see it coming
seems fair enough
takes 4 seconds at 20ms but 20ms feels like it might be flying a bit too close to the sun
it's just 16 mil blocks
make it configurable and call it a day
yeah actually already have that in place anyway
but I'll do it as % of tick instead of ms
it'll be less confusing and in the future if I get around to improving it the configs will stick
now for my next trick
I make a very fancy, very long animation
to cover for the fact the animation is hiding the loading time
and by very long I mean like 6s long
use sendBlockChanges to send them as clientside blocks so it looks instant even though you're actually still placing them π€‘
oh I don't need to worry about that
the world isn't in view
it's creating a new world
what are you doing actually
oh I guess I haven't been showing
pasting a minigame arena or something?
making an extraction game in minecraft
neat
the map is procedurally generated i assume? or else you'd be copying regions as file operations before loading them as a world
i've actually been working on that too recently
although i'm not using modules but voxels and a sample structure for the weights
similar to texture synth, but in 3d, using minecraft blocks
all generated using the same system
the extraction game is just the first one we're going to make into something actually playable
very nice, i've seen a few tech demos done in basic game engines and unity and such, but i don't think i've seen wfc done in minecraft yet
yeah it's usually just tech demos
and I get why
it's uh
unwieldy
to say the least
it has its problems
very much so
a naΓ―ve impl is fairly simple but it will shit bricks in practice
honestly the map gen for the extraction game could've been done in about 10 minutes with basic code, wfc is complete overkill for what we currently ahve
but we did it for the suite of things that we can do with it
next is probably going to be adding modular underground dungeons for mc
wait till you hear about trials
mojang's own structure system is fairly competent these days but it definitely has its own set of problems as well
it would be very funny if you just joined a normal mc server, went to dig for diamonds and broke into a massive dungeon that seems virtually infinite and is full of mobs that don't exist in minecraft
custom structures have always put on a neat twist on the experience since you get to see new things as a player
yeah they're pretty popular
people have been asking me to add modules for a while
they'll soon have it
as for me i'm taking wfc in a bit different of a direction, more akin to texture synthesis than putting together existing modules
idea is to have a bunch of sample structures to seed the weights from and then run wfc on individual blocks
hm yeah I can see what you're going for
by itself it generates tactly put garbage, but with some extra rules i'm fairly sure i can get it to produce decent enough buildings and environments
the structures would have to be massive or they'd just look like trash
the main problem is that if you use too small tiles to base the weights on, like say 2x2 or 3x3, you end up with nonsensical garbage
but if you make the tiles too large, you end up duplicating the sample structures 1:1, because each tile becomes unique
my approach to deal with this is to curate the sample structure and add some metadata to it to inform wfc better
e.g. define walls to be walls; floors to be floors; roads to be roads, and so on
and prohibit certain neighbor pairs
yeah had to do much the same
make a module with a door
now you have a door that faces a door
lovely
ideally i suppose you would have an army of minimum wage workers manually defining all the weights for the neighbor pairs
still the best trick I had for it is giving it the concept of "nothing"
and maybe we will get there with some sort of ai one day
I took every shortcut I could think of
I don't use lists of modules, I use tags
and I added a setting to make modules able to just clone a source module
for all of their settings
so if i want to add a new "road" variant I can do that by just adding a single line to its config file
my plan for when i end up writing my own instanced dungeon generator eventually is to have the builder first specify a list of tags that can neighbor a module's face in question and then live-preview them each
with an ingame option to veto modules that don't make sense
This looks like some wave function collapse kind of stuff
edit: Should have read like 2 messages above XD
Very nice
much easier to define the adjacency lists when you can live preview the results
e.g. that door facing a door situation would be easy to veto out of the list
eh it hasn't been an issue in out designs thus far, we usually have fairly easygoing requirements for it but I also had an idea to be able to quick preview every possible arrangement
but we've managed to have tags that are honestly just very easy to deal with
the state space is probably going to be far too large for more than just a pair of modules or maybe three of them at most, for anyone to sit through and look at every possible permutation
should be doable for a pair of modules, though
can someone help me? im trying to import material lib but getting this error
No libraries found for 'org.bukkit.Material'
does other stuff work?
like can you use ChatColor etc
java```import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.ItemStack;
import org.bukkit.Material;
import org.bukkit.inventory;
it works for all imports but the last two
i ll try it now
and can anyone help me with creating basic npc plugin, all tutorials are old and dont teach how to do it on 1.21
@rough crane did it work?
yes it is. thx bro
np
sweet, thx
dyk what was the default yaw before the update which made it depend on the damage source?
Hi, I have a question, I saw on a forum that to delete your own plugin you had to report it saying that you wanted to delete it, how long does it normally take?
Correct. And usually within 24 hours
Not sure. Probably 0 or something
Hey guys, is there a limit to how many block displays can be spawned or smth like that? Cuz I tried to spawn a lot and half of them didn't appear. So i'm wondering if its my skill issue or some other limitation?
5 and 50 I expect no issues. 500 or 5000, yeah the client might limit rendering since block displays are entities not blocks (but someone probably knows more than me)
the highest i've tried is 24,000 something display entities, and apart from poor performance, there were no issues
none of them were missing as far as i could see
guess check there is no entity limiter plugin etc installed
also goes without saying, make sure you're running spigot
dont think so
Imma
just
head
out
rq
late reply but BITE
soo
how do i set a block's light level without changing the actual block (either server-side or client-side).
LightAPI used to be great for this, but their NMS wrappers only go as far as 1.19, and it's proving tougher to update the wrapper as mojang rewrote their light engine (details can be found here).
any suggestions?
not sure, from a why isn't it in the api perspective, generally dislike giving api that puits the world in a broken state
can you guys help me create basic player npc in 1.21.4? or at least recommend me a lib that works on 1.21.4
isnt there like a light block that can be placed?
he wants something else
k
maybe try looking for a newer API or making one yourself
or heck even update lightapi urself
if something is possible in older versions but isn't in newer versions and isn't a bug then there's a problem with mojang
the lighting changed
so
it wouldn't be that weird if some stuff that was easy before is now either hard or just not possible
oh ma gad mojang making optimizations
unbelievable
he could try ig
you're really just reacting to yourself
I didn't say it was a bad thing
the old lighting system was dogshit
I just also couldn't find a way to manipulate the new one
i don't rmemeber the last time they optimized the game
then I recommend you go get yourself checked for early onset dementia
anyways what's the best way for "dynamic" lore (custom enchants lore)
i don't want it to break if someone adds new lore
Hi, I saw that there are people who have spigot with the black theme, is that possible or are they using something weird for the browser?
probably dark reader
donators also get a built in one
They don't tell you anything for using this, do they?
MD will find your house and forcibly install Netscape navigator
there's no good way that i know of
after many years of trying to get my lore bits to play nice with other plugins trying to do the same and both of them failing miserably, i bit the bullet and set up a centralized api where plugins register "lore components" and forked every third party plugin that edits lore to use it
client-sided lore
Why does this happen? If you need to view more files, I will send them but I think this might be good enough.
That happens because you're not saving the items and keep overwriting the inventory
What line?
42
You must be thinking about when I open the inv but its not it. You see I try to put a item into the inventory but somehow it just denies
There's nothing else in the code that you sent that would cause that behavior
I do have a feeling that the updateView method would be causing issues as well, though we don't have access to what it does
hello, im trying to make my first plugin. im making an item that does something when right clicked. say i use a diamond, how do i tell whether its just a normal diamond or if its the custom item i want to react to the right click?
use pdc
?pdc
then ItemMeta#getPersistentDataContainer()
this seems pretty confusing to me but thank you i will try to look into it
looking for a developer to help me with aternos server! after work is done, i can pay $75 cashapp, venmo or paypal
eeew aternos
last I remembered doesn't aternos only allow you to use plugins on their approved list?
if that is true, then you don't need a developer
that may be the case but you don't need a developer specifically for such a thing
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
some people who tinker with plugin configs consider themselves "developers" lmao
they're probably referring to that
lol
how can I disable the sound and damage a firework does? (I want just the particles)
why not just spawn the particle you want?
cancel the damage event & resource pack
cuz firework no coloring :(
actually, is it possible to replace the dust particle's animation with the firework particle via resource pack?
doesn;t a FIREWORK particle accept a DustTransition?
Is it the firework particle you want and not teh trail?
yea
hm?
I see, sparks
?? π
my server is not starting again and again crashing and this is coming
@dusty herald
-> #help-server, don't ping staff and make sure you have space left
i have 8 gb space left in disk
sry now i will not ping staff
ok
Or maybe even pterodactyl π
space on your vm disk != space allocated to the container running your server
this is a host issue
go yell at them
how do I get the speed of player? I tried velocity but the issue is that the downwards force is counted towards it
as in current horizontal speed?
i mean
all kinds of speed
would be kinda nice
not only the horizontal one
How can I check if a player already has a specific item? It could be equipped or in the player's inventory. If the item is already present, it should not be added again.
I'm having the weirdest issue ever... So this is the code right:
if(result != null){
return true;
}```
But the raytrace returns true when it shouldn't. And when i check the position of the collision... it returns NaN for X Y Z?? Like what???
it almost seems as if it is casting an infinite ray downwards??
nvm
but
the max length
isn't
working
like at all
Which event is called when an Elytra generated inside of an itemframe naturally in the end cities?
What are you trying to achieve and can you send the rest of the code=
No event
Do a chunk scan
hmm ok
But how do i know if the itemFrame and the eyltra was generated naturally?
okay
"Cannot find declaration to go to" with class Material in spigot and spigot-api version 1.20.1. Can anyone help me? :3
Update Intellij
rl? Does the IntelliJ update fix this?
in spigot 1.20 found Material Class but not in 1.21
You're most likely running an ancient Intellij version that does not support Java 21
so Intellij cannot read that class since that's what modern Minecraft uses
because every other spigot class is found except really the Material Class
okay thank you π
that wasn't meant in a bad way at all
hey, what is the appropriate data to store if I want to basically store a sign to place on a block in a future date, including the text I want it to have
I noticed that blockdata doesn't seem to store that
I think it's blockstate?
on the api I see that the sign block has SignSide
is there any way to do what I'm trying to do without a bespoke class?
BlockState yea
I was hoping the API would have a class that would just store all the data
Blockstate then
it also does stuff like rotation right
guess I need to look at how to inject it back into the world
The state will also set the data
yeah but how do I replace a block's sate with my own
Youβll need to call update with the force Boolean
ok now I need to figure out how to extract block state from a worldedit clipboard lol
sanity check: if a constructor has no access modifier, can it be called from non-inheriting classes?
hopefully the full block thing is block state
No access modifier = package private
yes if in the same package
Only accessible from the same package
good enough, i just dont want people using the classes calling a internal method lol
anyone here happen to know what the path from worldedit clipboard to spigot BlockState is?
A clipboard stores more than one block
one of these days i'm just going to give up on WE, I only use it for storing schem files
I already have the selector done
I'm iterating
I was looking at BaseBlock
private static List<Pasteable> generatePasteMeList(Clipboard clipboard, Location worldPasteOriginLocation, Integer rotation) {
List<Pasteable> pasteableList = new ArrayList<>();
AffineTransform transform = new AffineTransform().rotateY(normalizeRotation(rotation));
Clipboard transformedClipboard = null;
try {
transformedClipboard = clipboard.transform(transform);
} catch (WorldEditException e) {
throw new RuntimeException(e);
}
BlockVector3 origin = transformedClipboard.getOrigin();
BlockVector3 minPoint = transformedClipboard.getMinimumPoint();
origin = BlockVector3.at(minPoint.x(), origin.y(), minPoint.z());
World world = worldPasteOriginLocation.getWorld();
int baseX = worldPasteOriginLocation.getBlockX();
int baseY = worldPasteOriginLocation.getBlockY();
int baseZ = worldPasteOriginLocation.getBlockZ();
Clipboard finalTransformedClipboard = transformedClipboard;
BlockVector3 finalOrigin = origin;
transformedClipboard.getRegion().forEach(blockPos -> {
// BlockState blockState = finalTransformedClipboard.getBlock(blockPos);
// BlockData blockData = Bukkit.createBlockData(blockState.getAsString());
BaseBlock baseBlock = finalTransformedClipboard.getFullBlock(blockPos);
BlockData blockData = Bukkit.createBlockData(baseBlock.toImmutableState().getAsString());
// BlockState bs =
if (blockData instanceof Sign sign) {
Logger.debug("ladies and gentlemen, we got him");
}
if (blockData.getMaterial().toString().toLowerCase().contains("sign"))
Logger.debug(WorldEditUtils.getLines(baseBlock).toString());
int worldX = baseX + (blockPos.x() - finalOrigin.x());
int worldY = baseY + (blockPos.y() - finalOrigin.y());
int worldZ = baseZ + (blockPos.z() - finalOrigin.z());
Location pasteLocation = new Location(world, worldX, worldY, worldZ);
pasteableList.add(new Pasteable(pasteLocation, blockData));
});
return pasteableList;
}
bit of a mess because I'm literally in the middle of rewriting it but you get the idea
Code wall jumpscare
just looking to turn that WE BaseBlock into a Spigot BlockState I guess
which will then hopefully preserve my sign text
wow what a loser
Do you need the Spigot blockstate or could you just set the block directly with the WorldEdit API?
fawe is bugged and won't work for what I want
look I am a simple man, I want this to place the block with all the data it should have for my signs, meaning rotation and text
that's about all I want
yes
rotation is good
text is nbt
I was trying to figure out if I can get away with an easy conversion because I technically can use my utility class to emulate this
you have BaseBlock#getNBTData / getNBT depending on the WE version
Just use WorldEdits setBlock method
How do I delete worlds? I've found this on the internet but it doesn't work:
teleportPlayers(lobby); // Teleports players to the lobby world
server.unloadWorld(gameWorld, false);
gameWorld.getWorldFolder().delete();
(lobby is a world that it always there and gameWorld is the world I wanna delete)
eeeeeeeeeeeh
actually right you're doing the really hacky block placing
yeah
I mean
let me be real
I don't know how slow the "vanilla" way they do it is
compare to just doing it via spigot api
I would guess probably not much of a difference, if any
I do believe Vanilla is slightly faster
prolly a bit faster yeah
but that might just be old information
I would prefer to handle it myself to be more independent from WE
I mean, itβs less method calls
converting nbt data for tile entities is kinda fucked
I originally asked if you wanted tile entities and you said no smh
the other day I learned that end gateways are tile entities smh
technically I didn't
This is why I moved away from the we api
someone asked me to keep the signs visible post paste which is why I am doing it
we used them as decoration and wondered why 20% of our mspt went to ticking hundreds of thousands
Well they gotta store the exit somewhere!
you can yeah
for sure for sure this is going to convert well amirite
easiest way to debug these is to make a schematic and just view the nbt
yeah should be fine
hm
Do you need Spigot BlockState or is an NMS one fine
getNBTData works for most versions
he already has nms blockstate
for now
Could just use that to set then?
well even if it wasn't if the solution is to manually go read nbt and potentially do conversions for it to work then surely no generic solution would work
exactly
I just want my signs to have text
I wish I could do so without having to do some kind of occult ritual
/**
* Read the given NBT data into the given tile entity.
*
* @param tileEntity the tile entity
* @param tag the tag
*/
static void readTagIntoTileEntity(net.minecraft.nbt.CompoundTag tag, BlockEntity tileEntity) {
tileEntity.loadWithComponents(tag, MinecraftServer.getServer().registryAccess());
tileEntity.setChanged();
}
this is how WE does it
With a bit of
NC -> Nms chunk
NP -> Nms block pos
NBS -> NMS block state
They're in hell
?paste
Hello, can I use multiple server resource packs ? (like there is already one from a plugin and my plugin also send one). Can both be on client or do I need to do something more ?
heightmaps are fucked and they prob think it's day
In modern versions you can just have multiple
Im using the EntitySpawnEvent but it seems like it doenst get triggert when an itemframe gets spawned when an End City is generated
Only when i place it
this pussable enable server for 1.16 in java 21?
You can send multiple packs since like 1.19.3 or something
yeah the fast pasting method I have seemingly bypasses the light zombies on fire component of minecraft
Hey i have a error when a player place/break block with worldguard
[14:40:19] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to WorldGuard v7.0.10+d9424b1
org.bukkit.event.EventException: null
[14:40:20] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to WorldGuard v7.0.10+d9424b1
org.bukkit.event.EventException: null
okay thanks
the method is the same ?
setResourcePack or smth like that ?
probably? I just use adventure
what a day
it feels like developing this thing never ends
every time I think I'm nearly done something wipes my progress
whats that for an error? https://paste.md-5.net/oqefumejim.sql
My Server is Spigot version 1.21.1 and Java version 21 (JDK)
XML file: https://paste.md-5.net/utokorujif.xml
My Project is using the JDK version 21 like the server
is Bukkit.getPlayerExact case sensitive?
I believe so, yes
can I somehow make it not case sensitive?
Not really. That would defeat the purpose of "exact"
You have #getPlayer() which does the same sort of player matching that a command target does
wait, so I could technically use getPlayer, then compare it to the input string?
after lowercasing both
I suppose that would be one way to do it, yeah
Like I mentioned, #getPlayer() works like a command does. My username is 2008Choco, and if I do /give 2008c stone, if I'm not mistaken, it will find me and succeed.
So, yeah, I guess you could pass in "2008choco" and check if it equals toLowerCase() of resulting username
Not sure why you want to be that strict about it though lol
Yeah I don't think anyone can register the username "2008CHOCO" for example because I have "2008Choco"
I think the check is probably case sensitive, but yeah you are right, the database or whatever considers names to be duplicates if only the casing is different
but player names can certainly have casing
can someone help me?
actually it isn't
Merchant merchant = Bukkit.createMerchant();
List<MerchantRecipe> recipes = new ArrayList<>();
recipes.add(createRecipe());
merchant.setRecipes(recipes);
MerchantView view = MenuType.MERCHANT.builder().merchant(merchant).build(player);
player.openInventory(view);
java.lang.IllegalArgumentException: The given title must not be null
Anyone that can help?
builder().merchant(merchant).title("anythign").build(player); i guess
as for why im here, does this look correct for projecting parallel rays onto a sphere?
public List<Location> project(Set<Location> shape, Vector direction, Location sphere, double radius){
direction.normalize();
ArrayList<Location> impacts = new ArrayList<>(shape.size());
Vector center = sphere.toVector();
World world = sphere.getWorld();
for(Location location : shape){
Vector origin = location.toVector();
Vector toCenter = center.clone().subtract(origin);
double distApproach = toCenter.clone().dot(direction);
boolean inSphere = origin.isInSphere(center,radius);
if(distApproach < 0 && inSphere) continue; //No ray intersection
double distCenter = toCenter.length();
double distInnerSquare = radius * radius - distCenter * distCenter + distApproach * distApproach;
if(distInnerSquare < 0) continue; //No ray intersection
double distIntersect = distCenter + Math.sqrt(distInnerSquare) * (inSphere ? 1 : -1);
Vector hit = origin.add(direction.clone().multiply(distIntersect));
impacts.add(new Location(world, hit.getX(), hit.getY(), hit.getZ()));
}
}
i tried that but i get this
java.lang.NoSuchMethodError: 'org.bukkit.inventory.view.builder.MerchantInventoryViewBuilder org.bukkit.inventory.view.builder.MerchantInventoryViewBuilder.title(java.lang.String)'
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/view/builder/MerchantInventoryViewBuilder.html according to this it exists so idk :/
declaration: package: org.bukkit.inventory.view.builder, interface: MerchantInventoryViewBuilder
are you running paper?
uh yes i forgot about that
yes
Paper does not have a string method, it has a component method
So either switch your server to spigot or develop against the paper-api if you wanna use API added to spigot/paper post paper's hardfork
alright thank you
Anyone know of a plug-in that has the ability to charge a different currency for different items like I have two currency one thatβs usd and another thatβs gems I want blocks etc to be bought and sold using usd currency in game amd the higher tier items to be bought with gems
It's usually done with separate shop plugins
is there a way to make a FAWE selection "glow" (with a specific color, if possible)?
like the outlines of the entire selection get the glow effect
i think ive seen people make blocks glow before
You'd likely need to get the player's selection region and do something with that.
... lets say i already have the selection object
I know entities can have a glow, but I'm not sure on blocks having glows?
Spawn a huge item display with an item model of that kind of texture
Would need a resource pack
Could also summon glowing shulker boxes since those connect but that would be a looooot of entities
well the selection is at MINIMUM a full chunk of the full world height
ive seen it be doen with fake shulker boxes and packets
i think im gonna think of something other than a glow
or maybe if i just made the outer surface of the selection glow, it would work for this use case
but how would i get the outer surface
Well shulker box
fuck
shulker boxes would be hella laggy on the client
I hate this keyboard why is the backspace key so smol and the return key so large
sounds like a uk format
sounds like a bad keyboard
nah
Anyone know of a plug-in that has the ability to charge a different currency for different items like I have two currency one thatβs usd and another thatβs gems I want blocks etc to be bought and sold using usd currency in game amd the higher tier items to be bought with gems
An essentials with this functionality
wait nvm hes online
i was just boutta ping jishuna
?kick beanernator2000 spamming won't get you help faster
Done. That felt good.
spamming won
can you async read data from World objects?
you "can" in the sense that the call will effectively schedule a sync task to the start of the next tick and then block on that
the read itself is still sync
and you'll probably end up waiting on it for ~50ms
you can also read blocks directly from nms chunks using nms without any synchronization, and this is safe in the sense that it won't make the server explode, but you are liable to read stale data or see air where you expect to see blocks
why is this not working ? p.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, Integer.MAX_VALUE, 3, false, false));
it give no error and it doen't give the player the effect
You should use the INFINITE_DURATION constant instead of int max value
as for it not working does your code run
yes i put a message in the same if statment
coding your own 
} else {
p.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, INFINITE_DURATION, 3, false, false));
p.sendMessage("nope");
}
i get the message nope but i don't get the effect
Can anyone help?
Im trying to make a CrafterCraftEvent event handler that will cancel the event when the items in the recipe contains filled_map with the lore "Uncopyable Map". I cant do it
What part do you need help with
Also I don't recommend checking the lore or name to identify items
Use a PDC tag
with getting items from recipe
bump
there is no problem. my server is vanila and i need the players to see this tag.
You can check the inventory of the Crafter
get the BlockState from the Block and cast it to CrafterInventory and see if it contains the item
Do you have code that would remove it
nope?
how are you determining that you don't get the effect
you're passing false for both particles and showIcon so it won't show up in the gui
i should be slow
check the return value of the method call
if someone cancels the event or you are immune to effects for some other reason, it'll return false
thx
how can u give me an example?
Hello, is there a tutorial to change a bossbar to display text and images ? I want to make a recreation of WAILA using a resource pack
Or is there another alternative to display something at player's screen ?
Bossbar would be the easiest
What you need to do is create a bitmap font with the textures you want to show
and some negative space characters
Hello! Is there a way to hide the held items from displaying in F5 and others can not see them too? I tried getting ProtocolLib to work, but there is no 1.21.4 version (downgrading is not an option)
I've hit a dead end. So please help me
The latest dev build should support 1.21.4
Good day, I want to return the money from Oraxen, there is zero support there, nothing is solved there, they don't help at all, I don't understand how you can allow Oraxen to be with you.
Hi, i know that mojang mappings have been out since 1.14, how do i apply them to versions prior to 1.17 (which is when build tools added them)
spigot doesnt offically support it pre 1.17
yeah im asking how to do it in other ways
generate the mappings yourself and apply them
yeah but i dont know how to generate the mappings, i know where i can find them, the minecraft wiki has the json for each version
but i dont really know what to do with those
you have to do exactly what buildtools does for newer versions, its all inside of buildtools and even after that there is no guarantee it will work
it would be much easier to just drop older versions
mh
It says 1.21.3
Idk why. It just kept making my plugin not load
so i need to see how buildtools does it in the source code?
Well one of the last changelogs was add 1.21.4 support
yeah
mh
how do you upload a lib/api to jitpack?
damn I guess mine isn't
If you open jitpack you can see the build log
also, it relies on github releases and tags, right?
You can build specific commits as well
...is it cuz of this one?
Or specific branches
Yes
yeah makes sense
okay
do you know how I could automate this process?
so that I don't need to create a release manually?
Don't really need to do anything
You can just depend on the main branch
And jitpack will build for you
if it has the maven-publish plugin running publish/publishToMavenLocal on the parent should run it for that too
cuz well
then you can depend as normal
how can I convert this to depend on the main branch
of the api module?
could also use repsy and publish from local machinee
...how does this work?
funny words, magic man
friend generated this for me
That looks about right for a basic config
Might want to set the version to the project version variable so you don't have to change in multiple places
creates a publication called "release" using the jars from the java component, group id as that, artifact as that and version as that
...why
also, how
I mean this is buildable
the default build.gradle.kts is empty
so is that the issue?
does Server#getEntity(UUID) work if the entity is in unloaded chunks?
depends. If the chunk had recently been unloaded the entities may still be loaded.
in general though, no
Ok I need to figure something else out when doing this at server start then, thanks π
PDC tag on entities and handle them when they are loaded
that's a great approach, thanks!
are chunk tickets persistent between server restarts?
no
ok thanks
does anyone know where it's trying to search?
It will just run publish to maven on the root build gradle
can I somehow make the root build redirect the build to the submodules or smthg?
Can't redirect as far as I'm aware
Define your publish task in the main build gradle
will that be enough?
bruh I thought this was gonna be simpler
why the fuq does jitpack complain
in build tools, when exactly is this file created? here it reads it and creates a VersionInfo instance but i couldn't find where it gets created
check git history
found it, thanks
I've encountered an issue where a specific patch isn't applied correctly, i get this error within the buildtools console
https://pastes.dev/JYbeMe99LX
any ideas?
( the parsed patch part is me debugging the patch with gson )
the code it expects to patch and what really exists dont match
check you have the right mc version amd make sure you arent giving it mappings its not expecting to use for them
and manually check the file its trying to patch and verify the patch would work
mh alright
i've already checked the actual file and it looks good to me
i'll see if i grabbed the right mappings
spigot will internally not support mojmap, the only part you can use mojmap is on your code ensuring you apply mappings correctly
and there is still no guarantee that the mappings will work properly or apply properly
i have no idea why it finds so many problems with it
https://pastes.dev/w8kfFaTsSp
are you running bt or recreating its steps
bt
i cloned it and replaced the info.json file with one using the mappings url from mojang
but i think thats not enough
i think i need to generate this too but i dont know how
use the one for the version you want
compare it with this one, its very different, im not an expert in this field but i think that might be part of the issue
you need to generate the correct member mappings, install the correct files with correct names to maven local, then map the server with those install stuff as required with its other files
ok well, how would i go about doing all of this? i dont know much about remapping
iirc older versions didnt have packages for nms, and didnt use nms so it didnt care about mojmap members
look at how buildtools does it, it is much much easier to either drop older versions or just use spigot mappings for nms
?mappings would be much much easier, this can help with converting from mojang > spigot
Compare different mappings with this website: https://mappings.dev/
it might be easier to avoid it, but that doesnt make it impossible
like manually when coding or does it have something to help me out on using mojang mappings directly?
its not impossible but its a hell of a lot of work for such old versions
manually when coding
mh
My goal right now is to make my library have access to mojang mappings for every version that has them, I'm alright with doing a lot of work to achieve that
but is there some sort of guide on how to do everything you said above?
Hello, can you tell me why spigot saves only META-INF folder in jar? Maybe I've built something wrong? I activated the jar:jar process
use the package goal
there isnt guides for much nms at all, and what i said is pointless to the average developer. and most developers just dont bother with such old versions for so little player base
anyone that understands how buildtools works, which is very few people now, and if they do know what to do they will most likely not care about supporting such old versions
ugh
i guess thats a bit of a dead end
well, thanks for the help, if you happen to figure something out let me know
I assume 1.17 is when build tools added mojmap support
So you're really on your own for versions before that
?howold 1.16.5
Minecraft 1.16.5 is 4 years, 1 month old.
yuh
Is it possible to add to jar files the code I need without decompiling the file?
i know in mode this probably can
but
in plugin how do this?
What causes this? 63 at the start of a stack
I think it might be a issue with the addItem from my InventoryManager, I don't know. But I can be wrong
I asking this because I need the correct number to show and players might think their items are disappearing
isnt there an api method to put stuff into an inventory with carry overs?
declaration: package: org.bukkit.inventory, interface: Inventory
if you want to do proper inventory management you should extend this at the very least so you are not having to duplicate code all the while being able to create a custom inventory
you should extend inventory that is
or implement, one of the two
anyways, not entirely sure why you end up with 63 it is quite possible it might have to do with actions being done in the same tick?
but if they end up with the correct number overall, don't really see the issue
So that is my issue?
not really sure, but there is more proper ways to do the inventory stuff without duplicating code like you are that is already present in the api. However you will just have to add some debug messages and do some testing to figure out why its doing what it is doing could even be just something within the server code itself and not necessarily something actually wrong.
I will have to test that but I don't think I was deplicating code, I wonder how Songoda manages inventories
You see in the add function that I blocking all items that are enchanted/custom
probably best you don't bring up that name here.
bruh why inteliji lib adding system so bugged
inteliji not can find class from jar when start compile but this class exists
Let me guess, they banned. No wonder they told me to switch to Paper. Just know I got autism. I might be breaking my mom's rules right now but if anyone (Not saying you are) turns into a hostile on me, my anxiety activates and I get banned in the wave. Not going in detail but multiple people tells me to get professional help, just a warning. I don't go on other servers for that reason
But I will test that and tell you the results
there isn't a particular rule about talking about those who are banned that I am aware of, but that person you mentioned is far from being a professional. They really don't create anything themselves. They buy up projects and then pay other devs to fix them just enough and then sell them and they don't even focus on optimizing anything. Anyways aside from that, there is some controversies of them that makes them even more terrible aside from their so called work. So its just best to not bring them up or talk about them. I also recommend looking at other people for inspiration that are far better then them
As far as bringing up ailements you should refrain from using them as excuses for anything. I myself have autism and few others here however it is no excuse to act a particular way. I recommend working on that anxiety of yours to where you recongize it and then just go take a breather. Its the internet after all it isn't going anywhere π
not saying you are doing anything wrong, just a response to what you have said nothing more π
I know all this, I trying to work on it but I think some people are right when it comes to professional help. For that person, don't tell me they used other people's work because I would unsubscribe from their services. They were not fixing anything so I started working on plugins again. I starting to get my answers to everything more we talk
that is because they don't fix stuff that people request, they fix it enough to sell. And they buy people's projects so it isn't like the use of other people's works is illegal in the way they are doing it. They also don't really pay their dev's very much either but that isn't really much of an issue as it is the dev's fault for accepting low pay work. Almost all of them are freelancers as well. But the controversies extends beyond just the plugins and has gone as far as Microsoft disowning them in a way π
so I recommend not getting involved with her, no matter how convincing she is
I know most of this as she enlisted my services but never paid me therefore I didn't do anything. However it didn't stop her from trying to get me to do work without paying first lol. And I was able to see some of the stuff going on. However I wasn't there for the more serious stuff that happened fortunately lol
I only used their plugins because they created plugins I need but since you said this, I unsubscribing. Thanks. Anyway, back to this inventory issue. Let me test this
All good, I don't expect everyone to just automatically know π
@wet breach I just noticed I cannot cancel this subscription so I stuck paying them
what method did you use if you don't mind me asking?
to pay that is
Paypal
I tried everything
When I click "Manage or cancel subscription", it redirects me to their website with no option for this
turn the autopay for it off
once you do that, papal won't allow it
doesn't matter if you used their site or not
if anything else, just send paypal a ticket
they will help you out and remove the sub π
if you do have to resort to a ticket, inform them that they don't allow unsubscribing
That might have canceled it
they don't like it when places do that and will penalize them
but it is also the reason why paypal allows forcefulling denying payments too
I have had quite a few sites denied sub services because of violating paypals terms π
but yeah, if you went to that link, clicked on the service, on the right it should have a link at bottom that says stop paying with paypal
and then you should see it in the inactive list
if it is in the inactive list, paypal will not allow their payment to go through anymore
They need to but yes, its inactive
π
I have a problem. I interact with EcoEnchant plugin but for some reason when I try to get a list the list becomes empty although if I use a command from the plugin it is not empty. Also I add dependency via lib from inteliji https://paste.md-5.net/udenatodup.java . Plugin.yml -> https://paste.md-5.net/zuharojimu.makefile
EcoEnchants.INSTANCE.values() is empty for some reason
By the way, 1 time the list stopped being empty, but when trying to use the command, ClassDefNotFound came out and pointed to MyLogger class. https://paste.md-5.net/jijugemoba.java
i heard someone say that ip bans are braindead cuz ip(v4) is dynamic. thats cap right? like i can js use ipv6
@wet breach Does this need to be a interface? I asking because I added extends Inventoryand it asked me to change it to interface
It's telling you this because Inventory is an interface. You just need to use implements.
Buuut I am not so sure if you should be implementing that interface.
no. both ipv4 and ipv6 addresses are dynamic unless you 'reserved' them. if someone restarts their router their IP resets
is there a way to return a Collection reference, but prevent whoever got it from modifying it? i don't want to have to clone it; it has potentially thousands of entries
return an unmodifiable collection
wouldnt that also require instantiating a new object with all the values? i want to dodge having to do that computation if possible lol
Convenience static factory methods on the List, Set, and Map interfaces let you easily create unmodifiable lists, sets, and maps.
guess not lol
have fun π
Is it possible to either:
- Damage a player without them getting any velocity
- Make a player red without damaging them
You think I should do this?
// Code
}```
give it a try. part of development is learning by trial and error
you gain valuable experience and learn what is or is not possible
pretty sure you can just set helth directly via the interface
i dont want to set health
I want to play them the damage animation
but without actually damaging / affecting the player
funny
takes like 37 seconds to preload 1024 chunks using 20% of a tick
if it's a void world
good thing I measured it, I was wondering if my code was slow
turns out minecraft is slow
alright well let's sideload this process, imagine that, pseudo-parallelized world generation
what a time to be alive
You pasting a whole flipping region ?
Could have just replaced a region file on the disk at this point
not that simple
Yeah I assumed
I don't know the specifics of what you're doing
pasting a region is faster then that
even loading one is as well
just depends how you are doing it is all
anyone know of a way to make a player stop blocking with a shield?
remove their shield?
@wet breach I might know what my issue is, the addItem method that my class calls. ChatGPT told me to check every slot
i'd preferably not mess with the players held items but if thats what i gotta do
well I don't know how else to make them stop blocking if you mean in the actual action, however if you just want them to still take damage you can just apply the damage regardless if they are blocking
i made a shield disarming stat that applies a shield cooldown on hit, but if the player is blocking while this procs the cooldown applies but they'll still be blocking and protecteed from damage
if they lower their shield first, they can no longer raise it due to the cooldown
basically do what an axe does
what if you just set infinite cool downs
thats not the issue, i dont want the cooldown to be infinite
its just that when you apply the cooldown that held-up shields aren't lowered first
xy I feel like
Should have said that at the start
so if you apply the cooldown while the shield is held up, it will remain up
Try calling swingHand or whatever
Maybe you could do something with the xxItemInUse methods
yeah only way I can think of to get them to lower the shield is to remove the shield and give it back
shucks
Vanilla lowers the shield when you get hit with an axe
Could look at how Mojang does it
that just applies the cooldown, doesn't it?
Hello, my HashMap is always reset. I don't know why it suddenly becomes empty during the inventory click event
private Map<UUID,UUID> viewers = new HashMap<UUID,UUID>();
viewers.put(player.getUniqueId(), target.getUniqueId());
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
if (viewers.containsKey(player.getUniqueId())) {
event.setCancelled(true);
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
Player player = (Player) event.getPlayer();
viewers.remove(player.getUniqueId());
}
Apparently just the cooldown doesnβt work
.
mm yeah spigot does not have api for the method vanilla uses for this
:(
pls help me
Sorry for the ping, but I've gone through the source code and i don't understand what part of it supports them since 1.17, I thought it was something I could replicate easily but apparently not, I'm looking to document my steps so that anybody that wants to do it can follow my steps, but I really don't know where to start, I don't get how I'm supposed to get the correct mappings, all I have is buildtools and the piston-data urls from mojang, if you know something that could help me please do tell lol, I've looked around for so long
where and how exactly are you adding the player to the map? the event handlers look fine, but where are you calling viewers.put?
As far as I know the difference is in the stash, but how does one convert the 1.16.5 stash mappings files to, for example, the same "format" of the 1.17 ones?
Like some had to handle that, somewhere that has to be code to do this process, no?
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Β§cΒ§lDas geht nur als Spieler");
return true;
}
Player player = (Player) sender;
if (args.length != 1) {
player.sendMessage("Β§cΒ§lNutze: /invsee <Spielername>");
return true;
}
Player target = Bukkit.getPlayer(args[0]);
if (target == null) {
player.sendMessage("Β§cΒ§lDieser Spieler ist nicht online");
return true;
}
player.openInventory(target.getInventory());
viewers.put(player.getUniqueId(), target.getUniqueId());
return true;
}
My guess is you make a separate instance for the command registration and the event registration
You need to use the same instance
MyClass instance = new MyClass();
getCommand("poop").setExecutor(instance)
Bukkit.getPluginManager().registerEvents(instance, plugin);
The code is most likely on mds pc, and as he said pre 1.17 is unsupported for it. And to convert you basically have to regenerate the mappings urself
The way you talk about regenerating the mappings myself makes it seem like it's very taskful, is it?
so?
Invsee instance = new Invsee();
Bukkit.getPluginManager().registerEvents(instance, this);
getCommand("invsee").setExecutor(instance);
Yeah, you basically have to figure out what class the spigot map is talking about then give it the right package and/or name to br able to generate moj memer maps
If it really all is on md's pc then that means I would have to bother him about it which I don't want to
He also most likely will just tell you to update
I've read that mod loaders do mappings stuff to access the sourcecode, but it's different mappings
Yeah he already has iirc
either way, so theoretically I could write mappings manually? If so do you know which files i'd need to rewrite?
You could use any mapping you like as long as you get back to reobf/spigot mappings
mh
Without going and looking at every file and it's differences back then it's hard to say, as a quick guess most of them
In theory the mapping process isn't that hard

Please do tell me more
Chance of all of them
ok well thats a start
So Mojang mappings map nms -> mojang
And Spigot does nms -> Spigot
There for you can do Mojang -> nms -> Spigot
yes
Run BuildTools and they should be somewhere in your folders
I can check but it might take a bit
is it this file?
or the combined one
or any of these?
these ones are from the stash
Mojang provides one for everything spigot has on for classes. One for members and one for fields in modern versions the members are entirely generated from mojanf
what does "members" refer to here?
methods
kk ty
I'd assume at least
looks like a mix of fields and methods
but why are there multiple mappings file from spigot
do i need to somehow merge them?
If you want to use the special source plugin you'd need to merge them in to a compatible format
Well, i've cloned buildtools, is it fine to use that or do i need to use specialsource directly?
I haven't had much luck with that
So what these files are:
.at = access transformer, changes the access modifiers (private, public etc)
.exclude = things that should not be mapped
-cl.csrg = classes
-members.csrg = fields and methods
As for that fields csrg you sent I don't see one when building mine
Where was it located?
this one?
yes
BuildData/mappings
wait nvm i misread
hey, is it possible to place a text on the display like in a ActionBar but on the left Side a bit over the hp bar with a plugin?
yeah it is
my work only looks like this though
Did you take the screenshot while it was working?
I think mine is different because i manually added an info.json file to replace the one from the stash since thats where i found some differences between 1.17 and 1.16.5
{
"minecraftVersion": "1.16.5",
"spigotVersion": "1.16.5-R0.1-SNAPSHOT",
"serverUrl": "https://launcher.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar",
"mappingsUrl": "https://launcher.mojang.com/v1/objects/41285beda6d251d190f2bf33beadd4fee187df7a/server.txt",
"accessTransforms": "bukkit-1.16.5.at",
"classMappings": "bukkit-1.16.5-cl.csrg",
"memberMappings": "bukkit-1.16.5-members.csrg",
"classMapCommand": "java -jar BuildData/bin/SpecialSource-2.jar map --only . --only net/minecraft --auto-lvt BASIC --auto-member SYNTHETIC -e BuildData/mappings/bukkit-1.16.5.exclude -i {0} -m {1} -o {2}",
"memberMapCommand": "java -jar BuildData/bin/SpecialSource-2.jar map --only . --only net/minecraft --auto-member LOGGER --auto-member TOKENS -i {0} -m {1} -o {2}",
"finalMapCommand": "java -jar BuildData/bin/SpecialSource.jar --only . --only net/minecraft -i {0} --access-transformer {1} -m {2} -o {3}",
"decompileCommand": "java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -asc=1 -udv=0 -rsy=1 -aoa=1 {0} {1}",
"toolsVersion": 105
}```
You'd probably need a resourcepack to make that look right
Specifically one with negative spacing
i saw that the format was different so i tried copying the 1.17+ format over to the 1.16.5 info.json, which included "mappingsUrl"
So i think these are created when mappings are technically found (although they might be wrong)
I see but you shouldn't have to modify BuildTools at all
if all you want is to use mojang mappings in a plugin
did you type that correctly
Do you know how to do it? Or have a tutorial on yt for it cause i dont finde anything related to what i want
Thank you
np
Did you type this message correctly?
yes all you need is an csrg file so that special source knows how to transform mojang maps to spigot maps
wait no shouldn't have*
I did not type it correctly π
lol i noticed
what would this csrg file do? would it be moj to nms?
You can look at the one for 1.21.4 for example
It's in your local maven repo under org\spigotmc\minecraft-server\1.21.4-R0.1-SNAPSHOT
Oh
See the <srgIn>org.spigotmc:minecraft-server:1.21.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn> part when using Special source
That's the reference to where the csrg mappings file is
so these 2?
It specifically references the maps-spigot
I'm not sure what the other one is used for, probably during the build process with BuildTools
mh
so if i can have that maps-spigot.csrg fine in the local mavel repository i'll be able to use mojang mappings?
You'd need to make one for 1.16.5 and then it might work
I haven't checked how special source works or anything
I'm just making some guesses
mh
do note, there is 2 specialsource jars
one is to kill lvt
the other is to apply the mappings
what does "kill lvt" mean?
local variable table, to remove the funny snowman
because you haven't seen the funny snowman in decompiling π
there's a funny snowman?
The obfuscation Mojang uses caused a field to be named β
lmao
βοΈ my beloved
my idea was to modify buildtools so that it would have everything it needs to make the mappings for 1.16.5 and below
the mappings should be available in the repo no?
spigot didnt support mojmap till 1.17
yeah so now i need to make them myself
issue is i dont know how
so i kinda need to go on the assumption that buildtools will do it for me if given the right circumstances
the only mappings bt will generate if given the right stuff is members
its only 10 years old and made to be used in a specific way
well that I didnt know
special source can generate mappings if you check the code
it can do more then that
last commit by epic ebic and md_5
do you know exactly which part does? I wasn't able to find anything useful when i checked
oh
so i need to give it an obfuscated jar and a deobfuscated one?
Now I'm confused, I don't have the mappings nor a mojmap jar, how do i get it?
maybe one day specialsource 2 will have a repo
it feels like i need either to get the other
ok uh, slightly unrelated, buildtools doesnt work anymore
its stuck at downloading git
delete repos and retry
im not using a custom build anymore
one day
kk
if I remember right, specialsource 2 can do quite a bit too
just it isn't used that way lol
when i last looked internally its fairly empty
use spigots generate minecraft-server jar and apply mojmap to a mojang server after extracting it from thebundler