#help-development
1 messages · Page 1112 of 1
one is for
genshin has quite an intrusive anticheat
Kernel level again?
Vanguard: Hold my beer
Change my mind: 70% of anti cheat steal all your data
Not VAC 😈
yeah and I believe they messed it up causing a security problem
Malware started downloading genshin anticheat and then abusing it to gain kernel access
The user allows it
By entering the admin password
oh..
Many anticheats are kernel/driver level
I mean, you won't get any virus if you are smart enough
A driver can technically do anything
and if they break or have a vuln someone can take full control of your system
Which means an anticheat installing as a driver will have full control over your system
possibly bypassing antivirus
Yo just remote into a windows VPS and play it that way like everyone else 🧌
You don't need to shade jetbrains annotations
It doesn't but people with ocd it annoys
i didnt do this xD
someone did
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.1.0</version>
</dependency>```
found it
annnnnd its gone
Add the provided scope if you don't want to have jetbrains annotations compiled in your project
i just removed it and redownloaded the sources/docs and it fixed it
anyone tried this yet?
use tabnine
yeah it doesn't want to turn off for me 💀
so I'm kind of forced to
but just in Rider
ive watched some dev videos where they use it. looks nifty but really lazy
I feel like you would just forget everything because you rely on AI 💀
yeah you will end up with what some call the "Copilot pause"
basically you stop writing and wait for AI to finish it for you
What is the event called when a player hits a fireball
well take me as an example, i can basically code you anything you want in terms of plugins but still can't remember how to register a command bc I just press tab once and AI does it for me 🥲
Lol i made a method for it to make it easier java public void addCommand(String command, CommandExecutor commandExecutor) { Core.getInstance().getCommand(command).setExecutor(commandExecutor); }
💀
lol
I started using cmdapi a while ago so I don't need to mess around with bukkit commands anymore, it's just so much more convenient tbh, especially for tab completion it's a live saver
Cloud and ACF are pretty good too
well acf doesn't give acces to brig so you can't really compare it
Don't use it
ACF does use Brigadier
you're a beginner AI does more harm than good
so yes I can compare it
didnt plan on it. Just seems lazy IMO
it does? thought it was only for annotation-based registering, subcommands etc.
I think AI can be effective if you're already an intermediate or expert
but for beginners its often a crutch
yeah you just need to enable it
You make your commands with annotations etc and it will handle the brigadier part
could you show me an example?
I don't know if that's the right place, but I seriously need help.
private static final String LICENSED_TO_USER_ID = "%%__USER__%%";
Spigot is not replacing this placeholder. I asked a friend of mine to download the resource which he has purcharsed, and when I inspect the .jar file, the placeholder wasn't replaced
Is there something I should know or something I am doing bad?
?nms
Oh god, where can I find this information? I mean the thread post url
fukkit actually exists iirc
ah man
fukkit
random cursed question, has anyone here ever tried to add a lua scripting thing to their plugin as a way to script stuff
how do i get minecrafts source code preferably so i can edit it.
lua or just maths?
I did
I did it with https://github.com/gudzpoz/luajava
I turned yaml into a scripting language
don't know if that counts
is there a data structure that allows for this? bit hard to see maybe. but bassically each index inherits the previous indexes values as well
what for?
How easy was it
well im making kits which are locked untill you reach a certain level. but the levels also have access to the previous level's kits
Its easy if you know how lua stack works. And maybe need to mess with classloaders.
=
Does quote enclosed text counts an argument in commands?
Lmaoo
How easy does that end being for a prospective scripter
Like, not me
When using a kit, just check if the required level is less than or equal to the player's level @tall dragon
I'm wondering if it's worth doing something like this for scripture custom model props
There's no fancy intellisense you need to heavily document all your APIs.
you certainly do have a kit that the player wants, right?
if level >= 0
if level >= 1
subList in shambles
what are your issue
if you have a kit, check the level of the kit
your kits in gui yes?
^ loop over all kits
i want to avoid looping over all levels to see if that kit is in its level
OH
use a treelist
it sorts based on level
you can get the highest key based on that level
loop until that level to display all
you have kit list then do getting kit from level
Map<Integer, List<Kit>>
downside is you can't unlock two kits per level, but you can use a MultiTreemap or whatever it was
Horribly inefficient
^ yea
Eh is it tho?
it stores a bunch of useless data then
You can also just store an int[] which are the indices in a big list of kits
You lookup your level and get a list
so TreeMap<Integer, int[]> and use those as indexes into an array/list
yea but the worst kits are stored however many levels there are times
ill look into the treemap
I mean you can just have one List with all the kits and use subList to have a List that restricts to the lower levels
That is HORRIBLY inefficient asw
????
How is this inefficient?
literally no?
there is absolutely 0 data duplication lmao
isn't sublist inefficient as hell, as it creates a new collection?
no?
Uses a tiny bit more memory
oh I must have been mistaken then
i have never even heard of sublists lol
because I'm used to substring doing that
it's just a pair of indices
Cuz strings are primitive
TIL
I mean, they are immutable
what's the point of not using a view
java strings are stupid
They are
strings are stupid
Nah
Am I the only one that can't be bothered sometimes so I just chuck a cache to an algorithm and if it works I just call it a day
Yeah I'm fried as shit
or what
I am talking about something like uhhhhh simple but fib seq
Bump, I’m sure you guys have got some good advice
imagine it could be optimized without a cache*
what exactly do you wanna know
Hmm
Yeah so this is what I ended up having to do for my multi module project
I didn't know what I should put where
I guess how would you guys go about designing such a large project
So i literally coded it and then refactored
you shouldnt start by writing interfaces until your head pops off
you should start by making the damn plugin work and do what you want
This is what I did
and then improve it
^
And i ended up getting nothing done
Yeah that makes sense, just wasn’t sure if there was perhaps something you guys did to make it a bit easier
Get a product, improve it, repeat from step 2
exactly, cuz we are terrible at predicting what we actually need
Fair enough kek
Not only
it gives you a lot of motivation to keep going
because now it's a rolling stream of dopamine
like every time I start with an interface, I have to end up rewriting it or it becomes obsolete or whatever
its much easier to continue working if you already have some part that works fully
same things with modules
you dont start out by creating modules
Sure, guess I’ll just focus on skyblock mechanics first
Exactly, I cobbled together a fuck ton of things and now I'll purge and rebuild
you usually extract code out into modules as soon as you want to put it ou separately or wanna reuse it somewhere
or for other reasons that arent "because I think I need this in the future"
unles you are very sure up front
which is quite rare imo
At least for what I have got implemented, all the stuff in these modules was in the original module, got it figured that some of these things should be interfaced / abstracted a bit so yeah
Just write out gameplay / mechanics and improve later, got it and thank you
I wrote a "decent" item api and now I'll nuke it for a better one, but for now it does what I need
@worthy yarrow did you really take a picture from your phone instead of print screen? xD
Yes, I’m not on the computer and I took those a couple days ago to show my father
ah i see
How does your ij look like that?
themes
Appearance settings mane
Oooo
I like the dark look
clean thy monitor
It’s actually a background tho too not a theme iirc
You’re right
never take a screenshot like that again
download discord
.
Ty lol
Is that a sex toy in the screen reflection?
Why you wanna borrow it
what
I was just tempting everyone to click. I wonder how many did
Kek I assumed so
it doesn't?
Maybe he’s got timed homes
Usually you'd have maxHomes
“You only get this many extra homes for this long” who knows
then if currentHomes == maxHomes
your current text never tells them how many homes you currently have
Its in the player data.
My point is theres no point in telling them they have zero homes allowed
"You have no more available homes! Allowed homes: 0"
oh, i see what you're saying. It tells them how many allowed homes they have
its just the logic looks odd to me. perhaps its confusing me
I guess having it named AllowedHomes is confusing
I guess
if (currentHomes == maxHomes) {
if (!playerDataManager.homeExists(p.getUniqueId(), input)) {
send(p, String.format("&cYou have no more available homes! &7Allowed homes: &a%s", maxHomes));
return true;
}
playerDataManager.setHome(p.getUniqueId(), input, p.getLocation());
send(p, HOME_MODIFIED);
return true;
}```
yeah, that makes more sense
much more understandable
I've regretted making decisions like that a year later
reading back over my code and its made no sense to me at all
Yeah i keep doing that to myself as i go along.
i love it when my code says it creates an unbound udp socket but its bound
https://paste.md-5.net/zibisetowe.java
Any suggestions for this invite service? I feel I should probably implement some way of accepting a particular invite, such as by player name for example, other than that have we got any syntax / design concerns?
Make the expire instant accessible
getting to that tbf
also is there a reason why you can have more than one invite from the same person?
Move to a Set instead of a list
InviteImpl can be a record btw
Not sure what Java version you're targeting but it's an option
mmm
Honestly not sure if I want to support anything prior to 1.19 so records are usable here for sure
also do take care invites is concurrent but the list it's holding is not
j17 has records right?
yes
Hmm actually hadn't thought of this
Though it's only accessible through the concurrent map so is that a real issue?
yes
Alrighty
Yeah, how do you use ComputeIfAdsent?
playerData.computeIfAbsent(uuid, new PlayerData(uuid));
playerData.computeIfAbsent(uuid, PlayerData::new);
dunno what kind of sex toys you have 😂
Only the best 😄
This project is fucking huge man jeez
😏
now i gotta look up :: xD
That's a method reference
putIfAbsent has slightly different behaviour
it returns the value already in the map
and if no value is in the map that means null
For Set<>'s, I see a ConcurrentSkipListSet, is this what I am wanting to replace the list with? I've never actually used this object before
Any map can be converted in to a set
I mean basic set<>'s I've used just not sure how to also make it concurrent
But if i do java playerData.computeIfAbsent(uuid, PlayerData::new);
It wont add the uuid correct?
no
PlayerData::new is short for a lamda;
uuid -> new PlayerData(uuid)
whenever you have a method that matches the lambda input you can do a method reference instead
ConcurrentHashMap with Collections.newSetFromMap should work
Gotcha thanks
Oh
Hi, what's the error in this line?
p.sendMessage(ChatMessageType.ACTION_BAR, new BaseComponent[]{new TextComponent(ChatColor.translateAlternateColorCodes('&', "&7Quedan " + TiempoString + " de tormenta."))});
public void createInvite(UUID inviter, UUID invitee, Duration duration) {
Instant expiryTime = Instant.now().plus(duration);
InviteImpl inviteImpl = new InviteImpl(inviter, invitee, expiryTime);
invites.computeIfAbsent(invitee, uuid ->
ConcurrentHashMap.newKeySet()).add(inviteImpl);
}```
Such as this?
Uhm, sure
fourteen said use a computeIfAbsent just playing around with all the suggestions lol
If you see a way that I could improve this, please let me know
Yea well, you got a github?
Yes lol
Alr drop it in the review thread later then ^^
It's still not public
I want to at least get some part playable before a review
Eventually though, you'll see it pop up.... some day kek
hi, can i apply invisible effect to shulker? (shulker head(?) cannot be invisible..)
what does this error mean again
java.lang.IncompatibleClassChangeError: Found class org.bukkit.inventory.InventoryView, but interface was expected
it means you're compiling for new api versions but running on an old/outdated version
of java?
of spigot
InventoryView is an interface nowadays, but not too long ago it was a class
generally speaking just target the version of the spigot-api you intend to run the server on
or if you're making a public plugin, target the lowest version you intend to support
yeah i updated my pom to 1.21 to see if it compiled against it but i forgot to change it back to 1.20
then a user reported it not working any more
does the original function wait for recursive functions to end in interpreted languages?
if the function has a delay
how did you got that "CUTE" next to your name
stole it
tf is a guild and how can i join an alliance
There really isn't that much of a difference
but yeah newKeySet appears to be the newer way of doing things
wdym newer it's been a thing for like over a decade 💀
thought he was gonna say newSetFromMap is older than me
how old are you?
also whats the point of you InviteImpl when its internal use only
Hi, how can I get this entity metadata value? There are methods like isSwimming() for other fields but i can't find this one, .isVisualFire() doesn't work it returns false even though i'm in fire and in survival mode, even tested with an alt account and listening to packets to make sure it's not clientside.
This works but i don't want to use this: net.minecraft.world.entity.Entity#getSharedFlag(0)
Check get fire ticks and is visual fire
fire ticks for normal fire and visual fire for fake fire
ah so similar to net.minecraft.world.entity.Entity#isOnFire method?
public boolean isOnFire() {
boolean flag = this.level() != null && this.level().isClientSide;
return !this.fireImmune() && (this.remainingFireTicks > 0 || flag && this.getSharedFlag(0));
}```i'll delete this code later
I've tried to find how the entity metadata packet is constructed but intellij doesn't let me "Find Usages" within decompiled nms code
You need to import sources for that to work properly
Using the Paperweight plugin for gradle does make that easy with the downside of depending on the Paper API
this
I remember I had sources jar (either in the .m2 or directory where i ran build tools, i don't remember) for 1.16.5 a year ago
however I don't have sources jar for 1.20.6 now, even though I used all possible options in the buildtools
You need to add a BuildTools flag for sources jar
unclear if it includes the decompiled nms sources
I just use Paperweight since that's easier
How to create different scoreboard display for every player? Like on those servers where displays player's information for each player his own?
Does anyone know what plugin that uses villager shop that supportsd items adder for custom items trade or sell/buy?
create a new scoreboard for each player..
Start by making a new scoreboard with https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scoreboard/ScoreboardManager.html#getNewScoreboard()
and then set the players scoreboard with
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setScoreboard(org.bukkit.scoreboard.Scoreboard)
It's fairly trivial
unfortunately paper is gradle and i'm using maven with way too much going on to simply refactor everything now 😦
however these options should be correct, right? after buildtools done, i'll be able to find nms sources jar and then select it in intellij, right?
That's a question for #help-server
I too use maven for my plugins
I also want to know how to create a scoreboard that supports MMOCore
I just have a different project for looking at nms source
Well.. It doesn't look like optimized variant..
It is
Create a scoreboard for each player and tick it accordingly
That's how we do it at work and it's pretty much the standard way of doing things 
. _ .
Ticking isn't efficient it costs cpu cycles
My cpu only gets 1 cycle a minute
It's tough out here
get a better cpu then
The amount of engineering hours it takes doesn't outweigh the benefit of just getting a beefier machine or crying about it
It takes me months to test one iteration of my plugin
cry about it
Not to mention the literal years it takes to save a file
You spoiled kids now adays
isn't the discord desktop app just a fancy browser wrapper
Yes ma'am
how are you messaging twice within the same day
My phone
run your server on your phone then
I only get spigot-api sources, it has org.bukkit.* (except craftbukkit) and some small org.spigotmc
Absolutely not
You fuck off or something
I don't have nitro

guess it just generates spigot-api sources then
I'll get you nitro for 12 bucks
il do it for 13
Can I detect the moment when a new day begins?
Purpur or Paper solution will work for me.
Doing this through deferred code execution (For example, a timer) does not suit me...
It's weird because i literally have "sources" (sort of) at <buildtools dir>\Spigot\Spigot-Server\src\main\java\net\minecraft but it's not a jar and intellij doesn't recognize it as sources dir
:(
do any of you know a good shop plugin that supports items adder?
we already told you once to #help-server
is there any docs i can follow to set it up?
or can i ask you to send me the build.gradle, version doesn't matter I'll find my way through
and no anwers
answers
is there some better way to check if a player is allowed to build in a location outside a BlockPlaceEvent? right now im creating and calling a BlockPlaceEvent and checking if its cancelled after the fact, but I know you're not supposed to create and call events like this. is there a better way
worldguard is fine and all but there's so many plugins that can cancel events like this
Should I use a public permission manager plugin or try making my own?
just use luckperms i guess
reinventing the wheel for something that luck perms is going to end up doing better than you anyway, is kinda a waste of time
its standard
yes
its one of the reasons everyone uses it
?
Hey guys, I want to place a schematic via WE and as soon as a player removes a block from this schematic, the entire schematic should be destroyed. The question now is how do I get all the blocks off the schematic? I think/hope there is a better method than checking all blocks in the vicinity to see if they belong to the schematic
🤔 is there a way to convert kyori components into legacy strings while also converting hex colors to legacy colors
instead of the §x§a§a§b§b§c§c thing
I was trying to set up a command, but I keep getting
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.shushi.aSushiPlugin.ASushiPlugin.getCommand(String)" is null
seems to be some error in my command declaration
but in my command declaration it looks like this:
getCommand("god").setExecutor(new godCommand());
here is my yml if thats relevant to this error
version: '1.0-SNAPSHOT'
main: me.shushi.aSushiPlugin.ASushiPlugin
api-version: '1.20'
commands:
god:
description: Become Invincible
usage: /<command>
my command is also imported so im a lil confused
that error is impossible with what you have posted
check the actual plugin.yml inside your jar
I'd assume no. I don't know this for sure but I'm pretty sure mojang doesn't even store named text colors in components
could be wrong
but when I made my parser I simply noticed that
its also possible Kyori simply converts named colors to hex colors for flexibility and ignores named colors as a concept
seems like building the serializer with the default builder instead of calling .legacyAmpersand works
which in both cases would require you to do manual string processing after the fact
ahh
bedrock scoreboards are still hella short
and they just ... your ass instead of throwing an error
nvm my code no worky
k ill see
if my yml matches up in my jar maybe its somethin like command delcaration being a bit different in paper
if you are on paper my bet is you included a default paper.yml due to using the minecraft plugin for InteliJ
You can just clone this repo; https://github.com/PaperMC/paperweight-test-plugin
Contains a base project you can use
idk how that would even happen considering im building my jar directly into my plugin folder fron inteliJ
anyhow here is my yml from jar:
version: '1.0-SNAPSHOT'
main: me.shushi.aSushiPlugin.ASushiPlugin
api-version: '1.20'
commands:
god:
description: Become Invincible
usage: /<command>```
I am real confused rn
I thought maybe maven was the problem so I took out <filtering>true</filtering> from my xml cuz it can mess with jars sometimes but nah
this is a certified skill issue
check your jar for a paper yml
dark reader plugin
i might, usually fucks up on other sites
you can set which sites it enables/disables on
wait is the problem that its called
paper-plugin.yml instead of plugin.yml...
holy shit it was
what the heck
im sorry ElgarL I misunderstood what you were saying
make your own essentials plugin and api
🤓
The best is if you make everything yourself
minestom ahhh mindset
can i somehow give players temp fortune boost?
no
How temporary you want it to be?
giveBoost();
someOtherMethod();
takeBoost();
Or over several ticks.
for currenctly mined block
i have a dirty hack in mind
where i change the fortune level when player is mining and revert to old meta afterwards
alternatively i would just wanna boost the drops
but do it like fortune does so no dupe can happened with normal blocks
only ores n shit
Wait i got an idea, let me start my IDE rq
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockDropItem(BlockDropItemEvent event) {
Player player = event.getPlayer();
ItemStack itemStack = player.getInventory().getItemInMainHand();
int fortuneLevel = itemStack.getEnchantmentLevel(Enchantment.FORTUNE);
int boostedLevel = fortuneLevel + 3;
ItemStack boostedItemStack = itemStack.clone();
ItemMeta meta = boostedItemStack.getItemMeta();
meta.addEnchant(Enchantment.FORTUNE, boostedLevel, true);
boostedItemStack.setItemMeta(meta);
Collection<ItemStack> newDrops = event.getBlock().getDrops(boostedItemStack, player);
List<Item> drops = event.getItems();
drops.clear();
for (ItemStack drop : newDrops) {
Item item = event.getBlock().getWorld().dropItem(event.getBlock().getLocation(), drop);
item.setVelocity(item.getVelocity().multiply(0.5));
drops.add(item);
}
}
This should boost every block drop by 3 fortune levels.
Hmm, lets hope event.getBlock() is not already AIR here
dropItemNaturally be like
I feel like the getDrops method should be in BlockState after looking at the implementation...
is there a tutorial on how to use "case" in java because im writing something to check an arg and i keep having to do else if else if else if
thanks btw where do i get the spigot.jar for a server
Then build it yourself. Distributing the server jar is not allowed.
But I'd download a car (and also jars)
I'm le funni, yes.
I hope elon shows up at your house and shoots you for stealing his property
Is cancelling people's messages to change them and send them as server dumb?
Well, public transport around my area is good enough that I don't actually need to use a car
There are a few plugins doing that for one reason or another
It does remove some functionaly like clicking to get the /tell
But it does look slightly better with the padding
Well you probably can fix that by using adventure components
Yeah but can I really add stuff into their chat?
I got what I wanted though sooo
This sounds like something Flux would generate in a heartbeat.
prob just windows throttling it
I'm having same issue. might be Windows related
java 22 has a lotta issues
elaborate
Unfortunately recaf 4X depends on it :(
just use the latest one
shit
What IS The default color for item names? Example: If i set a display name of The item to "Test" without any color explict declared what color it Will use?
I think It was white too
i mean depends on the item
idfk man 😂
Totem of undyning
just go into the game
I need this imformation to get my plugin working
What do you need the default name for?
Because my plugin checks for a custom totem of undyning item
And because Minecraft changed default color If It
Of it
My plugin is not working
Alright, but you should never check custom items by name or lore.
It checks via method isSimilar
That is even worse, by far.
Add a PDC tag to your ItemStack and check if an ItemStack has this tag or not
?pdc
anyone have a clue
Lmk if you need code.
Thanks i Will try it
Initialize your fields in the constructor
Dumb question but how.
If you initialize a variable like this:
private final int x = 10;
Then it will be initialized before the constructor is called.
If you only declare them, but initialize them in the constructor, you are way better off in 99% of the cases:
private final int x;
public YourClass() {
this.x = 10;
}
Yeap looks good
is EntityRemoveEvent a 1.21 thing? how can i know when an entity despawns, any entity, for whatever reason, in 1.20?
pretty sure u have to listen to all the events urself.
for all these different causes pretty much
*Downstream has an event called EntityRemoveFromWorldEvent with is practically the same as the EntityRemoveEvent and has existed for several versions. Otherwise you need to do what shurikennen said.
i like how you call it downstream 😂

☠️
but where is that enum used? whats the event?
what is downstream?
that enum is part of EntityRemoveEvent. i show it so you see which reasons exist
no. so you would have to find alternate events for those reasons
for example for the death reason -> EntityDeathEvent
i see
but some of those dont have events, apparently
like despawn
there is no EntityDespawnEvent, at least on 1.20
and whats that thing 7smile7 mentioned? the EntityRemoveFromWorldEvent
Its a paper event
is EntityRemoveFromWorldEvent from the paper api reliable? i mean
does it cover all cases?
and btw, i need this bc i made a home/warps plugin, and i want to move those homes/warps when moving stuff around with world edit
so i thought of putting invisible entities in those homes/warps, but idk if thats reliable enough
🤨
i know each entity has a uuid, right? if an entity goes from one world to another, it keeps the same id? can i get info about an entity, like its position, if the entity is currently on an unloaded chunk?
and can i store arbitrary data on an entity?
If the entity is in an unloaded chunk you can’t get any info from it
probably in pdc for sure
and what if i keep a reference to it
Still no
mmm
That might keep the entity, the chunk it is in and the world loaded through references.
At least in memory.
Which is a really good way of creating memory leaks.
can i atleast load the chunk? or do i have to store the coordinates of the chunk that contains the entity myself
I would scrap the idea of using an entity to store data like that
If you really want homes to move with worldedit (why?) use the worldedit api
yea, the thing is that the world edit api doesnt emit events depending on the actions, like move, copy, brush, whatever
like, if i copy something, i dont want to "copy" the home/warp, but i do want to move it if i move something
or if i cut and paste it
so i gess i can add an extent and give it an entity that reprensents the home/warp?
and if i get two entities with the same home/warp location, it means it was a copy, and i ignore the newest one, and if the previous entity doesnt exist anymore, then the new one should be the new home/warp location
This means you need to add your home (or a reference like id) to the clipboard and move it accordingly.
If misuesed then this will lead to the home being moved to only the latest copy placed by WE.
idk, maybe there is a better way, but im tired of manually moving warps
How often do you move things on your server
yea, thats why i only want to move the thing on //move, or //cut and //paste
regularly
pretty often
like, just by a few blocks
and its annoying having to run a script or something to update homes and warps
The last server i was on had similar problems. It was a citybuild and their customblock API and warp implementation was utter rubbish.
I ended up forbidding worldedit on the production server and wrote code to move plots around. Im guessing you have a similar problem.
yea, last time i moved the entire city from y=10 to y=-50 or so, and i had to move plots, warps, homes, shops, holograms, and a lot of stuff, besides obviously the blocks
on the caves and cliffs update
Pain
yea, idk, i think i will just add a command to check if there is a home or warp on the selected region, show where it is, check if it matters moving it or not, and do it manually if needed. doing it automatically will be hard and wont always work probably
how do i get <version>1.0</version> from my pom.xml to my code
you can set it to your plugin.yml, and access it from there
Why would this be returning null if not?
public HashMap<String, Home> getHomes(UUID uuid) {
return this.playerData.get(uuid).getHomes();
}
Testing it with
public boolean hasHomes(UUID uuid) {
log(Bukkit.getPlayer(uuid).getName() + " size: " + this.getHomes(uuid).size());
return this.getHomes(uuid).isEmpty();
}```
nvm just stupid.
I was putting hasHomes() before i loaded the data into the map 💀
listen to PlayerDEathEvent, get the killer and keep track of that killer's streak in a uuid
then set some sort of timeout to remove it after x seconds
it permitaly stays the killstreak gives you buffs
i wanna make a plugin like that for a server
Guys, what event fires when a plugin adds an item to someone's inventory using player#inventory#addItem?
Been looking in java docs and other stuff but I can't seem to find it
have you seen videos on it
none
there isnt an event
Damn, I'll just make my own event for it then, thanks!
Any plugins for disabling particular plugin for particular area ???
Like that plugin doesnt affect on this area but affect on that area
made a system like that at work
it's quite simple
When an entity dies, reset their killstreak and award the killer with a kill
If the killer reaches a certain amount of kills certain "milestones" trigger
given you have the context of both who died and who killed them you can also impl buzz kills
~100 lines of code at most
hello everyone
Guys, I made a fake death mechanism, when the player's health drops to 0, the real death is prevented and instead the player goes into spectator mode, but during this process the player's items do not drop
Because there is no real death, how can we solve it?
I'm thinking of manually dropping the items in the inventory to the player's location, but will this cause any bugs?
Any lags
Or
Is there a better method you know of?
dropInventoryItems(Player player)
....
🤔 .
Loop thru the inventory
Then use player#dropItemNaturally
- I added a new method called
dropInventoryItems(Player player). And I called it on death (inonEntityDamageandonPlayerDeathevents), so that the items drop to the ground.
Alright
What is the best way to save interactable structures like should I save changing blocks or the whole structure
And how like in yml or is there a better way
is there any way to read keys like calling pressedA() method after pressing key A. It needs to be plugin, data pack or anything else
thats a fr coding moment lol
you want to check whether a specific key was pressed on a minecraft player's keyboard?
yea
not directly possible
uh oh
it's possible with a clientside mod
i alr know that but dunno hov to cod fabric or forg
or if you just want WASD, you can use this website https://www.mcpk.wiki/wiki/Horizontal_Movement_Formulas
On every tick, the game does these three steps:
Acceleration is added to the player's velocity.
The player is moved (new position = position + velocity).
The player's velocity is reduced to simulate drag.
We'll start by introducing Multipliers in an effort to make formulas more readable.
(this is pretty hard)
but its too much for a nub
like me
i mean
i had a plan in mind that i could use macro modes to run a command that runs a method
but that looks yk
ewwww
?
like a macro mode
didnt u heard of em
u set up macros to run a command
i used to use them to do some keybindings
serverside?
oh f
i didnt test it on plugins
so i dont rvrn know if it works
and can u explain serverside and client blabla thing
serverside -> things that happen in the server process
clientside -> things that happen in the client process
clientside.
k
@grim hound
do u know any ways to link it to my plugin
even if i create a client side mod that has custom keybind, how am i gonna run my method in the plugin
i dont think you can
i dont think a mod can interract with a plugin
yea
thas why i am asking
i think i can make it run a command that calls the method
do u think it would work
?
well that would just be a macro for a command of your plugin
but you can defently make a command that calls something in spigot
i dunno wut to do
Well explain what you are trying to do
what kind of key?
Guys, I need help with something, I made a fake death event, and when you fake death, the items should fall to the ground, I added a code for this, but we have a problem,
For example, I created a kit with the plugin called ItemJoin and the kit features are as follows:
itemflags: inventory-modify, death-drops, self-drops
There is another feature that prevents the item from falling to the ground when you die, death-drops.
But in the system I have set up, items are falling to the ground. It is not blocked, how can I solve this?
Here is the code;
private void dropInventoryItems(Player player) {
Inventory inventory = player.getInventory();
ItemStack[] armorContents = player.getInventory().getArmorContents(); // Get armor contents directly from player
ItemStack[] contents = inventory.getContents();
// Drop items from the inventory
for (ItemStack item : contents) {
if (item != null && item.getAmount() > 0) {
player.getWorld().dropItemNaturally(player.getLocation(), item);
}
}
inventory.clear(); // Clear the inventory
// Drop armor items
for (ItemStack armorItem : armorContents) {
if (armorItem != null && armorItem.getAmount() > 0) {
player.getWorld().dropItemNaturally(player.getLocation(), armorItem);
}
}
player.getInventory().setArmorContents(new ItemStack[4]); // Clear the armor
}
i think
of course they can
fr?
why would they not?
i never knew
yes
uh
works on the server and interracts with the client
do yall know any way to link tho ?
huh
pmc
plugin message
or custom payload, whatever you call it
?pmc
this might actually confuse him a little, since they can be used differently on proxies
this way i can interact a plugin with a mod
yeah, its client too though
yes it alr did
just have to listen for the correct channel/id
i dont see anything that makes it not drop to the ground
Maby check console?
can u give me a tutorial vid
send*
The system that prevents items from falling to the ground is different, this system is different
First of all, I installed the kits with the ItemJoin plugin.
And the fake death is a plugin I created myself
Well whats the issue then?
The problem is, I added a feature to the kits so that the item does not fall to the ground, called death-drops.
Normally, when the player dies, the item does not drop on the ground, but the code I prepared to drop the item in the fake death code does not detect this and the item drops.
ill recording video 1m xd
Sorry dont think i can help maby ask someone whos like better at java because i aint the greatest
No problem, thanks
In the video, the fake death process was disabled before, the player dies normally and the kit items I prepared with the ItemJoin plugin do not drop.
But when I fake death, those items drop.
ohh i get it but i am still not able to help.
It's okay sir🌹
thanks
Hmm
Maybe if I integrate the ItemJoin API in my plugin, can I control the itemflags that way
🤔 .
ItemJoin is a different plugin?
you should try to read the item's nbt data. its pretty likely ItemJoin applies some kind of tag. which u could use to not drop the item
Anyone have any suggestions/theories regarding this?
?paste full error
Im getting an error while spawning a ServerPlayer as an npc: https://paste.md-5.net/lufotoruyi.cs i know its the playerConnection but i dont know what i did wrong?
Here's the code: ``` public static void spawnNPC(Player player, String name) {
CraftServer server = (CraftServer) Bukkit.getServer();
ServerLevel world = ((CraftWorld) player.getWorld()).getHandle();
UUID uuid = UUID.randomUUID();
ServerPlayer fakePlayer = new ServerPlayer(server.getServer(), world, new GameProfile(uuid, name), ClientInformation.createDefault());
fakePlayer.setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ());
System.out.println("Creating and set position for fakeplayer");
ServerPlayerConnection connection = ((CraftPlayer) player).getHandle().connection;
ClientboundPlayerInfoUpdatePacket addPlayerInfoPacket = new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, fakePlayer);
connection.send(addPlayerInfoPacket);
System.out.println("AddPlayerInfoPacket");
world.addFreshEntity(fakePlayer);
System.out.println("Add Fresh Entity to world");
Bukkit.getScheduler().runTaskLater(SaberMC.getInstance(), () -> {
ClientboundPlayerInfoRemovePacket removePlayerInfoPacket = new ClientboundPlayerInfoRemovePacket(Collections.singletonList(uuid));
connection.send(removePlayerInfoPacket);
System.out.println("RemovePlayerInfoPacket");
}, 20L);
}```
Heya, I'm making a bungeecord plugin and I am struggling with waiting for a player to connect to a bungeecord instance.
I see there is ProxiedPlayer#connect(ServerInfo, Callback<Boolean>) but the callback is being called before my player is joining the backend server.
Is this a known bug, and is there a workaround?
how do people achieve change of the text inside the menu picture
I thought it could be rendered in real-time
but then it wont be inside the resourcepack..
thats an item
what the faq
yk whats wroten there
it says kaktuslager
they just update the item name accordingly
cactus storage
it can't be o.0
they have an item for every possible %?
no way
kaktus means cactus
oh you mean that lol
and yk what lager means
storage
they pro just have different images for that
dawg i cant tgpe
for every %? no wayy
that would take like 15min to go trough for every single one soo
Textures can have a bunch of logic encoded in them via a json file. For example you can check for a specific NBT value and then change the texture. Basically a weird animated texture. I'm pretty sure LegitiMoose made a good video about resource packs and how to make animated textures.
But you still gotta make a texture per % I think
Any ideas?
tbh play legends has a pretty large dev team so maybe they have their own ways of doing it
delaying maybe
we can't just add an arbitrary delay
some players have slow internet
we need a callback of some sort
Even without solving our issue, why does the callback run before the player is connected?
Is the callback run the moment the tcp connection is established? Or when the player finishes the configuration phase?
no they don't
that's in the inventory title
you cant change y axis in inv title
how can you? you can't like \n or smth
fonts
fonts?
fonts
with fonts you can change the vertical shift/ascent
- with (negative) space fonts you can change the horizontal positioning
(or you could use shaders and do all of that)
How do you define "joining"? The callback is called as soon as the connection is established
connecting to the backend server and getting past the configuration stage
they should be spawned in the world
Ah okay thanks, is there a way to wait for getting past the configuration state?
@grim hound how do i send the message to the plugin by mod btw which loader should i use
never made mods
search up a mod making tutorial
and after than how to send custom packets to the server with mods
ffs buildtools, i have git installed, why??
*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
Could not successfully run git. Please ensure it is installed and functioning. Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, git, --version]
does anyone have this double arrow >> symbol? sorry for the poor resolution
ohh
Does anyone know how to use the kyroi adventure API with triumph-gui framework?
thank you
This is spigot, someone might have an answer for ya otherwise might be better off asking in paper
thanks
anyone got something on the git thing? i fkn hate build-tools
That's not proxy related anymore, you will need to listen to PlayerJoinEvent on the server
ig that's a server question, nvm :)
are block breaking packets synced with position&rotation?
You’re going to have to clarify a bit more
Position and rot of what exactly?
if I do Player::teleport and it returns false, does that mean that the PlayerTeleportEvent was cancelled?
can you break a block at a clientside position that is not sent to the server
Yes you can
Spigot has methods in the api for that now, you dont need packets
Yes
so theres no good way to check cheats that break a block without looking at it?
Anticheat is a whole other story, what does that have to do with block spoofing?
You could raycast and check the block, but that could probably be spoofed aswell
ofc there is
anticheats do it all the time
what about grim?
it doesnt do it
also, as said
raycast
but account for ping
isnt blockiterator the same thing?
not sure what that is
because i use that
Yeah it is
yeah when i rotate too fast or i have high walking speed sometimes the block i break isnt included into the raycast
it isnt contained in the iterator
and ive tried alot of different stuff
if you can break a block at a clientside position that is not sent to the server tho theres no way to perfectly detect it
you can respoof the actual blocks
whats that
also, just ignore blocks broken purely clientside if they ever get sent to the server
spoof the blocks that are actually there
if you detect any inconsistencies
wdym spoof the blocks
idk what is that
also im trying to see if theres a simple or pefect way to detect it, i know that you can detect it with false flags using stuff like how far you have rotated as parameters of strictness
send the packet = spoof
I doubt theres any simple ways of doing it
Friends, I encountered a problem while creating the kit plugin, now when we create the kit, the self-drops feature is added. And this prevents him from throwing the item to the ground, but while doing this I cannot throw items that do not belong to the kit.
How can I distinguish between these two kits?
A unique UUID for each item? Or a unique lore
Use pdc to set a kit id
Lore isnt reliable
Hmm
I have no idea what exactly it is, but I'll try to do it
?pdc
This method does not work unfortunately due to version incompatibility
Dont tell me you’re using 1.8
yep
🤣 this is such a middlef*nger
Bro just.... just came out, standed in the line for hours and then pulled out the cursed 1.8
wha
WTH LOL
is there people who could help whit makeing armor? I dont understand how to change armor texture, like iron armor could hvae 5 different variants
You need to use leather armor and a shader
what you do is detect if the color isn't obtainable in vanilla and then replace the texture
A question about priorities:
If 2 things happen to have the same priority, like HIGHEST, what order will they be carried out?
undefined
kk
I ask cuz yk highest means your plugin is getting last say on an event, so if 2 seperate plugins have that what would transpire seems maybe useful to know
If your plugin clashes with other plugins via their event priority, then those plugins are either not compatible or poorly designed.
Eg. having two plugins for block protection might lead to incompatability
I'm having an issue where a textured player head's SkullMeta is returning getOwnerProfile as null, is it possible that the texture data is stored elsewhere in the item?
For context this is the head in question that doesn't appear to be returning an OwnerProfile https://minecraft-heads.com/custom-heads/head/98550-cat-in-bread
It also does not return a OwningPlayer
No plugin shoudl un-cancel a cancelled event
All the texture really needs is a link to mojangs skin server
public ItemStack createSkull(URL skinUrl) {
ItemStack skullItem = new ItemStack(Material.PLAYER_HEAD);
ItemMeta meta = skullItem.getItemMeta();
SkullMeta skullMeta = (SkullMeta) meta;
PlayerProfile profile = Bukkit.createPlayerProfile("Mr Bob");
PlayerTextures textures = profile.getTextures();
textures.setSkin(skinUrl);
profile.setTextures(textures);
skullMeta.setOwnerProfile(profile);
skullItem.setItemMeta(skullMeta);
return skullItem;
}
Where skinUrl is simply
I'm trying to get the texture from a skull item which is the thing I am having issues with
Show your code
Get the PlayerProfile instead.
May i ask what you need this for?
and yes get profile not player
I am getting the profile currently but it is returning null as mentioned.
I have an editor in my plugin and I store a simplified version of the item as it's for display only
Here's the code itself: (I don't remember why it's so ugly)
@Nullable
public String getB64(ItemStack itemStack) {
try {
if (itemStack.hasItemMeta() && itemStack.getItemMeta() instanceof SkullMeta skullMeta && skullMeta.getOwnerProfile() != null) {
URL skinUrl = skullMeta.getOwnerProfile().getTextures().getSkin();
return skinUrl != null ? getBase64FromUrl(skinUrl) : null;
}
return null;
} catch (Exception exception) {
return null;
}
}
So... its for persisting the texture?
It saves the texture per pet to the user's config file in my current case but I use it in different plugins
@Contract("null -> null")
public URL getTexture(ItemStack itemStack) {
if (itemStack == null) {
return null;
}
ItemMeta itemMeta = itemStack.getItemMeta();
if (!(itemMeta instanceof SkullMeta skullMeta)) {
return null;
}
PlayerProfile profile = skullMeta.getOwnerProfile();
if (profile == null) {
return null;
}
PlayerTextures textures = profile.getTextures();
return textures.getSkin();
}
I would separate this from directly converting it to Base64.
public String encodeToBase64(URL url) {
String urlString = url.toString();
Base64.Encoder encoder = Base64.getEncoder();
return encoder.encodeToString(urlString.getBytes(StandardCharsets.UTF_8));
}

That code is not going to resolve the issue I outlined though
Hm?
Actually that code is pretty much the same as what I currently have but just written differently
The issue I have is that the ItemStack's profile is null even though it has a texture
Ah i see, the returned profile is null in your case
Probably not
Print out the ItemStack inside this method and make sure to remove shenanigans like
} catch (Exception exception) {
return null;
}
Hiding exceptions like this is asking for a disaster to happen
I do agree, I'm not sure why I wrote that initially
My prediction is that you pass something in here that isnt a proper skull ItemStack.
Or it throws an exception in there somehow.
Which results in a null value.
I have tried using conditional break points to work out what the issue is and it successfully break points with the condition of itemStack.getItemMeta() instanceof SkullMeta skullMeta but doesn't break point when the condition is itemStack.getItemMeta() instanceof SkullMeta skullMeta && skullMeta.getOwnerProfile() != null
I'll print nonetheless
You could also separate your conditional statements like shown in my method. It will get you a better granularity for debugging and modifying your code in the future.
Yeahh, I'll do that
@lost matrix Sir i have a question
Is it possible to make a fake death look like a real death in the game?
?question
What's a fake death?
🤔.
So when the player's health drops below 0, real death is disabled and instead he goes into spectator mode and spawns after 3 seconds.
But this prevents the player's items from dropping
I added an item drop system, this time death-drops in special kits are not taken into account.
So when you die, the items belonging to the kit drop, even though they shouldn't
- Check for EntityDamageEvent on MONITOR priority
- Check if the Entity is a Player
- Check if the resulting health will be 0
- Cancel the event and put him into SPECTATOR gamemode
That would be my first naive approach.
That would stop them from actually dying and dropping items
which I assume is what they wanted to fix
And the kit plugin listens to death event
It will also mess with death statistics
I think so, otherwise the death event with setKeepItems(true) and spawning a tick later is also nice because it supports other plugins which listen to the death event
And shows a death message
What's wrong with calling the death event?
But depends on what SinHa needs
the player isn't dead
You would generally not want to call Spigot events yourself as it might result in unexpected behavior.
Ah fine
I set the statistics
Like deaths kills
Killstreak
Only the item drop event is problematic
I set up the kit with my own plugin
Like
- world
permission: kit.test
uuid: 7b8dcd14-8207-48a7-a057-ceba921c0089
triggers:
- first-join
- respawn
itemflags:
- death-drops
- self-drops
armor:
helmet:
id: DIAMOND_BOOTS
name: §bSky
slot: helmet
chestplate:
id: DIAMOND_LEGGINGS
name: §bSky
slot: chestplate
leggings:
id: DIAMOND_CHESTPLATE
name: §bSky
slot: leggings
boots:
id: DIAMOND_HELMET
name: §bSky
slot: boots
inventory:
item_0:
id: DIAMOND_SWORD
name: §bSky
slot: 0
item_8:
id: ARROW
name: ''
count: 64
slot: 8```
Death-drops in the itemflags section here It should detect fake death instantly
In this way, I would find the kits in the .yml file in the kits folder and then add the itemflags control
In this way, if there are death-drops, to prevent the item from dropping
But it didn't work
This was the result of the print:
ItemStack{PLAYER_HEAD x 1, SKULL_META:{meta-type=SKULL, display-name={"text":"Red Cube","italic":false,"underlined":true,"color":"gold","bold":true}, lore=[{"text":"Custom Head ID: 100854","italic":false,"color":"gray"}, {"text":"www.minecraft-heads.com","italic":false,"color":"blue"}], skull-owner=CraftPlayerProfile [uniqueId=8aefaa5f-153f-4c1e-8169-755adebc0c34, name=, properties={textures=[{name=textures, value=eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjc3YWNmZGE5ZjE4ZDVhNGEyNDdkMzBiMGVkNjMwNTY3YTU5Zjg3YTk5YjRiYzAxYWY2MGFkZmQ3YjlhZTNlZCJ9fX0=, signature=null}]}]}}
Looks like a head to me... Did you make sure no exception was thrown?
Yeahh, no exception
Hm, and you are on the latest version?
Not currently on latest, let me update