if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {
if (this.respawnEntityOnShoulder(this.getShoulderEntityLeft())) {
this.setShoulderEntityLeft(new CompoundTag());
}
if (this.respawnEntityOnShoulder(this.getShoulderEntityRight())) {
this.setShoulderEntityRight(new CompoundTag());
}
}
}```
#help-development
1 messages · Page 1259 of 1
this is causing parrots to dupe even if i handle it
i am not sure if there is a way to stop this either, it just makes a new entity
wth? new CompoundTag()
um, this is just in the remapped nms player
so basically i have two vices i want to get rid of if u know how to stop one id appreciate the help
well actually im not sure why getting hit removes the parrot i assume thas a minecraft thing
id imagine its that function above though
i cleared goals and disabled AI it still happens
infact when they get hit it spawns a new parrot that it duplicates
which has AI and no custom nametag
well yeah when someone gets hit it makes a copy of the entity but not a deep copy
gg
in the name shop, of course
that brings no results lol
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
you have to wait till your donation is processed
any way to bypass the 99 max stack size limit :3
downgrade to 1.8
but like, why
you will find that very difficult
use percentage progress
the bundle tooltip has a nice progress bar
yo @blazing ocean you ever got that negativespacefont offset feature working?
it puts a %s
I might need the datapack
no
you just add the negative offset and then the positive one
doesn't need a datapack
visitor pattern mention
Guys the queued packet thing is actully throwing exceptions on some servers
https://paste.helpch.at/bipalupixo.css
// we should limit this so bad api usage won't oom the server.
Preconditions.checkState( packetQueue.size() <= 4096, "too many queued packets" );
You probably want to make this thing silent or only print once in a time as a small warn. Ill make a PR if anyone is willing to merge.
nvm ill make a pr
porting this to java be like
L
fucking lambdas
and now I need a font registry
@blazing ocean what's TranslatableComponent#arguments
if it's just args I don't need to filter
well I wanna add the width of translatable arguments too
this probably doesn't work with the global translator btw
apparently my font bugs out on lowercase but yeeting everything to uppercase works fine
....why would you put that text in there
it's a menu
I'm talking about the content
we're using spritesheet
yeah
😭 I did that once
could prob automate it ngl
Yeah pretty easily
I got a negative space font for the MC font a while ago and just used a vim macro to turn it into a kotlin map lmao
(MC font magic discord my beloved)
is there any way to determine if an inventory holder will drop it's contents on break? I suppose only shulker boxes fit this category but I'd rather not hard-code a check for those
its* 👍
and
or
xor
i need settings for knockback
knockback:
friction: 0.5
horizontal: 0.6
vertical: 0.4
vertical-limit: 0.5
extra-horizontal: 0.5
extra-vertical: 0.1
thats so bad
lol
pvp
this feels a lil too specialized for spigot, you may wanna ask inside of a practice community as this channel is for coding plugins
After consulting the docs, I don't believe there is a method for this so i think hard coding it is probably your best and only option
Anybody know how can i do gradient rank or ranks in Border?
what is Border supposed to be?
Anyone know what the best way for clearing/resetting a world after a minigame has finished (eg. skywars).
I tried loading a backup by doing file operations and unloading the old world, but this only works if the server is restarted and doesn't take effect immediately.
you could check in the BlockBreakEvent if the block in question is an InventoryHolder and isDropItems is false
uh, I guess the shulker itself is counted as a drop lol
hm, yeah no I can't think of anything other than specifically checking of a shulker box, or checking if the dropped item's item meta is a BlockStateMeta whose BlockState is a BlockInventoryHolder, but that seems oddly complicated
heh. thanks for the idea though. for now I just created a tag and added shulker to it, so I at least have some flexibility if it ever changes
it'd be a little nicer if InventoryHolderMeta existed 😔
unloading the world and then loading the backup again should take effect immediately, are you sure you're unloading the world properly?
It should lol, this is how I am unloading. Confirmed working with the loggers I added to debug
public String getGameWorld() {
return gameWorld;
}
World gameWorld = Bukkit.getWorld(val.getGameWorld());
if (gameWorld != null) {
Bukkit.getLogger().info("Unloading world: " + val.getGameWorld());
Bukkit.unloadWorld(gameWorld, false);
}
The string from my values class is constructed from a .yml file. Its just the name of the world. Bukkit.getWorld takes string correct? it would have thrown an exception if the world didn't exist either...
and how are you replacing the old world? Are you sure everything is being replaced with the backup as it should?
I am replacing the old world by copying the backup world (in the backup folder) to the root directory where worlds are generated and stored by default.
File backupFolder = new File(RamCTF.getInstance().getDataFolder(), "backups/" + val.getGameWorld());
File worldFolder = new File(Bukkit.getServer().getWorldContainer(), val.getGameWorld());
Before I copy the backup, I delete the world folder first, then do:
copyWorld(backupFolder, worldFolder);
private static void copyWorld(File source, File destination) {
try {
if (source.isDirectory()) {
for (File file : Objects.requireNonNull(source.listFiles())) {
copyWorld(file, new File(destination, file.getName()));
}
} else {
Files.copy(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
} catch (IOException e) {
e.printStackTrace();
}
}
After that I just call world creator to make the new world, which should load it?
WorldCreator creator = new WorldCreator(val.getGameWorld());
creator.environment(World.Environment.NORMAL);
World newWorld = Bukkit.createWorld(creator);
if (newWorld != null) {
Bukkit.getLogger().info("World created successfully: " + newWorld.getName());
}
else {
Bukkit.getLogger().warning("Failed to create world: " + val.getGameWorld());
}
what is this lockable interface for? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Lockable.html I'm not sure I know why this exists
declaration: package: org.bukkit.block, interface: Lockable
Locking containers
They can only be opened if you have the corresponding key item
“Represents a block (usually a container) that may be locked. When a lock is active an item with a name corresponding to the key will be required to open this block.”
The key used to just be a string, now it’s an entire itemstack
I read that part but I'm not sure why it's there... is that a vanilla mechanic I've never known about or a spigot one
til
It’s been around for many years but nobody really uses it
Mostly because it is more of a thing you use in adventure maps or something, not survival
ah yes, adventure maps :pepeold:
I honestly haven't seen one in years lol, I remember playing them casually when I happened to find one I liked in planetminecraft
you seem to be only replacing the old world with the new world instead of actually removing the old world
I don't know if it is the actual issue, but it could certainly be that some of the region files containing the changed chunks are not getting replaced for whatever reason
I'd delete the world first and then just move the backup there just to make sure
Would anyone know why my worldguard would be trying to open a link when clicking flags? have very few plugins and have isolated it to not be a conflicting plugin
I also have a method for doing that which I execute before the copy.
private static void deleteWorld(File worldFolder) {
if (worldFolder.isDirectory()) {
for (File file : Objects.requireNonNull(worldFolder.listFiles())) {
deleteWorld(file);
}
}
worldFolder.delete();
}
The overwriting in the copy is more just there as an extra, a just in case
then I truly don't know, is the world you are trying to regen the main world perhaps?
because you can't unload the main world
In my testing I am doing it on just "world", so yeah the default. I did not really know that but I suppose that makes sense. Should I try to multiverse create a new world and set it to that?
sure, that works
so many people have been burned by that lol, I am honestly surprised nobody made it throw an exception when people try to unload the main world at this point
Yeah, I would have had another world in my actual implementation lol, but I assumed it would be fine to just use world especially beacuse it gave me zero indication that you cant do that. The function even executed successfully and my debugging statements work as expected. Naturally a lot a functions I would think follow good exception handling and are really just boolean logic when its not a getter or calulate x for example..... but I guess not in this case
Okay strange... now its just not working at all. 😭
Not even print statements.... it just doesnt wanna
ooooh wait I know why
Im mad, I kept wondering why my if statement wouldnt trigger where it cant find the world of the same name in backups... I had two backup folders in different location sin the server folder. I kept doing it to the wrong one. No idea how the other backup folder got there
Okay... so its not really working. Its better as I got a new world to generate instantly, but the world it loads is not the copied one. It generates an entirely new one with the same name
Looking for
I figured it out!
I needed to add this line to my copy function as well:
if (!destination.exists()) {
destination.mkdirs();
}
Since the destination folder was deleted, it couldnt actually copy anything to it. Thanks @sly topaz again for pointing out the main world issue 😅
np, glad you figured it out
Consider using the NIO API btw
is there any event for inserting/removing items from blocks that don't "open" aka chiseled bookshelves, composters, etc? or am I limited to using PlayerInteractEvent
since the chiseledbookshelf also counts as an inventory holder, check whether the inventory click event doesn't trigger for it
but other than that, yeah, you're kind of stuck with the PlayerInteractEvent
ok thanks
getting the slot clicked should be easy though, since you can do chiseledBookshelfState.getSlot(playerInteractEvent.getClickedPosition())
(for example the minecraft wiki is missing uniform samplers, the json format, vertex and fragment ins outs etc)
there's this but I am sure it's also missing something as well: https://github.com/McTsts/Minecraft-Shaders-Wiki/
your best bet is just looking around and collecting all of them as you go since the info about them is pretty scattered right now, even more so considering the recent changes to the core shaders
Yeah a lot has changed each like 3 minor versions since 1.20
if I were you I'd just take yarn and take a look at the client source code
so seems like ProjectileLaunchEvent doesn't fire for ender pearls. is there another event or again... I gotta look at the player interact event?
ProjectileLaunchEvent should definitely fire for ender pearls tho
Nop
its not a projectile
you can check entity spawn event
ah smart
wait you mean ender pearl or eye
Is there some git rep that already houses that or do I gotta find it in the mc jar?
im a bit unsure if ender pearl will spawn an entity
Oh yeah i was confused with ender eye
I don't remember there being a rep for the clients src
because that won't throw projectile
oof I meant the eye sorry
makes sense
declaration: package: org.bukkit.entity, interface: EnderSignal
I'm testing my code and pearls were fine but the eye for stronghold hunting doesn't fire that event
check for ender signal spawn
ok awesome thanks
I think the ender signal might not fire the entity spawn event
I remember that being an issue at some point, no idea if it ever got fixed
what people used to do is listen to the statistics increment event and just check if use_item statistic was incremented
maybe Container works for identifying blocks a player can "open" vs not, like chest vs chiseled bookshelf
hmm maybe not
I need to remind myself which blocks can be opened and compare
no but I think there are some than can that do not
ya the loom can be opened
if you have the block, you can check whether the BlockData is an instance of Openable
I'll try that
ya I think I just need a tag for these
why does LoomInventory not extend Container now I wonder
let me check if it is a Container in NMS
wait, Loom doesn't have its own BlockState class, so it might just return Container as BlockState
ya there's a few that don't use inventoryholder/container/etc because they don't actually store stuff. loom, smithing table, grindstone
does anyone know why the code doesn't save spaces and comments in config file? (1.8 plugin)
private final Main instance;
private final FileConfiguration config;
private final FileConfiguration messages;
public ConfigFile(Main instance) {
this.instance = instance;
this.config = saveConfig("config.yml");
this.messages = saveConfig("messages.yml");
}
public void saveFile(FileConfiguration configuration, File file) {
try {
configuration.save(file);
} catch (IOException e) {
e.printStackTrace();
}
}
private FileConfiguration saveConfig(String configName) {
File file = new File(instance.getDataFolder(), configName);
if (!file.exists()) {
instance.saveResource(configName, false);
}
return loadConfig(file);
}
public FileConfiguration loadConfig(File file) {
YamlConfiguration configuration = new YamlConfiguration();
try {
configuration.load(file);
} catch (IOException | InvalidConfigurationException ex) {
ex.printStackTrace();
}
return configuration;
}
public FileConfiguration getConfig() {
return config;
}
public FileConfiguration getMessages() {
return messages;
}
}```
although I don't care about those now that I realize it
all I want is a way to separate non-openable invs like bookshelf so I can use a tag if nothing else pops up
bukkit's yaml API doesn't save comments in 1.8
is there another way to save multiple configs with comments?
just use a different configuration API
though comments aren't deleted from the default config, they're only deleted if you make modifications to the config inside the plugin
i know, when it generates the first time it have the right comments/spaces but when i use the command in game (setspawn) it saves the new coords in the file and loose the comments
how do i turn a png into a map
you can load an image into a map
how
now that I think about it, couldn't you just check their inventory type/menu type
yeah, you can just do getInventory().getType().getMenuType() != null
checking InventoryType#isCreatable might work just as well tbh
declaration: package: org.bukkit.map, interface: MapCanvas
lol this works for the bookshelf but not the decorated pot
the pot says menu type of chest, isCreatable
it is for one stack I think
it has no ui, you have to break it
so why it has a menu type of chest is weird
it doesn't have a menu type though, that's probably a bug lol
it doesn't even have an InventoryType now that I am looking at it lol
yep, it is a bug
since decoratedpot doesn't have an inventory type, it defaults to chest
haha nice
well, at least you can just report that one and add it as an exception until it is fixed lol
been a decade since I reported a spigot bug... gotta remember where it was and my credentials lol
I can do it if you're fine with that
sure, can you send me the link pls
will do as soon as I finish the report
I found my login and am in, not that it matters
oh well I haven't even started writing it yet so you can do it if you want to lol
I don't particularly care either way, I was just about to run BT to get the latest Spigot
ok I'll file it
it probably doesn't matter for this kind of bug report where the bug is clear but eh
ya I'm updating to latest too to ensure I'm just not out of date
oh you're fine, I checked the javadocs to make sure I wasn't tripping lol
nice
btw can you confirm that EnderSignal doesn't fire EntitySpawnEvent
from the code it definitely looks like it should, if anything
it's interesting since it sends a projectile shoot game event even though the entity isn't a projectile
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1545/ just made a PR for it since it was easy enough
Looks good I think, will merge shortly
Searching an all round dev who wants to develop for me you get paid!!
I wonder if these types of containers deserve a SlotType, or rather if it'd be useful to have one specifically for this kind of pseudo-slot
?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/
also don't cross-post
Searching an all round dev who wants to develop for me you get paid!!
if I had a finger pointer, I'd totally make the meme with this lmao
Guy friend requested me
Don't even know how or why
#help-server message ?
I did not tell you to DM me
cry about it

it is ill advised to stir trouble with members here
breaking the rules is also a quick way to get the boot too
Spigot members rn
lol
i want to use custom item models on items for like different armor skins or whatever
players will already have a resource pack loaded on their client which will have the custom models
whats the easiest way to achieve what i want?
Seems like you want two things.
Custom item models
Custom armor textures
Both should be done by changing the respective data component in item meta
Depends on version too, latest -> change the item model component thing
the plugin is on the latest version of minecraft
does your resource pack use custom model data predicates or item models?
um im sorry i have never worked with models before but this is my json for one of the models
@sly topaz
that seems redundant
Unrelated but please use vscode or notepad++ instead of windows notepad
if in: gui, gound, item frame: show model 1
otherwise show model 1
But yes, use the item model data component
that looks like item models
you can set the item model by using ItemMeta#setItemModel(NamespacedKey)
i didnt make the resource pack :p
i did notice that the redundancy isnt much of a redundancy yeah
so i can do that to any item? any block, tool, armor?
also ive noticed i need the resource pack's namespace, is that just the name of the pack?
no, it's the namespace
where would i find the namespace
in /assets/<namespace>
Items only
For wearing armor you have to set https://minecraft.wiki/w/Data_component_format#equippable
tools are items, if you have a block in your inventory that too is an item so it would work too (not if you place it tho, those are block models)
I mean, that's for turning an item into armor
i meant like
ye but it contains the asset id
just giving normal armor a new model
for the texture used when wearing armor
I mean, you just have to use that method there with the resource pack's namespace, that's all
so if i do #setItemModel it will give the armor that model while holding it in my hands
correct
the #equippable is for when wearing it
yes
alright, thanks for all that help
Well done Disc ord, suddenly decided to use black text on a black background
css fail
Seems so
Tried and nope
Time to nuke the cache
all text stays black no matter what theme I select
yeah I'll give that a go
welp clearing the cache folder did nothing 😦
Its perfect for you 😉
are you using discord in the browser?
I guess it will make no difference if I can read chat or not, I alwasy talk garbage
Windows discord app
tried updating it?
um, I assume there is a button somewhere to check for an update, but perhaps I'm giving them too much credit
upper right
there should be like a check mark? or something like that next to the inbox
nope just a ? help
weird, wonder if its conflicting with your windows theme =/
might have to try re-installing discord
I guess thats possible. I'll try nuking stuff in its data folder and see what breaks 🙂
lol
looks like discord no longer has an install for Win7 😦
it installs but fails to start due to OS 😦
looks like no dark mode for me. Blindness incoming
with GUIs, do i need to destroy an inventory or does the garbage collector handle it
i wanna have a dynamic inv but i cant just set an items meta/amount and have it done with
i feel like u need to just open a new copy of the inventory
You don't have to open a new inventory every time you want to change its content
that's a horrible idea
?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.
?paste if too long
im looking @ it bc the meta updates but the item count doesnt
i dont think posting my whole menu implementation is gonna be too helpful
a better question is, is thre a quirk with inventories where u can update itemstack meta but not the counts
i have the clicked item's itemstack and yeah if i update its count it doesnt work but meta does
Perhaps just show how you update the count
Tho I don't see any other options than ItemStack#setCount :D
true
wait one seci might have done smsth stsupid
ill ask again once i go thru it one more time
mhmm, that clicked item sounds sus
not sure why meta would work tho
wait
yeah i think its just sosmething with itemstacks
ItemMeta skillMeta = clickedItem.getItemMeta();
skillMeta.setDisplayName(ChatColor.GREEN + ChatColor.BOLD.toString() + skill.getName());
clickedItem.setItemMeta(skillMeta);
clickedItem.setAmount(30);
this.setItem(clickedItem);
this will work... but the amount wont update
if anyone knows a fix it'd be much appreciate it id rather not clone it and set it via slots
I never did have perms to bitbucket, but thanks!!
oh wtf....
you cant override max stack amounts
this whole time it was because i was using an enchanted book
swapped it over to a regular book and it worked
i thought you could programatically override this
any ideas on how to fix this?
it said not compatible for paper 1.21.4
but when I change to spigot, there comes another problem
mythic lib wont read the skills of my mmoitems
Yes, I'd pay attention to errors/warnings
after it tells you that paper is not supported I'm sure it also tells you it is disabling
Yes you can. On higher versions there max stack size component. Can't be together with tool tho.
Well, this is bound to happen more and more often with plugins supporting both platforms.
any suggestions on how to fix this?
run spigot?
I did try to switch up to spigot which works, now it wont let me use my modelengine
lol
Unfortunately, you have to wait for the dev to fix it.
its like a double edged sword hahaha
Otherwise use what works
I only code against Spigot. If a fork breaks base Spigot functions I don;t code for it.
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event){
if(!(event.getEntity() instanceof Player)) return;
if(!(event.getDamager() instanceof Fireball)) return;
Player target = (Player) event.getEntity();
Fireball fireball = (Fireball) event.getDamager();
if(!shooterMap.containsKey(fireball)) return;
Client shooter = shooterMap.get(fireball);
Client hit = getInstance().getClientManager().getClient(target);
if(shooter.isFriendly(hit)){
event.setCancelled(true);
return;
}
event.setDamage(0);
target.setFireTicks(40);
getInstance().getServer().getPluginManager().callEvent(new PureDamageEvent(getInstance().getServer().getPlayer(shooter.getUUID()),
target, 1, getName()));
}
Fireball fireball = (Fireball) player.getWorld().spawnEntity(player.getLocation().add(0, 1.5, 0), EntityType.SMALL_FIREBALL);
Vector tosend = player.getEyeLocation().getDirection().normalize().multiply(1.2);
fireball.setVelocity(tosend);
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_BLAZE_SHOOT, 1, 5);
shooterMap.put(fireball, getInstance().getClientManager().getClient(player));
return true;
does anyone know why updating spigot versions makes players not get set on fire
okay, thank you
I’ll probably have to decide here soon which one I’ll be using, but as long as the changes are minimal I could still do both.
(Example being the version string change that paper made somewhat recently)
should I just break down the jar file and update it myself
no, that would be a huge task
ok delaying it by a tick seems to fix it... must be something to do with damaging a player/stopping fire ticks?
that's true + lib supports too
Id have problems on those
UM ok ive fixed all my other issues lol
can u remove nbt tag gray messages below items
wdym gray messages
Depends on what you do in them, but themselves pretty much not at all
um u know when u hover an item in say creative
it says
minecraft:ink_sac
8 component(s)
ah
no you cant hide that
thats client
you can hide it for yourself by using f3+h
why are stairs and trapdoors counted as Bisected
That doesn't sound right
They're listed in the bisected subinterfaces https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Bisected.html
declaration: package: org.bukkit.block.data, interface: Bisected
I agree it sounds weird, hence my asking. But maybe I don't understand a technical reason they are
Trapdoor seems to share the half property
Because they can be placed top or bottom of a block
And so do stairs
That javadoc description could be better tbh
It's missleading
iirc it's spelled misleading
i'm guessing it was originally for slabs
no? what
okay yeah that is beyond misleading
Spell check police in help dev 👀
any guy libs that have "slot" logic so I can take player input and have it all restricted?
like handling shift clicks properly and whatever
nms
bleh
how would I go around using something like it
even the NMS route is a little fucked
implement your own container implements net.minecraft.world.Container, MenuProvider
ah AbstractContainerMenu is what I want
you may also have to implement your own CraftInventory to wrap it for api access, i don't quite remember
I should really build a menu lib around this
then overriding the MenuProvider methods you construct a Menu for each viewer by constructing a bunch of Slots, which then can be assigned their own behaviour in a very nice and oop way
yeah, this is fairly abstractable into an api or a library; it's very straight-forward and clean in my opinion
i'm not sure why bukkit hasn't done it
why does nms make me override quickMoveStack all the time
there are also other very nice things you can hook into apart from canPlace/canTake, such as setChanged, which is called whenever anything changes the item in the slot
yeah I'm gonna think about how I'd abstract this all night
tbh just wrap the object types in api interfaces and it'll already be pretty clean for a library
Hey, if i have a statement like this:
SELECT * FROM users WHERE UUID = 'test';
And want to check if a user with the UUID "test" exists, can i do this:
PreparedStatement statement = conn.prepareStatement("statement...");
ResultSet result = statement.executeQuery();
if(!result .isBeforeFirst()) {
//there was no user
}
And also, can i just read the uuid afterwards without doing any other command before
like this:
result.getString(1)
i don't remember having to implement that
not with the interface but the abstract class requires it
which class requires you to implement it?
AbstractContainerMenu
yeah
and ChestMenu will take care of quickmove
I don't think it checks mayPlace
yeah now that i look at it, it doesn't seem to
moveItemstackTo checks it somewhere
suppose you could copy-paste it and throw in a check, though that's not exactly clean
use result.next
?codereview
#1100941063058894868 is the place for code reviews. Remember to read the pinned message!
!result.next()
in an if statement and then i can just use .getString() or whatever
if you're using kt just use jetbrains exposed
no code else required
wym
it does it all for you
where is that option
oh
it looks good
does it support other sql ?
like maria
or mysql
exposed is the best shit ever
seems nice
.
https://pastes.dev/R8LtcY7Ak7 it very much is nice
ok ok
exposed looks good
what event gets called when a player swaps their held item with their offhand when their inventory is open?
can you do that with the inventory open?
iirc the keybind for that, when the inventory is open, will cause the hovered-over item to be swapped with the offhand, rather than swapping the held item
if you mean the former, that's i think an InventoryClickEvent with InventoryAction set to HOTBAR_SWAP
i could be wrong; easiest way to check is to just write a listener and tryitandsee what the action is
is there any api to detect the result of an inventory click to move items between inventories? aka was it successful and how many items moved? or.. is there a way to know if an item is accepted in an inventory? an example is I have an item stack of beacons and a FurnanceInventory and I need to know if they'll be accepted if a player tries to insert
getRecipesUsed seems like the only way I see
nms lets you do it easily
yeees
ah maybe it's time I give in and use nms for some things
Spigot doesn’t ban u for asking that
As far as i know we didn’t have it back then, but u can check
Most forums say it does I cant get it to set though ;(
Yeah it was in the spigot subclass back then
How do projects using nms use jenkins, do they have a separate buildtools task setup somehow or do they run it manually now and then for newer versions
I honestly don't know of any that have a CI setup lol, now that I think about it
but if you have the resources to host a CI, you can also just host a maven repository with credentials where you can host the spigot dependency
I do have nexus running
I know that you can run BuildTools with Github Actions so I assume there's something similar with jenkins
ya thats what I was thinking, setup a task to run it or something. I've avoided nms as best as I can but I think there are a few things it can help with, like determining whether moving items between inventories were successful. it's always bugged me I can't know if an inventory click successfully moved items
👀 Looks like ssamjh has a video on it
Run at midnight (or close to it):
H 0 * * *
Run at any time when least resources are being used:
H H * * *
The shell script for Jenkins:
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -O BuildTools.jar
java -jar BuildTools.jar
Archive the artifacts:
-.jar
Java 8 on Ubuntu 14.04/12.04...
oh good find, thanks
ah wait that's grabbing the output jar
does InventoryMoveItemEvent not work for that
I am honestly never really sure for what scenarios that event triggers lol
though if that doesn't work, is checking whether the InventoryAction is MOVE_TO_OTHER_INVENTORY in the InventoryClickEvent not enough?
That's for Hoppers
shit event name then
ya thats for hoppers moving items. the InventoryAction is useful in that it tells me what the user is trying to do, but as far as I see there's no way to know if it worked. for example if you shift click a stack of beacons into a furnace it will just jump around in your inventory since they're not allowed, but you can directly click to place invalid items in.
In the past I wrote logic to "guess" if it would work like checking if the inv was full, etc, but there are too many scenarios to account for. I'd kill for some kind of "result" event that says how many items were moved, the InventoryAction, etc
still helpful. I believe buildtools places them in the local .m2 repo so that might be enough to build related projects. guess I'll have to try sometime to know.
Yeah it places in the .m2 repo
but having never used nms I don't know if it really can solve my problems so I'm not eager to see
I see, welp if you do use NMS it should be as simple as doing something like ((CraftInventory) someInventory)).getInventory().canPlaceItem(slot, CraftItemStack.asNMSCopy(bukkitItem))
there's also IInventory#canTakeItem to check whether they can remove the item, but that's only used by chiseled bookshelves
those two methods could be added to the API as is tbh
those would be cool, although still ultimately lame I have to write so much to figure out if they moved items etc
well if it gets added to the API it'd ultimately just be Inventory#canPlaceItem(int slot, ItemStack item) and the equivalent for taking as well, I'll try making a PR for it and see if it gets accepted
oh and if you want to see the PRs, you just have to agree to the CLA
?cla
submitted
I haven't gotten my cookies yet
is this good enough or should I be more specific about the use-cases
seems good to me
can you guys help me i cant link essentialsX correctly
you mean e.x. not i.e.
i.e. meaning (in other words, equal to this) e.x. meaning for example
can you help me fix my plugin
if you tell me the issue and give code
why in DMs
because i cant send files here
?paste
i still get the errors
what did you change
yes i did
?paste
did you resync maven
huh 😭 i havent made a plugin in years
im so done with this bullshit bro now all my code doesnt work
what is your issue
you're depending on both spigot and paper there, remove one of them, ideally paper since we're here
but my plugin is using spigot
so remove the paper dependency then
ok i did but its like im using ess3 which is a old version of essentials and like idfk
it shouldn't matter what version of essentials you're using
why are you even depending on essentials to begin with
economy? If so I'd just use vault for that
its stuff with /pay
Essentials hooks into vault so you can just use it to interface with Essentials or any other economy plugin really, since most interface with Vault
ok i just did something and now almost everything has no errors
when trying to sync i get this error : io.papermc:paperlib;1.0.6 was not found in https://repo.essentialsx.net/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of essentials-snapshots has elapsed or updates are forced
@sly topaz
my solution is to not use essentials API at all and just depend on Vault instead
So what's the difference between a door being Bisected and a sunflower, lilac etc not?
The flowers are too
they are bisected too
They just don’t have a special subclass since they don’t need one
you beat me to the punch twice in a row
ah, I should have realized that lol
Does anyone know how i can change a players skin without it updating in the tab menu? Im making a /mask command and i don't want players to be able to peep the tab menu and see that their skin has changed.
you will have to spoof the player in tab to be a fake player
Wouldnt it just be easier to remove the player list all together?
And just have a custom one
if it's a bespoke plugin sure
hey guys, i want to make custom mobs but im running into an issue where i cant make 2 line custom display names, any ideas on how to do this?
Zombie\n❤️20/20 something like this
the nametag cannot have more than one line
if you want more lines, mount a text display to the entity in question
a text display?
yes
ill look into it, thank you <3
guys im having problems on my mythiccmobs, it does no damage to players that has armors, any solution?
Remove armor, seems obvious
why if i use LegacyComponentSerializer.legacyAmpersand().deserialize, the displayname/lore is all on &o
It’s also shown in the Material javadocs
that's smart as hell (definitely not using armors as a help to fight the bosses)
Lol
Because that’s what legacy ampersand means
if you want §, use section() instead
i want use hex color with like &#a3a3a3, the legacy ampersand work, but if you put it in the meta of an item, it will have an Italic format
i dont want the Italic format and i dont know how to fix this
i fixed
yo how would I go about having a trapdoor be immune from redstone input? Like so that it can only be opened/closed by a player and not by any redstone?
Listen to either the redstone or physics event and cancel them for the trapdoor
Idk if the redstone event itself is enough
can you be more specific with "the redstone or physics event"
already listening to BlockRedstoneEvent which isnt cancellable, but I can set the current to 0, but that doesnt do it
if i store a stat in the player's pdc, will i be able to make a leaderboard later for that stat
not easily
k
if you have a list of players, sure
And they are online
but honestly just use a DB
atp i'd just make the whole thing without pdc
Yea, the offline bits are the annoying part
i was asking to skip the hassle of a db
Or you use a bit of NMS to access the pdc for offline players
Sadly no
I’ve been meaning to do an expanded offline player api
????????whereami
hmm cant really use that since I need to access properties of the block that's being triggered on, not the one that triggered the event
?????????????????????????????????whereami
But effort :(
Pretty sure you can
please enlighten me
I believe getBlock will be the changed block
how do people know how different minecraft versions support which resource pack namespaces
is it in a certain changelog or something??
one version the server resource pack works and voilla 1.21.4 nothing works anymore
.4 changed quite a bit of things
yeahhhh
there are converter scripts out there but they aren't perfect
i am yet to see one that works as intended
some of them straight up change the mcpack format file like thank you mr🤣
namespaces? wdym
I just stay up to date with snapshots and read their resource pack changes
then add those features to my pack compiler accordingly
like item is changed to items apparently?
you mean item definitions?
i meant the namespaces too. like alongside minecraft namespace you could have had another namespace i dont think you can do that anymore
you've always been able to do that
tbh i am pretty clueless in resource packs
but i try😭 😂
good, good
i think i can just decompress the jar file of the version and see how the resource pack folder has changed?
github is having issues again 
unicorn my beloved (actually, puma is much better)
nice
good idea, ty pookie
how do i get a list of all players connected to the proxy, from spigot? I have rabbitmq as a message broker, so I could maybe send a request and then reply from the proxy. For that approach I'd need to use some operation ids, so it won't give me the reply to another request. Is there something built-in in rabbitmq for that?
hey so im still stuck on what you ment by this, can you explain what it means to hide a key?
?pmc
PlayerList specifically
oh thats also supported be velocity then, right?
yeah
public class ItemWrapper {
private static final NamespacedKey SPECIAL_VALUE_KEY = new NamespacedKey(MyPlugin.getInstance(), "special_value");
private final ItemStack itemStack;
public ItemWrapper(ItemStack itemStack) {
this.itemStack = itemStack;
}
public String setSpecialValue(String value) {
ItemMeta itemMeta = itemStack.getItemMeta();
var container = itemMeta.getPersistentDataContainer();
return container.set(SPECIAL_VALUE_KEY , PersistentDataType.STRING, value);
}
public String getSpecialValue() {
ItemMeta itemMeta = itemStack.getItemMeta();
var container = itemMeta.getPersistentDataContainer();
return container.get(SPECIAL_VALUE_KEY , PersistentDataType.STRING);
}
}
ItemWrapper wrapper = new ItemWrapper(itemStack);
wrapper.setSpecialValue("Hello world!");
String specialValue = wrapper.getSpecialValue();
Kind of a rough example, but gives you an idea of what I mean by "hidden key". The API user doesn't ever need to pass in an instance of your plugin, or a key. It just knows that it can either get or set the special value on that item. Doesn't know how it gets or sets it, just that it can
The key is "hidden" because the API doesn't know about it
Again, rough example, you could forego the ItemWrapper entirely and just use a static utility method that takes in an ItemStack if you really wanted. It's up to you how you want to design the API. The overall idea though is that you never need to say "I need the key found at plugin:special_value", you just say "I want the special value"
that does look cool. do i just remove rabbitmq then?
or do pluginmessasges allow for usage outside of spigot?
like is there some extracted library for stand-alone usage?
plugin message is a minecraft packet
at that point just use rabbitmq or any other message broker
So id need to reimplement parts of a server for a website that displays all online players?
alright ty
what is currently the best and easiest plugin to create a team with all the standard features (customize chat format, etc.) and have api?
i need just simple team
system
oh i see, you just set the key in the class itself, that makes sense
vanilla system not has confortable api
It works fine
and as far as I remember it doesn't have many of the settings that most plugins have on the team.
What settings are you after
which teams also have
Yeah they can do that too
prefix,sufix
teams have friendly fire settings
yes
oh
Yes. This is the idea of encapsulation and implementation details. The users of your library (whether it's your or someone else) should not care if that data is stored in NBT, in memory, or in a file in any specific format. It doesn't matter. What matters is that it exists and that you can get and set it
then ok
public interface Team {
int getMaximumPlayers();
boolean isFull();
void addPlayer(UUID playerId);
void removePlayer(UUID playerId);
Set<UUID> getTeamMembers();
UUID getOwner();
Set<Component<?>> getTeamComponents();
boolean contains(UUID playerId);
void addComponent(Component<?> component);
void removeComponent(Component<?> component);
Component<?> getComponent(String componentId);
// Disregard
Context<? extends ContextType> setTurnIndex(int turn);
int getTurnIndexContext();
}```
Never used the teams api and this is prolly ass but the components bit helps in the regard of extra team related features
Component<T> whar
My own component obj
ECS moment?
I can't decide. So the vanilla team system sucks?
I just use them more as compositional functions than anything else
Cuz maybe I want to handle my teams in a way that vanilla doesn't exactly work for
Most cases you're probably fine using vanilla teams tho
but you not use vanille system inside?
no
why
lol
there isn't a need to, unless doing collision, name tag or glowing colour stuff
who said the vanilla team api was good?
nobody
Worst bit of spigot api has to be the conversations section imo
.
it's a clusterfuck of legacy shit and everything being stringified
Works fine does not mean good
uh
It can do most of the basic things
This is like the only reason you shouldn't use teams api, however like everyone has been saying it's fine, I just use my own teams object cuz relying on some other api kinda sucks
but as Rad said it's full of legacy text and such
lazy read docks heh?
if you don't need any of this, there's also no need to use it
I mean with my components bit, I could just as easily handle all the things vanilla teams do
Internally for my use case tho, I found it easier to just handle my own objects
ay?
kek wild spigoteers today
after what you just said no
i need a sanity check, what's a reasonable amount of packets per second the server should be sending a player? looking at my numbers i seem to be at triple digits for no apparent reason
I mean that depends on what's going on
but yeah it could do that if you have a bunch of things visible
Also depends which packets you're sending. Not all packets are created equal
A chunk data packet is going to be magnitudes larger than a simple teleport packet
is there a way to differentiate between when a mob is spawned naturally and when they were spawned with commands or a spawner (unnaturally)
yeah i guess i'll just have to take a look at the traffic and see which packets are being sent at what rates
can you replace a word with a bitmap in a resource pack?
or basically just replace a word
bruh I decided to do custom menus with nms
and for some reason every slot acts as one
I can put an item into any slot in the gui and it'll fill the entire gui
Well done!?
did you put the same slot in all the indices?
No
I'm just wrapping it
@Override
protected Slot addSlot(Slot slot) {
return super.addSlot(new CustomSlot(slot));
}
plug it into an ide and throw breakpoints at it until it makes sense i suppose
still haven't figured out if I'm gonna be doing all the slot logic with an event system or just a million interfaces
oh yeah the index is
ug
not set yet
idk why you're doing it with server internals though
Pain in the ass vs compatible across multiple versions 
it's for work I don't really care
90% of our menus need all the fancy quirks of "you can only place X custom item here"
and it needs shift click, number keys etc support
the bukkit api is kind of ass for custom menu's
it's much more an inventory api than a menu api
which, well, it is
Exactly
Yeah, so is vanilla lol
Not really
weeeellll
AbstractContainerMenu uses slots which have fancy methods like mayPlace
vanilla has a distinction between a container, an inventory, and a menu
I can easily yeet my filter there and it'll just work
I mean, "works"
there's also callbacks for when players put things in places
for which in bukkit you have to reimplement the whole shift-click quickmove logic
you do need to reimpl that entire thing for most menus yeah
and if you do it wrong people can put/take items from it
there was a project at one point that implemented completely packet based menus, where the items never reached the server, being in principle exploit proof
but i think maintenance turned out to be untenable
I can just let mojank do all the maintenance for me
there's lots of those
yeah ones that let you click buttons
but shift clicks and actual container mechanics i'm not sure if i've seen apart from that one
.
the spawn event and iirc the entity itself record a SpawnReason
hm. i see.
oh god I have to override doClick to pass context
(if it's a drop / left / right / whatever)
If I’m storing player IDs, would opening the server to bedrock crossplay break it?
For some reason whenever my plugin writes over a file, the file itself doesn't visually update, but the plugin acts as if it has and can further read data from an invisible updated file. Is this a bug?
What kind of file?
a .json file
Could be that the data is being updated in memory but not being flushed
I'm using writer.flush() and writer.close() though
or is that not the way to do it?
okay, I just copy pasted the file and it visually updated, so everything's working fine its just some weird visual bug with either vscode (which i use to look at json files) or something
at that point just install a ignite and inject a mixin instead
way easier than wrapping around mojang's code
though I don't feel like all of this is worth the effort
I'm spawning a skeleton in daylight and setting it to setInvulnerable(true) and adding FIRE_RESISTANCE, but it still shows the burning animation in sunlight (even though it doesn't take damage). How can I completely remove the fire animation as well
that doClick method looks like a maintainability nightmare
you'll have to keep up with mojang changes
does Entity#setVisualFire work
Turns out if you don’t register the listener, Plugin just doesn’t care. Like… at all 😅
well, of course
I wasted 1 hour of my time
First thing I always think of when a listener class doesn't work... "did I even register it?"
96% of the time... no I did not
could be made into an IDE inspection tbh
Haha, exactly 😄 When I forget to register the listener, it feels like the plugin is just like I dont care 😅. Ive learned to not forget it now, so problem solved!
ya'll, why is this weird hand thing happening only the first time the block is broken? After the cancel it works just fine
I'm using the minecraft:block_break_speed attribute to change mining speed fyi
Probably because you are changing the break speed when they are already mining
it's changed before they begin mining, should've specified
When
it just checks if you're looking at a minable block and calculates the break speed (uses a multiplier of 0.25 in this case)
It looks like the animation you get when you switch what item you’re holding
Are you doing anything to the held item
am I doing that? No, the item stays the same as far as I'm aware, though there's like 167 plugins or something on here
I can check if the item changes
nope @young knoll
The items stay the same
if you're using PDC then it is already saved across restarts
well, as long as the entity wasn't despawned that is
really?
wait idk if i did the PDC part right
persistent data container
Hello guys!
Please tell me, how to clone this repo? I don't see anything like ".git" url
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse
there's a clone button at the left tab
ok so im getting this error when trying to import my damageplugin, but not my menusystem, can anyone explain why this is, cuz ive been struggling with this for a couple hours by now
I just have an error by adding my texture pack
It says : Missing mcmeta data Invalid resource pack
Does your pack have a pack.mcmeta
can i send you a private message?
and yes
Also how can I get Bukkit/CraftBukkit submodules?
Should I use CraftBukkit repo?
?nms
usually it's easier to just get the source via BuildTools
it clones all the necessary repositories
but what are you trying to do? Modify a spigot server?
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
There
can you send your resource pack here
In here no i can send it private
okay
is there any way, to "detect" double jump? i want to give fly to players if they double jump
Hm? Just allow them to fly?
A client asked me to do it this way
I don’t understand
You want them to fly when they use the fly input
But you don’t just want to allow they to fly
Well your only option would be the input event then
And checking for the player pressing space, releasing it, and then pressing it again shortly after
https://hub.spigotmc.org/jira/browse/SPIGOT-8044 chat is 0 positive
NaN
-0 == +0
true
I bet that returns false in JavaScript
it does not
Yay JavaScripts logic makes sense for once
yeah but does .1 + .2 == .3
Best I can do is .29999999999999999999999
.1 + .2 == -NaN
0.30000000000000004.com my beloved
is 0.1f + 0.2f == 0.3 tho
who knows
jshell> 0.1f + 0.2f == 0.3
$1 ==> false
kotlin throws an error here ```
0.1f + 0.2f == 0.3
error: operator '==' cannot be applied to 'Float' and 'Double'
0.1f + 0.2f == 0.3
🦶🔫
Foot gun
PlayerInputEvent only exist on recent versions?
Does one of you have an idea why I can't spawn a block display aligned? It always deviates slightly from my specified values
When I spawn the block display with per command with the exact same values it spawns perfectly aligned but not when I spawn it with the plugin
show the code in question and the command
is there a way to determine blocks that can hold attachable blocks like torches, tripwire hooks etc
if I have Block I need to know if can hold those items
don't ask me why but I've made a script to play cookie clicker for me
and now I'm slowly going down the rabbit hole of trying to figure out the most optimal building investment strat to get cookies as fast as possible
Yes. I want modify 1.6.4 spigot
?howold 1.6.4
howoldisminecraft.today/1.6.4
Minecraft 1.6.4 is 11 years, 6 months old.
1.6 was horses
1.5 redstone update
I started playing in 1.6, so I don't know what minecraft without horses is
anyway buildtools wont work below 1.8
you'd have to find an archive somewhere for below
though if youre running 1.6.4 already I assume you have those jars somewhere
I ended up making another method for that PR, however I am not sure whether I should return null or an empty array
Now it's for hoppers?
Are we sure this API is actually useful
canPlaceItem seems fine but I'm really sceptical about the other method
I changed it to accept a BlockFace parameter since a more useful version of the method exists in IWorldInventory which tells you from where an item can be pulled from, however I don't see any other utility for the method other than replicating hopper behavior for whatever reason so I am honestly fine with removing both (the canTakeItem method and getSlotsFor method. that is)
I feel like I need to see a plugin actually using these methods to do something sensible
I have jars , but I think original sources would be better 
I have already copied all up to 6ba479d5 commit from Spigot repo, but now I need to get CraftBukkit/Bukkit folders
So, can I just copy the CraftBukkit repo the same way I did with the Spigot repo?
Isn't that how BuildTools works?
-# sorry for bad eng
Yes
I feel like anyone trying to replicate hopper behavior would straight out use NMS anyway for other methods like tryMoveItemIntoContainer, and I personally can't think of any use so I'll just remove canTakeItem/getSlotsFor. canPlaceItem definitely is the more useful method for inventory checks
Thanks!
Sounds fine to me, I can much easier see the use case for that method
I still added a BlockFace parameter to the method tho, since some inventories using IWorldInventory#canPlaceItemThroughFace (i.e. shulker boxes and composters) do not delegate to Inventory#canPlaceItem for whatever reason (I imagine Mojang just hasn't gotten into refactoring that code)
I found out what my mistake was, the display spawned with the rotation of the player head. Was simple to fix but ty very much
--- next question ---
does anyone have a tip how to track a left click on an interaction entity?
Damage event
Can a minecraft server have a few texture packs?
In modern versions, yes
Ah thanks
so how modern we talkin?
1.20.5 I think
DARTHMANGO moment
?whereami
bro this has nothing to do with paper XD
Does anyone know if there is a way to prevent a player from being pushed out of a block he's standing in?
no no , seeing your presence in real time is eye opening
🔥 🔥
look at #help-server There was a guy using paper 2 years before my message 😂 missed chance to become a legend
LMAO
💀
anyway, Do you know if there is a way to prevent a player from being pushed out of a block he's standing in?
Yes
Place another 4 blocks on the 4 sides

