#help-development
1 messages · Page 851 of 1
a gamemode with one block where you break it and it regens and stuff
I mean postgres also has json data types :trollface:
Oh sounds like skyblock without island
exactly
Guess i‘ll setup a server now and then play it until I‘m bored
ferretdb my beloved 😎
YamlConfiguration my beloved 
Can you just store arbitrary ints in blocks persistently like this?
if ((block.getState() instanceof TileState) && (block.getType() == Material.BIRCH_SIGN)) {
NamespacedKey key = new NamespacedKey(Chunktycoon.getInstance(), "last_timestamp");
TileState tileState = (TileState) block.getState();
PersistentDataContainer container = tileState.getPersistentDataContainer();
Integer now = (int) Math.floor((System.currentTimeMillis() / 1000L) - 1704067200);
Integer lastTimestamp = container.get(key, PersistentDataType.INTEGER);
if ((lastTimestamp == null)) {
player.sendMessage("No last timestamp found, setting to now");
lastTimestamp = now;
}
Integer difference = now - lastTimestamp;
player.sendMessage("Last check: " + String.valueOf(lastTimestamp));
player.sendMessage("Seconds since last check: " + String.valueOf(difference));
player.sendMessage("Time since Jan 1st 2024: " + String.valueOf(now));
container.set(key, PersistentDataType.INTEGER, now);
player.sendMessage("Setting the sign's data to " + String.valueOf(now));
}
}
For some reason, the container.set() doesn't seem to work?
you need to update the tilestate
Is there a way to remove the item description of armor trims? like, this 'can be applied to' etc.?
declaration: package: org.bukkit.inventory, enum: ItemFlag
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
ik, but there's nothing about it
It's the description of the actual trim (while not being on an armor) I want to remove
sad
usually the POTION_EFFECTS flag is what hides everything that's not listed separately
how do i stop entities from getting their helmet broken from the sunlight
what
That's a thing?
its not
if you find out let me know, as far as I know it's 100% hardcoded into the game
it is a thing
no way
but only for mobs that burn up in daytime
well its obv server sided
I had no idea that was a thing
I haven't even added custom entities to my lib yet
Blocks? Yes. Items? Yes. Entities? No.
if it helps I am pretty sure it's modifying the helmet's durability directly, entirely bypassing the mob, so I'd look there
sounds correct to me
I mean it's pretty obvious behavior
problem: some mobs spawn with random armor, and survive into daytime and may even never die if the chunk never unloads
solution: break the helmet
kinda weird. a helmet on the ground is immune to sun but once a zombie wears it, now the helmet doesn't like the sun anymore lol
what
mobs litearally
despawn automatically
if you afk at your base for a few hours and helmets didn't break there is a decent chance when you went outside you'd be greeted by nothing but a mob-capped population of helmeted enemies
no cuz they despawn plus i doubt it takes 2 mins for the helmet to break
i had tons of zombies w helmets never seen it break once
how long does it take
They can pickup some random item like rotten flesh and never despawn I think
mobs don't depawn if the chunks remain
ye
they will be around for as long as the chunks are loaded
u said if u unload the chunk lol
I specifically said if you afk at your base
it's the first 6 words of the sentence I wrote
oh then you're just plain illiterate because I specifically said they don't die if the chunk doesn't unload in my previous statement
are u stupid
uh i tried setting helmet meta to unbreakable
it doesn't seem to work
yep
fire invulnerability doesn't help, unbreakable doesn't help
as far as I know you can't prevent the damage
my favorite food
iirc the helmets break even if the mob is invulnerable
You could try looping through the entitys and resetting took damage on the helmet
But I don't know how efficient that would be
well, killed the chat lmao
better than killing the cat!
jep :)
DON'T KILL CATS
I remember that one time you sent a photo of a lot of meat and you said you had to throw it all out because you bought to much and it didn't fit in your fridge so you didn't close it properly and it went bad
mfnalex's life is like seeing a trainwreck continuously developing on discord
what is entitycombustevent btw
Well I assume it's when an entity catches fire from the sun
Maybe not from the sun but in general
?tas
oh so its fired if entity catches fire
ah
is that... next to the an electrical board?
p sure it is
is there a helmet break event
yknow all of the sudden I am starting to understand some of the holes I've hard to repair and paint over from previous tenants when I was doing property management
or armor break event
EntityDamageItemEvent exists (paper only tho)
Ah
wtf is ArmorBreakEvent
An edge case of EntityDamageItemEvent lol
ah no, it was ArmorEquipEvent that I had in mind
There's a PlayerItemDamageEvent in Spigot but well that's only for players
declaration: package: org.bukkit.event.player, class: PlayerItemDamageEvent
so ig there's no way to stop mobs from getting their helmets broken by the sun
I'd take a look at the nms
See where it damages the helmets and if you can do anything about it
Hi i want to read out a couple of locations out of my locations.yml and spawn some villagers there but only if they arend there already. Any idea how to do that?
locations.yml: https://pastebin.com/nvL0nHve
i tried to do it like this: https://pastebin.com/dc21qZk2
But well, it also supports breaking https://hub.jeff-media.com/javadocs/armorequipevent/com/jeff_media/armorequipevent/ArmorEquipEvent.EquipMethod.html#BROKE but I do not know if it also works for entities - you'd have to try it out in that case
Actually no, it's a playerevent so that makes no sense

Does making it unbreakable not work
you back from your trip?
yo people i got a question
these are the dependancies I have in my core gradle module
but when i implement that module into other ones i need for somereason to add it again in there
if i really want it
is there a workaround for that
Instead of the java plugin use java-library
in the core module only right?
Ye
tysm ❤️
ok now apparently all those are shadowed w/ shadowJar on the other modules (the core one doesn't have shadowJar)
even the compileOnly ones
Is there a way to listen for when a vanilla command is executed?
The docs say PlayerPreprocessCommand shouldnt be ussed for logic so im wondering if theres a different way.
(Or if someone knows whether there's a TeamChangeEvent of some sort that would be even better becauses thats what im ultimately looking for)
I dont want to override it though, i want to extend it
I want the original logic to keep happening
Basically, im just trying to do stuff when a team gets removed, or when members get added or removed
Not sure how bad it is to use the preprocess event for that, im scheduling a task a tick later when the calculations are done and then do stuff with the team
how to make display name not italic
Give it a colour - white if you'd like
If you're using components you need to set italic to false
Wait spigot doesn't have that yet
You're using paper aren't you 😔
cardboard user? (im talking about paper btw)
No I use nms for components
I just forget their not fully integrated sometimes because I spent so long making em that way in my library
ohh
why don't you use the lombok plugin?
i use the IDE plugin if that matters
or do you mean like a gradle plugin (is there one?)
the gradle plugin. IIRC that's the encouraged way
plugins {
id("io.freefair.lombok") version "8.4"
}
instead of the two dependencies
yea
yeah it's kinda easy to oversee because it's just hidden behind that link. at first glance one only sees the dependency way
true
can i define a value in the core module and use it in other ones
like a string or smth
in source code or in your build files?
I just want to define the version of adventure platform globally instead of definingit everywhere
and some other dependancies too
i'd use a buildSrc script
i tried using ext but wasn't really helpful
e.g. you declare a buildSrc script for adventure, like I did for bukkit here
https://github.com/mfnalex/PAPI-Replace/blob/master/buildSrc/src/main/groovy/papi-replace-spigot-dependency.gradle
And then you include it as plugin: https://github.com/mfnalex/PAPI-Replace/blob/master/core/build.gradle#L5
the buildSrc needs a build file itself, either kotlin-dsl or groovy plugin, but that's just one line: https://github.com/mfnalex/PAPI-Replace/blob/master/buildSrc/build.gradle
hmm that seems very intersting o.O
if you use kotlin, you gotta use this for the buildSrc build.gradle.kts: https://github.com/mfnalex/cesspool/blob/master/buildSrc/build.gradle.kts
well
i still dont get how would that define a value because all that will do is add dependancies
because every platfrom has dependencies yk
you can just do this and include it in all modules where you need it
val whatever = "asd"
is this fine?
im back
are you a human or a donkey
how do I check if an item can break a block?
by trying
im jk
let me look it up for you
you can break every block with every item, except bedrock
I mean, check if an item can break a block for it to drop
idk how describe
doesn't nms have a method for that
Block#isPreferredTool(ItemStack)
but not sure what that returns for blocks that have different possibilities... e.g. dirt would also drop using any item, but probably only returns true for shovels
you could also check Block#getDrops(ItemStack) and see if it's empty
hmm
that works???
why not?
never knew that's a thing
well i only use it once per module yet i use it in all of them
thats why it would be kinda useful lmao
if you only wanna declare a property you can also just use properties.gradle
you mean settings.gradle?
in here you do compileOnly and test even though you dont have the java plugin
how
oh its in your build.gradle
yeah but that's an oversight, it only belongs into java-conventions https://github.com/mfnalex/PAPI-Replace/blob/master/buildSrc/src/main/groovy/papi-replace-java-conventions.gradle
so this is what i made
and here is my mutuals.gradle
my buildSrc/build.gradle
thats what heppens when i use it
its weirdddddddddddddd
yk what doesnt matter
Anyone know why FastBoard isn't able to register events properly?
that means you didnt shade it in properly
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>fr.mrmicky.fastboard</pattern>
<!-- Replace 'com.yourpackage' with the package of your plugin ! -->
<shadedPattern>com.yourpackage.fastboard</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
I put this in my pom based off the github maven import thing so is there something wrong with it?
*I also added the dependency
Show the dependency
<dependency>
<groupId>fr.mrmicky</groupId>
<artifactId>fastboard</artifactId>
<version>2.0.2</version> <!-- Make sure to use the correct version -->
</dependency>
also fix that shaded pattern
oh shoot didnt see that
well that was not the issue anyway, it's most likely the code
It is the issue
If the shading had worked the error would show the relocated package
I mean I just edited it and it still doesnt work
Did you repackage your jar
the shading worked the first time, just not to the wanted package
also make sure to use the jar without a prefix and suffix
yeah
yeah it doesnt seem like changing the shadedPattern worked
then this probably should work
Still getting the same error sadly
How did you package your jar
I recommend 'clean package'
Im using eclipse so all I do is export it
oh boy
lmao
I am
in buildSrc it needs to be in ext { }
But then if I wasn't using maven how am I using the spigot API?
i did something cooler
you gotta use mvn commands to package your jar
just because it works fine in your IDE doesn't mean its not going to reek havock on the end jar
It recognizes dependency and spigot is provided on runtime, so it works ig
please use mvn package
and what?
i created a build.gradle file in the root of the project and did this
which does work just fine
yeah sure that's basically the same except for all modules
I would rather create a adventure-depencency.gradle file in buildSrc and include that as plugin whenever needed
Scoreboard sb = Bukkit.getScoreboardManager().getMainScoreboard();
String prefix = ChatColor.translateAlternateColorCodes('&', "&c[TNT] ");
Team t = sb.getTeam("TNT");
if (t == null)
t = sb.registerNewTeam("TNT");
t.setPrefix(prefix);
t.setSuffix(ChatColor.RESET + " ");
if(t.hasEntry(player.getName())) {
t.removeEntry(player.getName());
}
t.addEntry(player.getName());
}
public static void getNormalTeam(Player player) {
Scoreboard sb = Bukkit.getScoreboardManager().getMainScoreboard();
String prefix = ChatColor.translateAlternateColorCodes('&', "&7");
Team t = sb.getTeam("Players");
if (t == null)
t = sb.registerNewTeam("Players");
t.setPrefix(prefix);
t.setSuffix(ChatColor.RESET + " ");
if(t.hasEntry(player.getName())) {
t.removeEntry(player.getName());
}
t.addEntry(player.getName());
}```
Hello! im doing a TNTTag plugin and im trying to set the nametag and tablist prefix of the player like this BUT its not like updating when i want to
for example when a player HITS another player
it only updates if a player leaves and rejoins
and since im doing a competitive gamemode i cant really do
p.hidePlayer
p.ShowPlayer
for everybody
i tried with protocol lib but it seems there is still something im lacking any1 can tell me?
im gonna send another message with what i did in protocol lib
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
// Set the team name
packet.getStrings().write(0, "TNT");
// Set the team display name
packet.getStrings().write(1, ChatColor.translateAlternateColorCodes('&', "&c[TNT] "));
// Set the team prefix
packet.getStrings().write(2, ChatColor.translateAlternateColorCodes('&', "&c[TNT] "));
// Set the team suffix
packet.getStrings().write(3, ChatColor.RESET + " ");
Set<String> teamMembers = t.getEntries();
// Set the team members
packet.getSpecificModifier(Collection.class).write(0, teamMembers);
// Send the packet to the player
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
ProtocolLibrary.getProtocolManager().sendServerPacket(onlinePlayer, packet);
}```
public void onInteract(PlayerInteractEvent event) {
if (event.getPlayer().hasPermission("griefalert.use")) {
if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && event.getHand() == EquipmentSlot.HAND) {
Player player = event.getPlayer();
if (!player.isSneaking()) {
ItemStack item = player.getInventory().getItemInMainHand();
NamespacedKey pkey = new NamespacedKey(GriefAlert3.getInstance(), "mode");
if(item.getItemMeta() != null) {
if (item.getItemMeta().getPersistentDataContainer().has(pkey, PersistentDataType.INTEGER)) {
Integer type = item.getItemMeta().getPersistentDataContainer().get(pkey, PersistentDataType.INTEGER);
if (type == 2) {
Block clickedBlock = event.getClickedBlock();
BlockFace blockFace = event.getBlockFace();
if (clickedBlock != null) {
Block block = clickedBlock.getRelative(blockFace);
Location blockLocation = block.getLocation();
if (AlertMap.getAlertByLocation(blockLocation) != null) {
Integer alertNum = AlertMap.getAlertByLocation(blockLocation);
player.performCommand("ga fix " + alertNum);
} else {
player.sendMessage("§eNo alert found at this location");
}
}
}
}
}
}
}
}
}``` anyone know why this event is firing twice?
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
Can you formulate a delete query in SQLite with less than symbols like so?
DELETE FROM "current_offers" WHERE "last_refresh" <= ? couldn't find anything simple exampling something like this online
nvm it works!
Guys, I have a problem here, could someone help me?
What happens is that I have a plugin here and I use ArmorStands to do some things, but I need that when the server restarts it picks up the armorStands of the world checks if it has a certain item with NBT and if so it needs to "start" that armorStands, but the problem is that it is not finding the ArmorStands, but I have 2 armorStands in my world with this item NBT
public void onChuckEvent(ChunkLoadEvent event){
Chunk chunk = event.getChunk();
Common.broadcast("chunk is Loaded / "+chunk.isLoaded());
Common.runLaterAsync(1, () -> {
for(World world : Bukkit.getWorlds()){
for(Entity entity : world.getEntities()) {
Common.broadcast("is instanceOf " + (entity instanceof ArmorStand));
Common.broadcast("entity" + entity.getName() + entity.getLocation());
if (!(entity instanceof ArmorStand armorStand)) return;
ItemStack item = armorStand.getItemInHand();
Common.broadcast("" + EntityMinionNBT.hasNBT(new NBTItem(item)));
if (!EntityMinionNBT.hasNBT(new NBTItem(item))) return;
EntityMinion minion = EntityMinionNBT.getEntityMinion(item);
AutoFarm.getArmorStandManager().startEntityArmor(
minion,
item,
armorStand
);
}
}
});
}```
I don't think Armor stands count to 'living' entities
why are you checking the entities of all loaded worlds instead of just checking the chunk's entities?
I put this in now, before it was 'getEntities()'
also why do you return if the first entity is not an armorstand?
you should continue instead of returning
I've fixed the code
and as said, check event.getChunk().getEntities() instead of looping over all worlds' entities
I did it this way and it didn't come up either, so I did this search for worlds
I already told you what the issue is
you're returning as soon as you encounter one entity that is not an armorstand
don't do that
I don't understand, I have a list with 10 different entities, if the entity it's passing at the moment isn't armorStands it moves on to the next one and checks, doesn't it?
Best way to have mobs that despawn if the server dies or is stopped?
Basically want to have a mob linked to a player, and if the player leaves, or the server dies/restarts, it'll despawn.
Obviously for the linking, just store it and kill/spawn on join/leave, but if the server gets killed, the mob will remain right?
how do I create a link and where for a resource pack so that it works as an argument to Player#setResourcePack and .json 3d models are supported in resource packs or only regular textures?
no. return ends the whole method
you must continue instead of returning
continue; I think goes to the next loop cycle, break; breaks out of the loop but stays in method and return; just ends the method
You need to host the resourcepack somewhere and have a working download link to it
yes
and yes resourcepacks can have 3d models as long as you follow the correct format
also it's limited to certain things
Common.broadcast("is instanceOf " + (entity instanceof ArmorStand));
Common.broadcast("entity" + entity.getName() + entity.getLocation());
if (entity instanceof ArmorStand armorStand) {
ItemStack item = armorStand.getItemInHand();
Common.broadcast("" + EntityMinionNBT.hasNBT(new NBTItem(item)));
if (EntityMinionNBT.hasNBT(new NBTItem(item))) {
EntityMinion minion = EntityMinionNBT.getEntityMinion(item);
AutoFarm.getArmorStandManager().startEntityArmor(
minion,
item,
armorStand
);
}
}
}```
oh, is that it?
I copied textures and models from my mod for both the block and the item of my json models, how do I use them in the game, I do not overwrite the texture of an existing item, can I create a new itemstack and overlay the json model from the texture pack on it?
Use custom model data
same way, didn't find the armorstands
So when are you running that
I hope you aren't doing it on chunk load
how does Furnace#setBurnTime(short) work? Usually you get a float that is from 1 to 0 or in case of burn time, you can set the max, but I have no idea what this short is
suppose i have assets/minecraft/models/itemjson { "parent": "minecraft:models/block/butcher_axe", "display": { "firstperson_righthand": { "translation": [0, 5, 0], "scale": [1.25, 1.25, 1.25] } } } May I add
"overrides": [
{
"predicate": {
"custom_model_data": 1
},
"model": "minecraft:item/butcher_axe"
}
]
``` and use ```java
ItemStack item = new ItemStack(Material.DIAMOND_AXE);
ItemMeta meta = item.getItemMeta();
meta.setCustomModelData(1);```
I check if the chunk is loaded, if so I run the command I sent, but it doesn't find the armorStands, it finds several entities, but not the armor.
BurnTime: Number of ticks left before the current fuel runs out.
- Minecraft wiki
will it work?
?tas
hmm, but doesn't that mean that whenever I set the time the little fire in the furnace container will go up to maxx?
I think the problem was the return;, I put continue; and it started generating some errors here, so now it's working, thanks!!!
where did I fuck my maths up
idk what the medical condition is to describe me
this is getting out of hands
yeah not a medical condition
??? furnaces are causing too many questions
It doesn't work for me. are there any logs that will tell me what went wrong and where to get them from?
You could try checking the client logs
Also don't use the Minecraft namespace for your model
There are no errors other than this one
Looks like it failed to read the resource pack zip
and you're pirating the game
._.
I hope they won't ban me like they did on neoforge)
what could be the reason and how could it be fixed?
cool how running an acf command with an unknown offline player completely freezes the server for like 5 seconds
get offline player network request be like;
acf-bukkit or acf-paper?
huh weird
yes
I just realized right now that I've been playing with 8 java all this time
at 1.20.4
How can I hide "Projectile: [Normal Arrow]"
that doesnt look like it's from vanilla?
i think it might be
damn, they added even that?
that is not vanilla 😭
looks a bit different for me, but yeah
Try the hide flags
could try ItemFlag.HIDE_POTION_EFFECTS
okey
Is there any easy way to loop through all blocks in a radius of 10 blocks of a player's location?
a couple of for loops should do it
ItemFlag.HIDE_ITEM_SPECFICS ?
Did you try tjat ?
oh paper only?
kekw
When will it be deleted?
probably never, need to keep that legacy compatability
why tho
what's the advantage of deleting it
what?
does somebody know why this doesn't work?
player.setAbsorptionAmount(event.getDamage());
}```
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
ok, sry
better naming, but that's about it, could probably slap it with ApiStatus.OBSELETE or Deprecated and rename it if it was really that necessary
oops, just found out what it was...
you'll have to set the absorption max amount
E.g.
final AttributeInstance maxAbsorption = player.getAttribute(Attribute.GENERIC_MAX_ABSORPTION);
maxAbsorption.setBaseValue(Math.max(maxAbsorption.getBaseValue(), event.getDamage()));
player.setAbsorptionAmount(event.getDamage());
its like max health
you don't magically get to give a player more health than they can maximally have
Hello guys, I was messing around with TabCompleteResponse from API, I'm just wondering why does it return ALL spigot commands but not BungeeCord commands, what's the sense?
(BungeeCord)
Hey, I am having a hard time extinguishing a player when they are on fire. My plugin has an ability where the player spawns fire around them when they walk, but when the power is disabled, the player needs to be extinguished so they don't burn.
I have tried canceling the EntityCombustEvent, and I have tried running delayed tasks to set fire ticks to 0.
I currently add fire resistance, but due to fire ticks, they can be on fire for sometimes more than 10 seconds after the power ends.
TabCompleteResponseEvent ?
Yes
Is there a way to set food for players to more than 20?
No wait
I actually need to remove some suggestions from 1.13 and up using TabCompleteResponse
this one
Yep
Use the API - TabCompleteResponseEvent
Doesn't work for what I need
what isnt wortking
I need to remove those commands
TabCompleteResponseEvent.getSuggestions().remove("bungee");
doubt will work that easy
well you're wrong
in fact, it doesn't
sorry those initial completes are from the Commands packet
simply remove permissions or disabble the commands in config.yml
i really need to remove them using a packet or something else
just curious, why tabcompleteresponse returns spigot list? 🤔
if you dont want people using the commands, disable them
dont just hide them, that does nothing
already did
but still, i want to hide them
how did you disable them
that doesn't matter
by cancelling the preprocess event of course :^)
it's bungeecord
it does matter, because if you disabled them by removing permission or disabling in config.yml they wont appear
okay but what if i check for permissions?
i can't simply kill those for normal players, administrator need other commands
it's a joke
take the permission away from normal players
Why add your own permission to something that already has a permission
why does this return backend commands but not bungeecord itself?
that packet should only be for argument suggestions, but its not really clear what your setup is
what setup do you need
my plugin needs to remove from tabcomplete a single command if player doesn't have the permission.
running bungeecord with 1.20 client.
bungee will already remove commands which are disabled or player has no permission
that's not what i'm asking for
tbh looking at the code above what you're doing seems quite useless
Just use a permissions plugin
i made a command with my plugin, if a player doesn't have the admin perm, poof, the command should disappear for those WITHOUT.
but still, needs to be here for administrators (tabcomplete)
i already have the logic for disabling the command
He is literally telling you
in bungee a permission is the second argument to the command constructor
If you have permission the command will appear if not it will not as long as it is setup correctly
md I think you're just wasting your time on this one
I DON'T want it to appear in TABCOMPLETE to players without a specific permission
yes, this is the default behaviour of commands in bungee which have defined a permission as the second argument to the command constructor
it disappears for those without the second argument?
have you defined a permission as the second argument to the command constructor
post the code of your command
?nocode
tbh not, because i need a custom no permission message with multiline support, not bungee basic one
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.
Command#setPermissionMessage(...) then
don't have it
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.
ah fine
sorry, understood
thank you md5
my bad
sorry, how am I supposed to assign it?
second argument to Command constructor
probably the super call in SubCommandManager
but
?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.
call it in the constructor of SubCommandManager (probably)
and delete that code above, overriding it with a blank method will obviously break it
ah i see
but now i have a different issue
as you can see, i was totally hiding the command here
now, the no permission output will popup
and what if i want both?
ask yourself why
now i can't hide the command output anymore keeping both
i really need to find another solution to this, any advice?
What
Apart from not messing up with nms, using Bungeecord api, I'm not adding useless shit as you think, I'm making my plugin 🙂
That's why most of plugins ever made suck
Useful comments once more from purp my goodness
Asking help here it's the worst idea I ever thought

Because you all complain other ppl work
I think that's your faulty ego
Continue talking, I'll be sure to hear your useless opinion, bye
I mean, you can have whatever opinion you want
spewing the toxic garbage you consider a valid text message in spigots discord does not seem like a nice thing to do
Wtf why disrespect other people work
Man I wanted to simply fully hide a command and fully show on the other side, I call it detail attention
Wtf
no no I wasn't talking to you 😅
your issue is fine, I hope someone cal help you
how does this pertain to any ongoing discussion here
purp has just apparently been finding their lifes goal by shitting on things for no reason.
nah, you are fine 😅 I am not too familiar with the bungee command api
so I doubt I'll be of much help
Yeah I'm just messing with it to understand more of it, now I can see of tab complete is handled
I know what you are saying yes. I believe it to be pretty damn disrespectful to join a projects discord server and talk shit about it.
I am sure there are people out there that love to listen to your opinion. Talk to them. I doubt you'll find them in this discord
Anywayyy, gotta find another way or just keep it as that
hey
this method disappeared in PotionType#getByDamageValue() how can i replace it?
you can try opening a thread in the channel I think
to kinda persist your issue, so it won'T get spammed away with other peopls question
I feel like if you turn a bit to the left or right, find your rooms wall and talk to that, the wall would be more interested in your mental output than anyone else here
oh my god bomp is that you?
ban speedrun fr
hi
are you a good thing that came out of spigot
discord told me to say hi since you are new here
?ban @sterile sinew
Done. That felt good.
lol
another day, maybe they'll come back with another alt to play with
🤷♂️ who knows
did you guys see what he sent just before he was banned
how do i rembake the hipiockzles with all the gamebxomes even skybwock and bedwarbz with ebery freature the sbame
sorry did you just type something extremely stupid or am I having a stroke
its stupid yeah
Hmm, why is it that my method does not show up from the handle?
Does getHandle() actually return you the correct type?
CraftEntity implementations tend to override getHandle() and cast it to the appropriate type, otherwise it just defaults to Entity
(see literally any type of CraftEntity impl)
Hey, I need your help regarding the Minecraft package.
Not linked to spigotmc (I want to create my server from NodeJS except Java ecosystem).
Some things I checked:
- Package documentation (fields, types)
- Prismarine etc... (obsolete since 1.16.4)
I knew I had to rewrite Minecraft's gameplay logic...
The question is where can I find more detailed documentation about the packages. Like packets order/schedule?
Thanks in advance.
https://wiki.vg/Protocol documents the whole Minecraft protocol and when the packets are sent and what it expects in response
Pretty much anything and everything you need to know about how a client and server communicates will be in there
Wait, does that mean I have to add that method to each class that implements it?
Well I think OfflinePlayer's handle should actually be EntityPlayer iirc. I believe that is correct
idk. Where are you trying to call getLastLocation() from?
I'm confused
org.bukkit.OfflinePlayer? Because you can't define implementation with its own declaration
Or is there an NMS OfflinePlayer type you're trying to access?
Some things I checked:
Packet* documentation (fields, types)
The site doesn't give all the information I need.
Like the order of the packets (constraint I mentioned in my request)
That page definitely tells you the order in which packets should be sent. Although really, there are few places where order matters. Login, for instance, it matters
Also, internal packet ids are associated with each packet
The whole login process is pretty thoroughly documented there
Hmm, maybe I'm missing something then. Cause yes, I am trying to update org.bukkit.OfflinePlayer with a new method (#getLastLocation()).
I'd just need to make the interface method in Bukkit > mvn install > implement method in CraftOfflinePlayer > update anything else that is attached. Right?
Well, yeah, but you have to implement it to actually do something
You can't have CraftOfflinePlayer's getLastLocation() implementation call OfflinePlayer's getLastLocation(). It is getLastLocation()
Is that not what I have done?
Yeah there you go, that's fine
What's this then?
I was trying to fix a StackOverflowError. Originally, it was getHandle().getBukkitEntity().getLastLocation();, but looking at the other methods in CraftPlayer, I thought I should be able to access #getLastLocation() from the handle.
spigot build-tools error (1.19.4)
Oh, well getLastLocation() for a Player doesn't really make much sense. Unfortunately that's the nature of hierarchy, but I'd just say it should default to getLocation()
@Override
public Location getLastLocation() {
return getLocation();
}
Probably fine
Does that mean that I can leave HumanEntity alone then and just add the method to OfflinePlayer directly?
I guess you could impl it in CraftEntityHuman tbh
They both have getLocation() from Entity
I was looking at the chain and trying to figure out where it would fit best, but idk as I haven't messed with CB till now.
Yeah, CraftOfflinePlayer#getLastLocation() can remain implemented as you have it, then I'd just add that snippet I sent above into CraftEntityHuman
CraftPlayer will inherit it
Cool. I'll try that out real quick.
Yep, that solved the problem I was having. lol
Do you typically test /reload when you make changes to CB?
No that's fine
In cases like this, the plugin author would be responsible for null checks correct?
Is the plugin using OCB or NMS?
If so, yes, it's plugin author fault, otherwise, and if only spigot API were used, it's not the plugin author fault
I'm adding a method to CraftBukkit itself. I'm just wondering if I need to do extra validation on CB's end or if I can just mark it as @Nullable and have the plugin authors cover the checks.
I would add the @NotNull annotation if you strictly require it to be not null, and perform the check yourself
Otherwise if it can be null, just add the @Nullable annotation to concern the author that the value might be null
It might end up being this since Bukkit#getOfflinePlayer() can't pull world data from thin air.
Is not OfflinePlayer#getName nullable?
It doesn't pull data, but fills only the known data
You could do the same
could some one jump into #1193674105136889886 and help me please, not forcing just the message of the thread is up there
how can i do a server selector without using the plugin messagging?

What exactly do you mean with that?
hey!
an alien question for the pioneers
I want to get a player's nickname using only his UniqueId. Is there any API (json format) that allows me to query the UniqueId and consequently obtain the corresponding nickname?
With API do you mean an API on the web or?
I already have a similar API, but I can only query the nickname to obtain the UniqueId, but I want to do the opposite.
LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.
so that kind of API. I donno. I can guarantee you that such an API exists, but I cannot tell you the specifics
Apart from this thesis, is there any other way to get the result I expect?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getPlayer(java.util.UUID) probably, but your question indicates that you do not want to or cannot use that
the getPlayer method only queries connected players, plus I'm using BungeeCord
https://wiki.vg/Mojang_API#UUID_to_Profile_and_Skin.2FCape this wouldn't work for u ?
like by clicking on an item in a gui i get sended in another server in the bungeecord
?jd-b
?jd
God damn it, javadocs are broken for bungee
yep. As it seems like bungee's API is incredibly barebones
This char in test appear as § for me
i tried setting everything to UTF-8
but tests suck man
carriage return line?
there is no character to display that if you have your IDE set to display spaces, so it has to use some other character for that. Probably could change it
my IDE uses dots to show me spaces
is it possible to write unit tests for minecraft plugins ?
yes but it depends sometimes because you need the server, believe there is a plugin or something to help with that if you need the server
mockbukkit
or even this
instead of using the double s character directly, use the u code of it
thanks !
sounds like ur not using utf8 formatting
dude thats crazy, but there is 0 way im not
lmao
actually there is different ways this could be happening
there is a difference between reading something as utf8 and setting something utf8, so while it may be utf8 is the junit test actually interpreting it as UTF8? Also your test is flawed. You are testing for Test but the input includes the double S
Test != §Test
your error here says it Expected Test but what was actually provided was §Test
it reads § just fine
any reason you are not using ChatColor.stripColor ?
this is my https://github.com/Iridium-Development/IridiumColorAPI fork
anyways, either strip the character away or update your test
I linked it
you are the one that posted it here
so how is that confusing? At the top of it says very clearly what it expected
and what the actual value was provided
there is no §Test
it didnt
what happened is simple
i inserted §8Test
it read it as §8Test
it treated it as §8Test
it ended up removing §8 and keeping ÂTest
there's any bukkit runnable on nms?
what
regardless your test isn't expecting any additional characters either
sounds like your lib has a flaw in it or something
oh magic then
yes looks like your lib has a flaw
because stripping colors from the bukkit api removes that double s character
its impossible it has a flaw?
so it means it can't be flawed?
brother i love you frostalf but you literally need to just read it once
Is there a way to make an ingredient a specific potion for a shaped recipe?
I am not diagnosing your lib for you. Obviously its an issue deriving from your lib. Either change your test or figure out what it is your lib is doing that it shouldn't
brother it is not the test is clear
omg
i put "§1Test" it expected "§1Test"
please for god's sake im really in need of a painkiller rn
Use \u00A7 instead of §
this only proves your api is doing something
how
I think it is the test that is wrong?
I already mentioned this above as well
my god.
Like the expected value is the left value, not the right one
frostalf, expected value is wrong
I am aware, but they are using their own library they created which means the issue is coming from there
expected value is left one in junit
it isn't - the test is wrong
im not using my own test library!!!!!! imusing org.junit.jupiter
Or more specifically, the compiler compiling the test.
this is expected
oh right, yeah I already stated this way in the beginning
Use \u00A7 ffs
I told them to use the U code
there is a difference between setting something as UTF8 and reading it as UTF8 lol
Great why is this a problem then
just because it is set as UTF8 doesn't necessarily mean whatever reads it, also reads it as utf8. Why Junit is not doing so is weird because I always thought it assumed utf8
so its possible that Junit is using ASCII instead?
It's the compiler
I can't see how it is junits problem
oh yes \u00A7 fixed it
If I had to guess it's because the caches were not cleared
You should. Otherwise you will see a lot more of these problems
Ctrl + r time
I mean it can just be a find and replace
Are string templates also proposed to java?
Well that is because kotlin probably doesn't use your OS default
Yes
Cool
But they have a weird syntax in java
they'll require ` instead of "
iirc
The only other thing I can think of if it isn't Junit is the IDE not being set to save as UTF8 or for some reason the JDK is using the OS default character set
Please just use &
return STR
. "Today's weather is { feelsLike }, with a temperature of { temperature } degrees { unit }" ;
Or the ChatColor constants
Or that heh
String template in java ^
At least you can make your own stuff
is message template not good enough?
COMPONENT.”<red> I like beans”
Yeah thats great but why does it look like SOMEONE IS SHOUTING lol
static finals in a nutshell
GIMME GODDAMN COMPONENT WITH RED i like beans BITCHES
when final is like a const no?
how can i modify the MoveController of a nms mob
I was referencing the naming convention of static constants
🤤
you have no idea how much I want that
not even that but like, even
MM."<red>Hi there \{player.name()}"

how does that player name work
hm ?
Is mojang ever going to do something about furnace minecarts? 😔
They are truly terrible entities that should either be fixed or removed.
is there a good way to modify a private field without having to use the obfuscated field name
and then its passed to the string processor
something something specialsource
trying to modify the useItemRemaining field in LivingEntity
How would I go about adding a strength potion to a new recipe?
you mean it has to be an expression 🤓
🤓
PR an API
How do i get the player's off hand? the shield hand?
BlockDamageEvent is called when they start
mhm
BlockDamageAbortEvent is called when they stop, unless they break it
In which case BlockBreakEvent
sure
and there's no way to check without the event, right?
but i dont need that
thanks coll
you always help me :)
https://youtu.be/2oItMdl-8pk?si=jzOmKzfppJ4aoZTN
hope this helps 🙂
Spigot Plugin Development - 1 - Your First Plugin
Fair response
@solar musk you should do that
Is there a guide on how to make a spigot pr
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
im guessing thats waiting for 1.21
Slowly integrating things and moving stuff over to registries so it's not a huge shock. You probably won't notice until ItemType and BlockType are integrated
Think the only point of contention was the generics especially on ItemType
I liked that but idk what slime thinks
Slome
is there a limit in a HashMap for how many keys and values i can put on it?
Yeah how much memory you got
Probably 2^31 - 1
sure
Java uses separate chaining integer limit doesn't apply
Ur a chain
Plus Javas hash range isn't the entire integer limit anyways
That would kill memory usage to have an array that large
Well also as you add more entries you also have to think about collisions
I am adding an item that gives the player strength when the item is in the player's offhand. How would I ensure that when the item is removed that the effect is removed?
But collisions shouldn't really happen to a detrement unless you add a couple million entries especially using UUIDs you should get a decent spread
k, k
thanks
:)
I just learned a few months ago
It's just a fancy linked list array
why is load not defined
EditSession editSession = Objects.requireNonNull(ClipboardFormats.findByFile(myfile)).load(myfile)```
Can I get some help regarding a PlayerItemHeldEvent? When player holds the item in their off hand, it should apply the PotionEffect. Currently I am not getting any effect
try .equals
you should really just use PDC to identify your item, not isSimilar either
thats ur job
Your job is to confuse me specifically
likely a yea bro issue
PDC is awesome
I'm trying to develop a small event where I check how much XP the XP bottle has and tells the player how much it is...
public void onXPBottleBreak(ExpBottleEvent e){
if (e.getEntityType() == (EntityType.PLAYER)){
int exp = e.getExperience();
e.getEntity().sendMessage("You received " + exp + " EXP!");
}
}```
seems like it doesnt work, I'm still learning... where am I being stupid?
the entity is never a player, the entity in that event is always the xp bottle
Well the entity is always a thrown xp bottle
You need to get the shooter and check if it’s a player
ok, can I grab the entity receiving the XP? or is it a different event?
the entity getting the xp is unknown when that event fires
understandable
that happens after the xp orbs are spawned and go to a player
makes sense
I just wanted to change the experience of the bottle but I guess I need to find other ways
you can set the amount of xp that will be created in that event
how would i go about removing the "Interact with spawn egg" thing
Try the various ItemMeta flags
Most likely the potion effect one
If that doesn’t work it’s client side
they are all client-sided. If you specify the entity type in the spawndata tag in the block entity tag, it goes away and just says
it says the mob type in its place
that "interact" bit is only there cause currently it's empty
Wonder what happens if you specify an invalid id
it shows the interact thing
Rip
Does anyone know how to reset scoreboards? (.resetScore(entry) isn't working)
Did you open a bug report?
its 1.8.8
would that affect anything
also what patch are you talking about
?1.8
Too old! (Click the link to get the exact time)
Lol
The patch was for latest, and a bug report for 1.8 will just get closed
The scoreboard in 1.8 works fine
i got it to fire but it seems to only fire when player the player is changing the main hand inventory slot
you'd need InventoryClickEvent and PlayerSwapHandItemsEvent to check for changing the offhand item
or you just check the slot once per second or sth
Should those be parameters within the method?
use scheduling for that?
Sure
i want to make operations from string ||for exemple: "3*3+5" would return "14"||
i'm getting this error Error occurred while enabling wamasterv3 v${project.version} (Is it up to date?) java.lang.NoClassDefFoundError: com/ezylang/evalex/EvaluationException
i'm using this project from github: https://github.com/ezylang/EvalEx
here is my pom.xml
https://hastebin.skyra.pw/redorufuqi.htm
i still suck with pom
are you using the jar in this folder \Users\aXsc6_l\Documents\kode\skript\1.20.1\plugins
yup
where do i get that?
how can i check if an user have a paid or non paid account ?
if you use online mode its not an issue
offline mode usage is not supported here 🙂
oh ok sry
i mean, i have the build of the plugin in that
Idk how are you building the plugin
Make sure it's actually being built with maven
when i launch the jar file I only get a bundler server. Does anyone know how to fix this?
what jar
spigot?
like im tryna launch a MC server but when i launch the spigot jar it only creates a bundler folder
yes
how do u run it
bat file
java -Xmx1028M -Xms1028M -jar server.jar nogui
i downloaded it from spigot
you downloaded buildtools right?
no i downloaded directly through spigot
you need to download buildtools and then do java -jar BuildTools.jar --rev latest
buildtools is by spigot
no clue what you download but the correct way is buildtools
i put that command in the bat file?
no
wait
- download build tools
- run the command from the cmd to build spigot-1.20.4.jar
- use spigot-1.20.4.jar instead of the file you originally downloaded
unable to access jarfile
did you run it in the correct directory
open a folder that contains the buildtools jar
i did it
you did it in terms of it works or you ran it in the proper directory and it doesnt work
it works
arl
it finished loading now i have a bunch of folders like Spigot-Server and Spigot-API where is the jar file located so i can launch?
did you build —latest?
no i did 1.18.2
okay show me a screen shot
the jar is located in the same folder, spigot-1.18.2.jar
oh i see it
what he said
Thanks yall i appreciate it

