#help-development
1 messages · Page 1238 of 1
the window of time for deepseek's relevance is also quickly going away, personally I only think of it as the cheap option now that claude 3.7 is out
if I had infinite money I wouldn't even think about deepseek
so you have to rely on hoping some other massive model comes out with a completely free and open source license
or worse, good luck making your own lol
if I want a free model I have gemini, and if I want a good model I have claude, deepseek is in that weird intermediate level where I want something powerful that won't make me go bankrupt
What was that in #general ? I don't put all that in one if statement
Don't take #general too seriously
I would like to get Location from player, but I don't know how to do it.
I would also like to know if there is some kind of reference.
@slim wigeon pretty sure this guy worked with songoda, so he's probably who you wanna harass.
Player#getLocation
declaration: package: org.bukkit.entity, interface: Entity
thanks
I not going to harass anyone. If he wants to work with Songoda, we cannot stop him
no no i meant, you were whining about how songoda can do that hopper shit and you cant.
or whatever ur skill issue was
I see, I done with that. But thanks for telling me. I did see he is in these servers, all 3. We cannot harass anyone here, its against the rules
bruh i didnt mean literally harass but thanks
I might know how I can fix that issue, I got to re-work my lists
I understand that. The issue is that the item is being mutated when it's not expected to be. Even when I add an item to an empty inventory is the amount changed by consistent quantities.
So given your example, if I pass an ItemStack with stack size 64 to an empty inventory, the quantity is now 63. If I do it again with the 63-size stack, its now 61, then 57, then 49, then 33, then 1. Again, the inventory is completely empty. It's just reducing the amounts for the heck of it
so its reducing by 1-2-4-8-16-32
a server reload clears tasks right
I have a utility class to generate a progress bar, but the specific color of this bar should be inferred from a config file. Everytime I invoke this class I think its a bit verbose passing plugin eachtime. Is doing something like this going to be acceptable?
private val plugin: JavaPlugin? = Bukkit.getPluginManager().getPlugin("PLUGINMAINCLASS") as JavaPlugin?
or will this cause errors
To clarify, in order to access the config I'll need an instance to the plugin, which should be passed through a constructor usually.
Well, usually you'd construct this instance once with the plugin passed
and pass it around
fair enough
Trying to get my 1.19.3 plugins to date. And I noticed this function public void saveInv(ItemStack item, Inventory inv) { ItemMeta meta = item.getItemMeta(); BlockStateMeta sm = (BlockStateMeta) meta; Chest chest = (Chest) sm.getBlockState(); chest.getInventory().setContents(inv.getContents()); sm.setBlockState(chest); item.setItemMeta(sm); }This function saves the inventory to a item but my question is, how can I save a custom inventory like InventoryManager for a example?
who wrote this, this is bad
no instanceof check for the BlockStateMeta ?
This code has 6 lines written on 3 because ???
And it does not save inventory, only the inventory contents.
You'll probably have to elaborate on what your InventoryManager is.
I love the confidence with the casting
Watch me pass a stick and have your code explode
I wrote it, I was getting started at the time. But I might know what I need to do. I also know this needs to be changed. Just want to get the code in working state before I change anything either than adding my core to it and server version from 1.19.3 to 1.21.1
Ok fair I guess, just be sure to rewrite it properly.
And maybe do use more descriptive variable names, not just "sm"
but yeah idk why it wouldnt work for your custom inventory
assuming an instance of Inventory exists anywhere in there you should be able to save the contents in the same way
I may ask for help so be ready, I don't know what I was doing with that. Let me get the plugin in functional state. One second
guys, whats the event that gets fired when an item loses durability?
PlayerItemDamageEvent
declaration: package: org.bukkit.event.player, class: PlayerItemBreakEvent
not this?
What are you trying to do?
affect how items get damaged
Like for pickaxes and all that?
This is not what he means, it only triggers when a item is broken. Not when it takes durability
I like to know this as well for my mining drills
(that is why i striked it out)
.
@pseudo hazel Incorrect method like I said here
maybe read what I said
PlayerItemDamageEvent != PlayerItemBreakEvent
declaration: package: org.bukkit.event.player, class: PlayerItemDamageEvent
Called when an item used by the player takes durability damage as a result of being used.
@lost matrix tell me your ways
Does someone have a list of packets for 1.21? because wiki.vg doesn't work anymore for me
if someone can send a link
wiki.vg, a wiki that documents Minecraft's protocol extensively, was sunset on November 30, 2024. As the announcement posts reads, "The final content will be archived and made available for download in MediaWiki's XML export format under the CC-BY-SA license, along with an archive of images and other media." The sunsetting announcement can be re...
where did the 6 lore lines come from if meta in item is null? meta is item.getItemMeta()
What’s in it
wtf is isForInventoryDrop
idfk
Is for inventory drop obv
in what?
In ur arraylist for lore
What does the lore say 🎵
well i'm modifying the lore clientside so it should be empty
1 sec lemme give u the code
@Override
public void onPacketSending(PacketEvent event) {
Player player = event.getPlayer();
PacketContainer packet = event.getPacket();
if (packet.getType() == PacketType.Play.Server.SET_SLOT) {
ItemStack item = packet.getItemModifier().read(0);
packet.getItemModifier().write(0, addEnchantLore(player, item));
}
if (packet.getType() == PacketType.Play.Server.WINDOW_ITEMS) {
List<ItemStack> items = packet.getItemListModifier().read(0);
items.replaceAll(item -> addEnchantLore(player, item));
packet.getItemListModifier().write(0, items);
}
}
private ItemStack addEnchantLore(Player player, ItemStack item) {
item = item.clone();
ItemMeta meta = item.getItemMeta();
if (meta == null) {
return item;
}
List<String> lore = new ArrayList<>();
for (AbstractEnchant enchant : TurboAPI.getEnchantManager().getEnchants(item).keySet()) {
lore.add(enchant.generateLore(player, item));
}
if (meta.hasLore()) {
lore.addAll(meta.getLore());
}
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}```
You testing this on creative ?
yes
Thank you bro. Was searching for it
anyways tysm i've been trying to fix this for a long time
I've had the same problem when I was trying to hide nbt from client
the nbt was just going away 'cause player in creative has complete control over their inventory
...[05:07:14] [Server thread/WARN]: MrnateGeek moved wrongly!
Just don't
Did I miss something?
Idk, I'm just making joke
Just move correctly
It might be this stone walls near my miner machine, Mojang set its hit boxes wrongly. I not against either. Its perfect the way it is
Hmm why does this happen?
getServer().getPluginManager().registerEvent(CreatureSpawnEvent.class, this, EventPriority.NORMAL, (listener, event) -> {
System.out.println("Creature Spawn Event called with " + event.getClass());
}, this);
[STDOUT] Creature Spawn Event called with class org.bukkit.event.entity.ItemSpawnEvent
``` Sounds like a bug to me because ItemSpawnEvent does not extend CreatureSpawnEvent
exactly, so why is my event called anyway?
I cannot re-create the bug but if you seen it, you know what I mean
I don't know what you mean, can you show or explain what you mean bby "wrong hitbox" ?
Its unrelated to spigot. Are your PMs open? I might can show you
ye sure you can DM me that, I'm curious
I'll make a bug report later I guess
@EventHandler
public void onPrepareAnvil(PrepareAnvilEvent e) {
AbstractEnchantManager enchantManager = TurboAPI.getEnchantManager();
ItemStack first = e.getInventory().getItem(0);
ItemStack second = e.getInventory().getItem(1);
if (first == null || second == null || enchantManager == null ||
enchantManager.getEnchants(second).isEmpty()) {
return;
}
ItemStack result = first.clone();
for (Map.Entry<AbstractEnchant, Integer> entry : enchantManager.getEnchants(second).entrySet()) {
if (!entry.getKey().canApply(result)) {
continue;
}
enchantManager.applyEnchant(result, entry.getKey(), entry.getValue());
}
e.setResult(result);
}```
when creative, it works, but when survival the result appears for a split second then disappears
thats not a bug
CreatureSpawnEvent does not have its own handler list
neither does ItemSpawnEvent
the executor is responsible for ensuring only the correct instances are passed to the listener
So I have to check myself whether I get the correct event, despite I said I want this specific one? Why can't that check be in spigot?
Doing it in the executor is possible and I did that as a workaround but it seems off to me
this system is eons old ¯_(ツ)_/¯
It's a one liner 😭
@flint coyote pr it if you care so much lol
and get it clapped 
Will probably be considered a breaking change of some sort
The registered listener would have to start tracking that now
or the methods would need to wrap your EventExecutor
wasn't there an issue where it passed the wrong event?
Yeah it just did but apparantly that's working as intended
I mean passing the wrong subclass
like listening to ItemSpawn and it passing CreatureSpawn
yes see here
I tried to help you but ok
I recall having errors w that
yeah exactly the same issue here
yeah just do a class.isInstance check
yea because itemspawn and creature spawn are both just registered into the entity spawn handlerlist
exactly
I did it with isAssignableFrom but yeah
Alright guess I'll not open a bug report if that's working as intended
Could at least get a warning in the javadoc though
.
nvm
EntityDamageEvent also doesn't have handler list right?
It should iirc
nvm it has
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
lmao i was looking for the same info
did you get it/try it?
my uni prof mentioned his dept has been using it successfully
guy at work uses it
They bought out supermaven which has really good AI autocompletion
and they're prob using it
so I'd have high expectations
I looked at cursor, looks oddly familiar
it's a vscode fork
When uploading a resource on spigotmc, how would I best add a resource pack to the resource? Should i just use an external upload service andlink it or does spigotmc provide a better alternative
it does not
prob just embed it in the resources folder n shi
serve on the minecraft port 🔥
I mean when uploading something as a resource for others to download, like releasing a plugin. But there is a resource pack thjat belongs to the plugin. Is there a preffered practice how to upload a resource pack along with it
anyone recommend a good quickstart guide on the spigot api
no there is not
could have something in your data directory downloaded from some asset repo or something
it's close to what I do at work
I clone the asset repo and compile the resource pack to a seperate directory and zip it
i have this
which is called in onEnable which does
Bukkit.getServer().getPluginManager().registerEvents(new DeathbanListener(), HCF.getInstance());
in its constructor
and look at the class
public class DeathbanListener implements Listener {
private final DeathbanManager deathbanManager = HCF.getInstance().getDeathbanManager();
@EventHandler
private void onPlayerDeath(PlayerDeathEvent event) {
final Player player = event.getEntity();
if (deathbanManager.containsKey(player.getUniqueId())) {
return;
}
long banTime = System.currentTimeMillis() + (HCFConfig.Deathban.DEATHBAN_TIME * 1000L);
deathbanManager.put(player.getUniqueId(), banTime);
}
@EventHandler
private void onPlayerRespawn(PlayerRespawnEvent event) {
if (deathbanManager.containsKey(event.getPlayer().getUniqueId())) {
event.getPlayer().sendMessage("ur in the thing");
}
}
}```
but its telling me deathbanManager is null
in the Listener
how is that possible
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
!verify
Usage: !verify <forums username>
?
huh why did my message get deleted
did it have something like get bukkit in it
is there something like PrepareAnvilEvent but also works when you shift click an item into the anvil
Does someone know how I could disable swimming in modern versions to only allow the player to slowly swim (like it was in 1.8.8 versions) I've tried modifying the entity_metadata packet to cancel the event when it changes to swimming but it doesn't seem to work. If someone knows a better way I'd appreciate it
The spigot api methods don't really work reliably like like setSwimming
Solution: stop supporting cross-version support with version difference of a DECADE
I'm not supporting cross-version bro
I'm just trying to return the 1.8.8 features to 1.20
using packets
But whyy
That's horryfing
I've follow the entity metadata format
Pose VarInt Enum STANDING = 0, FALL_FLYING = 1, SLEEPING = 2, SWIMMING = 3, SPIN_ATTACK = 4, SNEAKING = 5, LONG_JUMPING = 6, DYING = 7, CROAKING = 8, USING_TONGUE = 9, SITTING = 10, ROARING = 11, SNIFFING = 12, EMERGING = 13, DIGGING = 14, (1.21.3: SLIDING = 15, SHOOTING = 16, INHALING = 17)
but it doesn't seem to work
Should I call it a de-feature then xD
We call that a regression.
This is my code
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.ENTITY_METADATA) {
@Override
public void onPacketSending(PacketEvent event) {
List<WrappedWatchableObject> metadataList = event.getPacket().getWatchableCollectionModifier().read(0);
if (metadataList == null) return;
for (WrappedWatchableObject meta : metadataList) {
if (meta.getIndex() == 21) {
try {
Object value = meta.getValue();
if (value instanceof Number) {
int pose = ((Number) value).intValue();
if (pose == 3) { // SWIMMING ACCORDING TO WIKI
event.setCancelled(true);
return;
}
} else if (value instanceof Enum<?> poseEnum) {
// JUST A FALL BACK IG
if (poseEnum.ordinal() == 3) { // SWIMMING
event.setCancelled(true);
return;
}
}
} catch (IllegalArgumentException ex) {
event.setCancelled(true);
return;
}
}
}
}
});
plugin.getLogger().info("Modern swimming packets canceled so players can never swim.");
}```
problem is the client's doing predictions
and no, that won't work because you're using the legacy wrapped watchble collection instead of WrappedDataValue iirc
i very vaguely remember the swimming/crawling pose being controllable from server side
i'm not sure how much prediction the client does on it
You can do it but everytime the client tries to swim theyll be bounced back and its super annoying
set their hunger to 0 🤡
hi!
how do I go about using NMS? I have probably never used it, and I may need to right now. I want to add a few new tools to the game with custom mining speeds and stuff. I tried to modifying the attributes, ending up changing block_breaking_speed but that made a pickaxe which could instamine wood. So, um, how should I get started with NMS?
?nms
But you do not need NMS for any of what you just described
what could I do otherwise?
iirc you can do that with datapacks
Modify the tool component on the item or correctly use the attributes
mining_efficiency attribute
I tried that next. I was tinkering with the attributes and gave myself one with a command generated from mcstacker but it did not seem to affect the mining speed at all for anything.
Oh. I may try that.
neat
And datapack would not help in any way at all
Again, you're just modifying an item which you can do with a /give
gone are the days of listening to fucking block damage packets and updating the block breaking process every tick in a scheduler task
OH NEAT! THX! I should probably get more acquainted with datapacks.
there is an API in spigot for creating tools?
or something else that fits what I am trying to do here?
apparently yes
i've yet to use it though so i don't know the names off the top of my head
try digging around the itemmeta docs and searching for "component" or such
e.g. FoodComponent is https://minecraft.wiki/w/Data_component_format#food
logic would dictate that this would be ToolComponent but logic and bukkit don't go well together
You can use the ItemMeta to get the tool component
Then modify that and set it back
It's not an API for "creating tools" exactly, but it does allow you to create tools
it IS toolcomponent
i'm amazed
is there api for getting the default toolcomponent from item material?
to e.g. use an existing vanilla tool as a base
Btw, does this new components thing replace the old NBT system?
yes
other than serialisation.
rather, does calling ItemMeta::getTool return the material's default tool component if none is set on it, or an empty instance
I just noticed that {} from the give command is gone and has been replaced with [] instead.
I do not believe it does
there is a CUSTOM component that still holds raw NBT
but apart from that, items at runtime are handled entirely as components
which are in principle immutable
which, if you ask me, is probably the best thing to happen since waterlogging
Waterlogging is a terrible hack imo
well yes but it does look cool
yes
itemmeta works entirely and solely on the patch layer in isolation, without any regard for the base item's prototype component map
wow. Seems kind of nice. I should probably get more familiar with this stuff.
you see, itemmeta is a very good, highly flexible system
you have some methods in Material like getDefaultAttributeModifiers, getMaxDurability or whatever etc
but not really
kind of ass but i suppose hardcoding the properties of the vanilla tools isn't that much work, so whatever
in my opinion this is a fundamental flaw in the api
but i don't care because i don't use itemmeta
do we have something better
i know paper has some sort of data component api but i've yet to use it
if by "we" you mean spigot api, no
if you are using paper api, paper has their data components api, but you should ask in the paper discord about that
there's a docs page etc
Is it possible to stop a minecart from going downhill on slopes?
On a move event, could you check the coordinates, check if the difference is -Y, and then cancel the event by setting its velocity to 0?
maybe try to describe more of what you're doing
There's a #setMaxSpeed method in minecart you could play around with:
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Minecart.html#setMaxSpeed(double)
Given what's available through api, you'll probably have to describe when the minecart should slow down... programmatically that is
no
honestly there's a 2 week free trial and I feel like 2 weeks is not enough time to justify the effort of migrating my current projects to try to use it
I have 5-6 different projects open in my IDE right now, I don't want to have to reconfigure everything
if it was 1 month I might consider it
Guys do anyone knows how to fix the client-side visual issue where the player is shown normally when right clicking after switching from one slot to another while right clicking? I need to know how to fix this from spigot itself
The player is shown not rightclicking for example not using the bow when you switch slots while right clicking
But you can shoot arrows and so
Hello, how can I get the knockback resistance of an entity ? (I want to make a function to deal knockback using an entity and an ItemStack without dealing damages)
.setVelocity
I think you should read my question again
afaik best bet is just checking the entity and equipment
what's the function to get his attributes ? I'm using at least spigot 1.17
declaration: package: org.bukkit.attribute, interface: Attributable
okay my bad, it was on LivingEntity, and I was using Entity
Hello, how can I get the attack damage of an ItemStack ?
I tried meta.getAttributeModifiers(Attribute.GENERIC_ATTACK_DAMAGE) but it's null (for a Wooden Axe)
which should return me 7
You need to use the default attributes for items that don’t have any explicit attributes set
Material#getDefaultAttributeModifiers iirc
okay thanks
Cursor isn’t exactly an IDE so there’s no point
Guys I'm doing a #player.hidePlayer(target) and I'm sending a packet from the tab so that the player doesn't disappear from the tab but for some reason it disappear from the autocomplete, but as have it currently the target disappears from autocomplete but I don't want that to happen, any ideas?
I want to do it like this to "hide" players in modal spawns when I do big events but I don't want them to be hidden from the tab or autocomplete, just physically.
I'm currently using packetevents for this, it works just the problem is the autocompletion
private void sendHidePacket(Player server, Player toHide){
try{
UserProfile profile = new UserProfile(toHide.getUniqueId(), toHide.getName(), new ArrayList<>());
WrapperPlayServerPlayerInfoUpdate.PlayerInfo info = new WrapperPlayServerPlayerInfoUpdate.PlayerInfo(
profile,
true,
toHide.getPing(),
GameMode.SURVIVAL,
Component.text(toHide.getName()),
null
);
EnumSet<WrapperPlayServerPlayerInfoUpdate.Action> actions = EnumSet.of(
WrapperPlayServerPlayerInfoUpdate.Action.ADD_PLAYER,
WrapperPlayServerPlayerInfoUpdate.Action.UPDATE_LISTED,
);
WrapperPlayServerPlayerInfoUpdate packet = new WrapperPlayServerPlayerInfoUpdate(actions, info);
Object usersChannel = PacketEvents.getAPI().getProtocolManager().getChannel(server.getUniqueId());
PacketEvents.getAPI().getProtocolManager().sendPacket(usersChannel, packet);
}catch (NullPointerException ignored){}
}
ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1);
ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS, 1);
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS, 1);
How may I add a color to leather armor?
LeatherArmorMeta
im trying to detect player left clicks and set a scoreboard accordingly for use in command blocks. Am I over complicating things, and would this even work? I've never made a plugin before lol.
@EventHandler
public void onPlayerAnimation(PlayerAnimationEvent event) {
if (event.getAnimationType() == PlayerAnimationType.ARM_SWING) {
Player player = event.getPlayer();
Bukkit.dispatchCommand(
Bukkit.getConsoleSender(),
"scoreboard players add " + player.getName() + " LeftClicks 1"
);
}
}
just use PlayerInteractEvent
and check if action is left click
but would that work with any type of left clicking? Like hitting an entity, air, breaking a block, etc
do you want left click or arm swing
breaking a block is counted as one click
left clicking
but if we are talking arm swing it would be counted as multiple
but yes, it would cover all of those things
animation event just isn't reliable enough to determine whether it was a click
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
use getAction to determine click type
how do cool kids prevent players from moving in a safe way these days? I know
- cancelling the movement event
- forcing them to mount a static entity
- setting their movement speed attribute to 0
but I don't like the first because it looks horrible, I don't like the second one in general and I don't like the third one because it's horribly unsafe in case of crashes and such
oh right and potion effects
but that doesn't really fully stop them
try setting velocity when player moves
Just velocity?
or just save the attribute value to a file before setting the attribute to 0
Use the saved attribute later
you run into the issue where a server can crash and then people boot it back up with the plugin removed
How a server crash can remove a plugin
arm swing animation also happens if u right click an interactable
like a door or button
or lever
etc
Well, you are just creating your own problems 💀
I don't think there are more methods
no difference
well actually if the first dot isn't escaped, then it will match any character
but I presume discord just removed the escape
slowness and jump 255
works really wel
l
its doing weird crap
sorry for dm just images not alowed to me
first one matches any character 0 to 7 times, second one matches a dot 0 to 7 times
it doesnt do that thats the problem
im trying to match any character in both
also space
Is this where I'd ask for someone to make a custom plugin for me.
oh it actualy does but if it matches it cancels other things out
i understand problem now
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
. stands for any character when in clouse
Anybody know where I'd post for needing a commissioned plug in?
yeah it makes a character set to match against
you can also put a backslash before the dot, that escapes it
Lmao thank you making my life easyer as server owner, since getting like 300 dms on how to forward ports or how to make server thats super anoying, im not google lol.
What effect is item pickup? Like effect for block breaking is STEP_SOUND
Did you even try? Should be
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html#ENTITY_ITEM_PICKUP
I think I tried that once in 1.19.3 but its not realitic (Single pitch)
Not knowing the values is a task in its self
So if you know where I can get these, that be helpful and I might can create a array. So it can get a value at random
I don't think you need to make an array... just call the Math.random or whatever
But you can take a look at vanilla source code. It's easy if you depend on NMS.
I don't want to use the NMS
I'm not telling you to use NMS, I'm saying that it's the easiest way for you to check the server code
Some guy used ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F to make the pitch I think
0.2f for volume it seemed. But the post is 13 years old, so idk if it's right :D
I might test that, thanks
Tested and it works
Nice
For future reference, I just googled "spigot item pickup sound" and got here
I don't want to increase anything but thanks
My intention with this message was to teach you a bit how to search this information yourself
I see. But I get more updated version of the code when I ask here
hows that the case when @smoky anchor just quoted something from 2012?
Event driven architecture with multiple components that might need to know about each other but have generally separate responsibilities sure is making my brain work
I keep getting a ticking block entity issue now that I've made changes to the populate method in my BlockPopulator, but I don't really understand what that means. Everything online about it pretty much says it has to do with mods, and that I need to restore an older version of the server or whatever, but I can't figure out what is causing it.
?paste can you paste the whole error and your BlockPopulator
Remember the PECS 
"but i have a list" :4head:
im going insane
does anyone know how to add libraries in intellij?
i need to add the Reflections library-- ive been adding it as a dependency and intellij seems to recognize it when im coding
but when i build the artifact... its just not there
when running the plugin, it errors "java.lang.NoClassDefFoundError: org/reflections/Reflections" and disables itself
I've been going around for half the day on the internet and everyone says "just add the maven dependency to the pom.xml" but I HAVE!
and it STILL doesn't compile to the artifact
You gotta shade it
right. how do i do that?
ive seen other people say the same thing
then say "just google it lol"
and then i do and i still dont understand
rip can't find it
Anyways you need to setup the maven-shade plugin in your pom
and remove the <scope>provided</scope> for anything that needs shading
i... cant upload files to this channel, but i have the maven-shade plugin and the dependencies that need to be compiled don't have a scope
?paste
also tried defining scope as compile
oh ty
I need both Commons and Reflections in the built artifact
but using the build command on intellij... outputs a .jar without either of the dependencies
so, if I need to shade those, how should I do that?
ugh, i think i found it
apparently, despite picking maven as my dependency manager, I have to use the maven build command instead of just the build command
is it against spigot rules to do a global ban database?
someone already tried that
more than once
problem is
its very hard to moderate
people can just bot report someone resulting in thmw being banned everyhwere
nah its not a global ban system more like trustfactor and also just a nice touch but not core of it
but when catdatabase
interesting idea
like ip scores?
more or less basic thing is a clone of gommehd guardin system
but before I do that imma get better with design patterns
But selling accounts would still become an issue wouldn't it?
if its an fresh account it has a good trust factor then yeah
fr
I wish there is some way I can have a inventory in a item either than setting its contents
Either you had a stroke or i can't read
lowkey though the same
Guy's just not very proficient in English
neither am i
...
I mean one can notice you aren't
Be careful trying to reply to people, there is a staff impersonator on the lose
I saw what they said
Saying that you shouldn't be tagging people unnecessarily does not mean they are trying to impersonate staff
I just want to hear that from a staff member their selfs because it might not be in the rules. And if its not like the rule became a thing, its just better that I hear it from the staff for updated info
Just because something isn't a rule doesn't mean it's not unnecessary, lol
I was just replying to people
Right and they said that tagging people unnecessarily like that is unnecessary and you shouldn't do it
So I cannot reply to people??
Talking about this
not what they said
That is what I did and they think it was pinging
replying pings the sender by default
I am starting to see why ppl block you....
only now? kek
Having a conversation is ILLEGAL punishable by DEATH
can't even be talking in 2025 anymore, smh
_ _
was about to say that
_ _
I just like to hear it from the staff members because people can say stuff completely false, that is my point. I was not trying to go against you but if you want to block me, I guess we don't have to talk. You would have said, you don't like to be pinged and I would not reply to your messages. Its just you said people and that is what set this off
Going from replying pinging to impersonating staff is a wild jump
frogger cant make that shit
... .- -- .
It's just common courtesy, pointless response doesn't need a ping
Frogs are my favorite animal
Wait omg he's gonna tell us we're talking about this in help dev and tell us to go to general even when choco is here doing the same thing
Maybe we should go there since the staff is there most times and I can get my point proven
kekw
Lets do that
what's the big deal?
I just wish they have a support system either than the forums. That can really help with times like this
@blazing ocean where pink
they're crying about the fact somebody told them to not unnecessarily ping people
gimme 1 minute
I not crying, I just annoyed
gonna have to extend that by a couple more minutes sorry bout that

discord not loading
If you need specific help then consider reaching out to the person directly
BUT you should only do that if the person's comfortable with that
For example I have a "Don't DM me unless work-related or asked for." because I find it annoying to be responsible for helping you
and if you have any issues now I'm on the hook to also fix those
@eternal night 
It's not even that. Person was asking for help, this guy ping replied literally with "..." Which imo is quite annoying
TL;DR - Ask in public, be patient and someone will answer you, being picky about who helps you is overall annoying unless it's a niche issue and you guys are friends
In which case you're probably comfortable enough to reach out over DMs
danke danke
looks a lot better
I going to start copying the message with my reply, thanks. If someone does not like that, have a staff member tell me. Otherwise, I see this server extremely strict
Belittling people by going "..." only shows you're ignorant
it does
server's not strict you're just dense
Imlllusion: Belittling people by going "..." only shows you're ignorantMaybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
What have I done...
lynxplay: MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
can we stop with these
Banning it outright is stupid
what kind of crybaby starts a whole war over pinging someone going "..."
rad: lynxplay: MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
can we stop with these
no, this is now an email chain
let's take it to email
lynxplay: rad: lynxplay: MrnateGeek: Imlllusion: Belittling people by going "..." only shows you're ignorant Maybe there needs to be a filter that blocking these messages since people has a HUGE issue with it
wtf is happening
can we stop with these
no, this is now an email chain
do we get a mailing list at least
Never have I thought that this would "blow up" this much
This is fucking stupid
spigot in a nutshell
wrong chat
I just noticed this isn't #general
once again
btw does bungeecord support hexcodes by now?
Since this is little relaxed I hope. I going to say this. It takes alot to make me cry, I have not cried in years. Since someone thinking this was #general , that is why I say to bring it there. Most people don't look at the #channel-name so they send a message to wrong channels. Its not a huge issue but this is what I wish to avoid
is this guy still going
has been since they joined spigot
:hollow:
no-one cares
@no-one
Someone needs to transform this channel back to what this is meant for, you know what I mean
bungee text messages do yes
No one is asking for help atm it really doesn't matter
i need help
but do I still need to do it like back then with patterns etc or is there a simple way by now?
Ping lynx 
"like back then with patterns" ?
unusualXRepeatingHexThing whatever it's called in adventure
Use unusual x repeating hex format
private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
public static String hexColor(String message) {
Matcher matcher = pattern.matcher(message);
while (matcher.find()) {
String color = message.substring(matcher.start(), matcher.end());
message = message.replace(color, "" + ChatColor.of(color));
matcher = pattern.matcher(message);
}
return ChatColor.translateAlternateColorCodes('&', message);
}
oh shit yea pretty close then
sir, this not paper!
we use whatever channel we want
(btw no hate to paper) !!
@lynx fix it
bungee components don't directly support #rrggbb when using translateAlternatewhatever, for that you need to use §x§r§r§g§g§b§b or keep using this pattern method
bungee components have supported rgb since rgb was a thing, but the format has and will always be ass
so like this wont work or what �bfff"Test"
Can any one help me with a plugin
no
😢
not simply with translateAlternateColorCodes

Plssss
damn
Ho
ho ho ho?
its not christmas rad
chill it's only like... march
but would it work with §hexcode? like hardcoded
PaperMC? You have to use either SpigotMC or PaperMC, no cross-compatibility
yeah , i use spigot
what about you?
sometimes i use paper too
again, you'd need to write §x§r§r§g§g§b§bfoobar
Either of them are bad but trying to get support from one while using another is impossible. Like I cannot use Paper if I want to ask here
I just shade all of adventure into my spigot projects
bro using adventure in spigot is too hard
i have to ammend uuid behind commands to prevent duplications 💀
I’ve only used it for one thing, colors
yeah same
adventure used to have a small minimessage->spigot package
yeah
they got rid of it and merged it with the big one
Mhm
what
It’s fucked
yeah for onclick
...
JSON it is then
hear me out... command with transaction id arg
idk when they added it
i did it like 2 years ago
i haven't used adventure after that
I just moved the color util to a general api so I don’t have to directly shade adventure
UUIDs are useful if you trying to prevent copies. I use this to prevent chests from stacking since its a portable chests (Can be accessed via right-click)
we know what UUIDs are
I don’t, please tell me more
Well dang
most of the bits
Sounds like a lot of work, and for that reason… I’m out
some bits are kept to tell what kind of UUID it is
Hold on I didn’t know there were “typed” uuids?
Example: b8b817a1-ebd2-4837-b901-7c892684d29a
UUIDv4
?
What are you trying to do?
make a joke dude
Keep in mind this is a PG-13 server

Show me a PG-13 rule?
If it makes you feel better, it made me laugh
'pee is stored in the balls' is not sexual nature omegalul
Discord is 13+ kek
ooh you are correct. I never fuckin knew that
True but would parents let their kids access adult content like porn? I don't think so
thats quite the ideological leap
Excuse me buddy but what?
You are a moderator btw.
That's why they are behaving like 13 year olds
why does this:
private static final char COLOR_CHAR = ChatColor.COLOR_CHAR;
public static String translateHexColorCodes(String startTag, String endTag, String message)
{
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
Matcher matcher = hexPattern.matcher(message);
StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
while (matcher.find())
{
String group = matcher.group(1);
matcher.appendReplacement(buffer, COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
);
}
return matcher.appendTail(buffer).toString();
}
sender.sendMessage(new TextComponent(ChatColor.translateAlternateColorCodes('&', Colors.translateHexColorCodes("&#", "", "This is a message with color &#FF5733some text and !FF57more text!"))));
returns the img code from (https://www.spigotmc.org/threads/hex-color-code-translate.449748/#post-3867804)
Your regex returns only one group I believe nvm, I can't read
Do you know a utils for create Config File or a MiniGameMapManager ?
Yep! I commented on out purely out of reaction, wanted to read through the entire convo before making any larger judgements ^^
First of all, StringBuffer iirc synchronizes so its slow, somewhat of a crime, im not sure exactly how appendReplacement works, maybe it only replaces the group a-fA-F09 so &# is skipped since its matched outside that group?
I mean if you know a better way im open for suggestions
thats start and endTag the group
?
the &#
anyone know why AnvilView#getRenameText returns null but AnvilInventory#getRenameText doesn't?
My IDE's throwing errors for the latter because it's deprecated and marked for removal, but only that one works
Put in: &#([a-fA-F0-9]{6})
Type in: 𛙩 (or whatever)
Hover over the blue (#&) is called Group 0
Hover over the green (112233) is called Group 1
String group = matcher.group(1);
group = 112233
i think thats what @ivory sleet mean
Regex101 is useful
so it should be like that? (&#[A-Fa-f0-9]{6})
But to be fair i saw into the method of appendReplacement and it should work. The replacement "worked" and "didnt worked" at the same time
yeah I dont know I know that there was a good lib for that but I dont rember its name
Can you tell me what the result should be?
just the string with the right hexcolor
Your method prints me: "This is a message with color §x§F§F§5§7§3§3some text and §x§3§3§F§F§5§7more text!"
I dont have your error, lmao
or you could just use https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.util.function.Function) and it'd be something like
static final Pattern HEX_PATTERN = Pattern.compile("&#([a-fA-F0-9]{6})");
HEX_PATTERN.matcher(string).replaceAll(match -> ChatColor.of(java.awt.Color.decode("0x" + match.group(1))).toString());
:p
That looks kinda sexy, one liner
doesnt work tho
wasnt there an api that was also be able to do like <color=#HEX>Message</color>?
you forgot to add the 0x
minimessage
but what you're saying is called minimessage and not a few hours ago everyone was like "ew bundling adventure 🤢" so idk do with that as you will
there's an easy solution to that, you'll just get bullied for mentioning it however
Deinstalling all IDEs and go out and be happy?
not quite it
Update? Did you add the 0x?
idk if the console logger supports random hex colors
Question. Which version you are currently on (Minecraft)?
its not logger
also windows and cmd/conhost is certainly a choice that will affect how that turns out 🌚
newest bungee
1.19 iirc
Would be funny if its now fixed
try doing it in-game rather than on the console
gimmi a sec
need to do a server then
why does build tools take so long
:peporage:
any command frameworks that work on 1.7.10?
brother bout to get smacked for that question
I just died after reading 1.7
thats is anno based
kk thx
Im not hating on the version unlike rad would but what you doing in 1.7
developing
yeah but pvp or what
MAYBeeee, acf still works on 1.7, like maybe maybe?
yeah pretty sure thats the one i was thinking of ngl
i just dont really understand arguments on acf
nah fuck this shit it was bc of fucking console
yea
also what is this game by now
I spawn somewhere in a fake swamp
wtf is a closed eyeblossom
final float yaw = location.getYaw() + 90;
final float pitch = location.getPitch();
final float roll = 0.0f;
Bukkit.broadcastMessage(ChatColor.GREEN + "Yaw: " + yaw + " Pitch: " + pitch + " Roll: " + roll);
spawned.setHeadPose(new EulerAngle(pitch, yaw, roll));
does anyone know the math to convert yaw and pitch to a EulerAngle?
final double yawRadians = Math.toRadians(location.getYaw() + 90);
final double pitchRadians = Math.toRadians(location.getPitch());
final double rollRadians = 0.0;
EulerAngle headPose = new EulerAngle(pitchRadians, 0, -yawRadians);
spawned.setHeadPose(headPose);
this should do the trick (not tested)
ive already tried that haha it does some funky stuff
i cant get pitch working properly
if i delete the player data (only one players data) from the folder of the main world this stats too will become null right PLAY_ONE_MINUTE?
can you even use minimessage on bungee?
What packet is sent to the player when an item pops up into an item frame?
Metadata
PacketPlayOutSpawnEntity
or EntityItemFrame,
First one spawns the entity second one is the entity class
Neither of them sets the item
yes
thanks
How can i get the DataWatcher of an EntityItemFrame? is there some tool that show me the real names instead of these shitty obfuscated letters?
paper userdev is cool
spigot has some specialsource shenanigans, i think they do support remapping
The item frame already exists
i just want to set an item
and bcs the mappings have changes, i cant find the ID of the entity and i cant find the data watcher or if that has changed i cant find anything xddd
there's this if you want to look at the mappings manually
the search is kind of shit and 99% of the spigot mappings are missing, but you can probably make do with just obf and mojang names
itemFrame.setItem(new ItemStack(Material.blah blah);
or whatever alias you used for your mappings
also yes it's worth considering if you can do this through the api instead of nms/protocol
what are you trying to do exactly?
if it’s nms you’ll need to manually look
at these
I want that each player sees his own itemframe
kind of a key to a portal
so they have to input the item to unlock a portal
and each player has its own keys
if you're on paper (or maybe spigot has that now) you can use the entity visibility api to have a separate entity for each player, and have each player only see their item frame
lol
set the default visibility of the entity to false and add the player to the exception list with player.showEntity()
sure
you spawn an entity for each player
so every player sees "the entity"
just the data is different for each player
on use does it change the item in the inventory and is there a way to save that data so you know if they activated/deactivated the portal?
but doesnt that lag when there are many players and many item frames?
shouldn’t be a issue unless you have bad hardware
if you have say 100 item frames you want to show and 20 players looking at them there'll be 2000 item frames, which is a decent bit but shouldn't be catastrophic
idk i kinda want the packet thingy to work
are you on paper?
craftbukkit nms would be something for you
no, but they have userdev which is a very convenient and durable way of working with nms
paper does indeed have packets
sounds good but i want the bukkit packet working first so i learn how it goes
minecraft, even
no need to fuck with obfuscation or mappings or protocollib; you'll have documented mojang mapped source to work with
i mean they have the packet classes things yk? The SpigotAPI doesnt have it but Spigot itself
"documented" is a bit of a stretch
true, i use protocollib for my animation manager 😭
you can call regular spigot just the documentation is different and vague
e.g. you can just do new ClientboundAddEntityPacket() and send it to the player
in paper?
using userdev, yes
you'll get compile time errors, linting, and autocomplete suggestions, instead of having to look at wiki.vg and the minecraft wiki and trying to guess what goes where
i love paper.
heretic
:)
my old code had like less than 100 lines now my new code has 500 am i cooked
(its protocollib)
or you can get the nms itemframe and call getEntityCreatePacket() and it generates the correct packet to send
sending the metadata was a bit more involved iirc but that was just a handful of nms calls as well
alr lemme try paper things but then im on the wrong discord
sigma
bro wtf
you can clone this and you should have everything you need out of the box
it uses gradle because paper devs are fucking hipsters with nothing better to do
im also using gradle... :(
i use maven 😈
and here's a guide on it
the best thing about userdev is that since the paper server jar uses mojang mappings now, your nms plugins don't break every version as they would if you wrote them against obfuscated nms
so unless mojang actually changes some method definition somewhere or removes some class, the plugin will work across version changes without even having to rebuild it
so why do ppl still use spigot when paper has so much features?
muh tnt duper
spigot is more common than paper in the beginning of deving 😭
atleast when i was learning
paper's marketshare is like 70% or more of recent versions now i'm pretty sure
quite a few plugins have dropped spigot compatibility altogether
so you would use a typewrite when there are computers now days?
wasnt there even a site where you get a bit money for each download but it only supported paper plugins?
i think the biggest issue people have with paper is that the devs can be pretty prickly and make strangely motivated design choices like deprecating all § formatting strings everywhere and going hard on preferring adventure
apart from that it's probably the number of exploits like tnt dupers and bedrock breaking that they've patched; some servers don't want that
well i started in 2014
the new api is also marked like 80% experimental so my entire ide window is yellow from "this is experimental" warnings when i work on anything post 1.19
depends if I want it to have it analog and secure then yes
aah ik what you mean, i had to disable it or i would have gone insane
implying a piece of paper is more secure than E2EE
how can i open the enchanting table with a stack of lapis?
openEnchanting + get inventory.setslot lapis?
but which number?
for the setslot
Can cast and use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EnchantingInventory.html#setSecondary(org.bukkit.inventory.ItemStack)
declaration: package: org.bukkit.inventory, interface: EnchantingInventory
But probably slot 1
googling "minecraft inventory slot numbers" also shows you the numbers
it's either slot 1 or 2 iirc
the numbering scheme isn't consistent across inventories; old guis like the crafting table and furnace have the output slot as slot 0, and input slots left-to-right starting from 1
"modern" guis are left-to-right starting from 0, and iirc enchanting table is one of them
apparently the enchanting table doesn't have an output slot 🤡 i completely misremember what it looks like; but yes, it's slot 1
?paste
Why does this always returns null, looking at the item frame also:
https://paste.md-5.net/fomoheneda.coffeescript
What message is there
RacTrace null
misspelled
oh wait
now something has changed
It does hit the player lol i need to filter it...
Is there any event like CraftItemEvent, which fires only when you pick up an item after craffting?
What is the exact usecase? Once the recipe is done, there isn't much you can do
To provide advancements and such, like when you craft 1000 stick you are "THE STICK MASTER"
smth like that
or can you already do that
uuuh
you can listen to the statistic increment event on that
i sort of remembered that the craftitemevent would only fire when you actually take the item out because only then is the thing crafted, and that there'd be a CraftPrepareEvent or something for when the recipe in the grid is completed
but it looks like i remember wrong
CraftItemEvent is kinda sus, it fires even when u click a crafted recipie with a full stack of items on cursor
Well it is just a fancy InventoryClickEvent
So i got packets working with the mojang mappings. I heard that its against the eula or something to use these mappings in production. Couldnt i just obfuscate my whole plugin instead of implementing a tool that obfuscated the mojang mappings again?
it's fine to use a mojang-mapped plugin
redistributing a mojang-mapped server isn't
which is why paper builds an obfuscated server and then remaps it
myes
but you may not redistribute the mappings complete and unmodified
is the only restriction on them
that's why paperclip grabs the regular vanilla server from mojang, which is fine
and then applies the paper patches, which are distributed in the paperclip jar
that doesn't sound like building an obfuscated server and then remapping it
so i just obfuscate everything
but sure
remapping comes after that, yes
hm?
the end result is a mojang-mapped paper server
does this sentence tell me its not allowed to redistribute the mappings in my plugin?
that's not what it means
You cannot include the mappings file in your plugin
your plugin can reference the mapped names just fine (I am not a lawyer jada jada jada)
paper takes care of applying the mappings
what
should've just used yarn smh
so i can just code with the mappings and be fine?
yes
thanks
do note, running a plain mojang mapped jar will only work on paper
spigot does not support that, you'll need to reobfuscate
so how can i do this? I heard abt a maven plugin but im using gradle and i dont know how to include it there xd
?nms
jeff-blog.media
has a "when using gradle" part
lol thanks
see the gradle build in the userdev test plugin i linked
// Only relevant for 1.20.4 or below, or when you care about supporting Spigot on >=1.20.5:
/*
reobfJar {
// This is an example of how you might change the output location for reobfJar. It's recommended not to do this
// for a variety of reasons, however it's asked frequently enough that an example of how to do it is included here.
outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
}
*/
uncomment this, basically
Spigot has it's own way, I'd go with this if they target spigot
this reobfuscates the plugin, which will work 1:1 on spigot servers (and get mojang-mapped again on paper servers at runtime)
also an option
As I about to insert this new Toshiba HDD into my dock, I see this. Don't tell me there is another spigot
hes talking about paperweight defaulting to not running reobf anymore
so hes probably saying use the gradle plugin listed on the ?nms command as its more targetted to spigot
update on the custom mobs, i made this example that seemed to work; the wither skeleton only targeted cows
I was wondering how to make the target goals conditional
eg: Targets entities only if they are type player, and belong to specific faction ID
public class CustomWitherSkeleton extends WitherSkeleton {
public CustomWitherSkeleton(Level world) {
super(EntityType.WITHER_SKELETON, world);
this.collides = false;
this.expToDrop = 0;
this.goalSelector = new GoalSelector(world.getProfilerSupplier());
this.targetSelector = new GoalSelector(world.getProfilerSupplier());
this.setInvulnerable(true);
this.setCanPickUpLoot(false);
this.setAggressive(false);
this.setCustomNameVisible(true);
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, true));
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Cow.class, true));
}
}
Make your custom goal
gotcha, any docs i can look at for that ?
cute pfp
I'm trying to make a game selector. Imagine; as a lobby, we spawn players in the void and there is 3 galaxy schematics standing next to it. I want to lock the mouse cursor of player. For example, If player move its mouse to left, we should lock the cursor at the galaxy on the left, If player move its mouse to right, we should lock the cursor at the galaxy on the right. Is there any way to do it without having glitched perspective?
Time for spectator hack ?
I can't even think of a way right now
@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
Vector upwardBoost = new Vector(0, launchStrength, 0);
player.setVelocity(player.getVelocity().add(upwardBoost));
Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
player.setVelocity(new Vector(0, -slamStrength, 0));
for (Entity entity : player.getWorld().getNearbyEntities(player.getLocation(), radius, radius, radius)) {
if (entity instanceof LivingEntity && !(entity instanceof Player)) {
((LivingEntity) entity).damage(damage, player);
}
}
}, 20L);
}
Why doesn't it damage any mobs?
The velocity thing works
and i can hit mobs with hand and other stuff
Try logging information about the entities in the loop to make sure that it's grabbing a list of entities.
ok
You grab your entities 1 second later after using the item & getting the boost
So the player location is in the air and not on the ground. Depending how fast he travels in the air and how big the radius is you never grab the entities on the ground
Do you think this is enough it fix this?
@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
Vector upwardBoost = new Vector(0, launchStrength, 0);
player.setVelocity(player.getVelocity().add(upwardBoost));
Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
new BukkitRunnable() {
@Override
public void run() {
if (player.isOnGround()) {
player.setVelocity(new Vector(0, -slamStrength, 0));
for (Entity entity : player.getWorld().getNearbyEntities(player.getLocation(), radius, radius, radius)) {
if (entity instanceof LivingEntity && !(entity instanceof Player)) {
((LivingEntity) entity).damage(damage, player);
}
}
this.cancel();
}
}
}.runTaskTimer(BetLeftyItems.INSTANCE, 0L, 2L);
}, 20L);
}
Nah you misunderstood
Just save the player location before running the runTaskLater
@Override
public void onPlayerInteract(Player player, PlayerInteractEvent event) {
Vector upwardBoost = new Vector(0, launchStrength, 0);
player.setVelocity(player.getVelocity().add(upwardBoost));
Location boostLocation = player.getLocation(); // Position where he used the boost
Bukkit.getScheduler().runTaskLater(BetLeftyItems.INSTANCE, () -> {
player.setVelocity(new Vector(0, -slamStrength, 0));
for (Entity entity : player.getWorld().getNearbyEntities(boostLocation , radius, radius, radius)) {
if (entity instanceof LivingEntity && !(entity instanceof Player)) {
((LivingEntity) entity).damage(damage, player);
}
}
}, 20L);
}
Is your goal like a pressure wave that damages nearby entities like a rocket start or something?
It's like player goes up and comes down with high velocity dealing damage to nearby enemy
nothing else
more velocity = more damage didn't add it yet
Okay just a tip, dont say it isnt working. Tell next time your goal and then the code. Because from the code its look like a pressure wave damage. But that was my mistake to not ask
okay 👍
@EventHandler
public void onEliteDeath(EliteMobDeathEvent event){
if (extractionMatches.isEmpty()) return;
String spawnPool = (String) event.getEliteEntity().getCustomData(new NamespacedKey("betterstructures", "spawnpool"));
if (spawnPool == null) return;
for (LootTablesConfigFields value : LootTablesConfig.getContentPackages().values()) {
if (value.getSpawnPools().isEmpty()) continue;
if (!value.getContainerPools().contains(spawnPool)) continue;
for (LootTablesConfigFields.LootTableEntry lootTableEntry : value.getLootTableEntries()) {
if (ThreadLocalRandom.current().nextDouble() < lootTableEntry.chance()){
HashMap<String, Double> weighedMap = new HashMap<>();
for (LootPoolsConfigFields.EliteLootPool eliteLootPool : lootTableEntry.lootPoolsConfigFields().getEliteLootPools()) {
weighedMap.put(eliteLootPool.filename(), eliteLootPool.weight());
}
String result = WeightedProbability.pickWeighedProbability(weighedMap);
CustomItem customItem = CustomItem.getCustomItems().get(result);
if (customItem == null) {
Logger.warn("Failed to get loot " + result);
continue;
}
customItem.dropPlayerLoot(null, event.getEliteEntity().getLevel(), event.getEliteEntity().getLocation(), event.getEliteEntity());
}
}
}
}
the actual jankiest code I've ever written
I have plugins injecting data into other plugins to randomize from like 5 different config file systems across hundreds of config files to try to get this to work
ugly ass code
shittalk
I would fix it but I'm off to the gym now
I hope your gym training is more structured and better done than the code :c
Do we get a update after gym when you fixed the code=
no, you don't deseve it
Hey :c
how come a bunch of item meta functionality was removed in spigot 1.21.4? that was present in 1.21.3?
like setGlider or setTooltipStyle
Those still exist in the api?
is there a shortcut on intellij to bind parameters to fields?
ctor generation?
alt-ins > generate constructor
can also bind that to a key
not sure how I improve the randomness of world shaping so isn't so much sameish
it lacks mountain / hils my world gen
if anyone know i can improve my terrain please tell me
just use noise like a normal person
I mean you can implement it yourself if you want
i still havn't work with world generation before
i should switch to spigot noise generator instead 100%
Hello! How can I make two different servers connect to the same server? For example, I have Server A and Server B, and I want everyone who joins either of them to be directed to the same world and play together, even though they connected through different servers.
anyone who got an explanation of how it works with these noises
the wiki has a decent one
please link me
💀 gosh me
do you mean like 2 proxy server fx bungeecord?
to minecraft server?
is there a way to turn a ConfigurationSection into a YamlConfiguration?
im trying to separate a section from a file, and place it into another file
but i cant really see how to use ConfigurationSection properly
is there another way to get all values in a section?
yamlconfiguration is a file, a ConfigurationSection is a section inside the file
have just the thing for you
👀
ill check it out, ty
what's the proper way to maintain backwards compatibility with the enum changes to Particle and Potions, etc across 1.20 and 1.21? I can't find a mapping of them, for example what's the new name for Particle.SPELL_MOB?
Build against the oldest version you want to support
no way u made Tutorials
frostalf is the type of person to have experience with everything in this world
But what Oliver said, build against oldest version you want to support
except intellij
oliver!? you mean olivo!?
lmao
Sorry olivo
👀
that is a crazy insult to olivo
Please forgive me
Hawkfalcon originally created it, then I joined his project and it eventually just became all my code. Then he gave exclusive rights to me after he decided to kind of leave the scene
so yes I did create ServerTutorial, but not originally
As of right now, there was one other person who pr'ed some stuff
but now it just sits there being neglected but many people have forked it I think lol
created back in 2013
Hello, I am trying to make an bar above hunger bar which can display power, I have full power system but I can´t get throught this someone know how to do it?
You'd use the actionbar
I´ve tried but it doesnt work
Does work
Can I send you picture how I want it
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
So make action bar with custom characters and space them?
