#paper

1 messages ยท Page 20 of 1

rustic folioBOT
rustic folioBOT
#

Resolves #11395

Introduced a RotationResolver to handle rotation arguments and added related methods to ArgumentTypes, and argument provider classes. This enables resolving and processing rotation data using CommandSourceStack.

The Vector2f in RotationArgument was just a temp solution because I wasn't sure on whether to add a rotation object that clearly combines a yaw and pitch

rustic folioBOT
#
[PaperMC/Paper] New branch created: feat/tripwire-dupe-option
rustic folioBOT
#

Oddly enough I have not been able to reproduce this today, even though it had 100% reproduction rate yesterday. It may have been something that was resolved by rebooting.
I tried to replicate the same environment as yesterday, eg. running from battery (GUI used weaker GPU then).

java -version output:

openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)

Windows 11 24H2 (build 26100.3037)
iGPU_0: AMD Radeon(TM) Graphics provided by AMD Ryzen 5 4600H
iGPU_1: NVIDIA GeForce GTX 1650 (Laptop one)

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Hello ๐Ÿ‘‹๐Ÿป currently there is no way to know if a teleport failed due to a player having passengers. Which means if any plugin uses player.teleport() the teleport fails. This is a huge problem as it prevents compatibility between plugins.

Describe the solution you'd like.

I would like to see a PlayerTeleportFailedEvent added to paper. This means that when a teleport fails we could handle the passengers correctly and then re-teleport the player to enable the functionality again.

Describe alternatives you've considered.

I have tried the PlayerCommandPreprocessEvent to listen in on commands that teleport the player although this is limited as it means every single command needs to be manually added and there is no way to detect plugins that use it in other cases.

Other

I did find that there was a pull request for this exact feature #10173 and even though it had a lot of engagement it was never added ๐Ÿ˜Ÿ

#

This is basically a duplicate of; #10168

The concern is that a failed event doesn't allow people to correct the event outside of re-teleporting, which breaks the whole causation aspect; so, a failed event is pretty meh as an overall solution here

I am a little bit unsure of what you mean in the second part. I am not sure there is any other way currently than detecting the fail, removing the passengers and then re-teleporting.

#

The goal would be to allow plugins to intercept before that and determine to set flags or correct the issue beforehand

Oh I see sorry, basically the same outcome just a different way of doing it. I could have a go at a PR. I was thinking maybe detecting if the player has a passenger or is in a vehicle and then firing an event before the teleport so it can be handled before the player is teleported. Would that be a better approach? ๐Ÿ˜

#

There was some discussion about this here on discord:
#paper-contrib message

Generally it seems like the consensus was to simply align with vanilla here, by allowing teleports with passengers by default. Its weird that Paper/Craftbukkit deviate from vanilla here.
Then such an event would no longer be needed, and a plugin actually wanting to do the opposite and prevent teleports with passengers could cancel the already existing teleport event.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Yeah The whole shulker thing is a bit more nuanced due to the need for it to be distinctly different than a chest with GENERIC_9x3. In the interest of trying to keep this PR focused on adding default titles, this will need to be addressed in a PR where I rewrite the opening logic that Bukkit does. Long story short getNotchInventoryType isn't actually smart enough to identify the difference between a shulker box and GENERIC_9x3 as they'd be created with this API. The way around this is to define and force the use of the BlockEntity for now* The chest is okay to avoid this because it is a GENERIC_9x3.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

getAttachedBlock() method should return the block the arrow is attached to

Observed/Actual behavior

the getAttachedBlock() method always returns air if the arrow is attached to a solid block

Steps/models to reproduce

  1. shoot an arrow into a solid wall
  2. run arrow.getAttachedBlock() after it hits the wall
  3. wrong block

but if you shoot a non-solid block it is fine
Image

Plugin and Datapack List

Server Plugins (5):
Bukkit Plugins: packetevents, Skript, skript-reflect, ViaBackwards, ViaVersion

There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
There are no more data packs available

Paper version

This server is running Paper version 1.21.4-144-main@edacfdf (2025-02-09T10:56:49Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version

Other

No response

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Redstone dust should work at any height

Observed/Actual behavior

Redstone dust does not function at Y 319 when the redstone-implementation is set to ALTERNATE_CURRENT.

Steps/models to reproduce

Steps to reproduce:

  1. Set the redstone-implementation to ALTERNATE_CURRENT in paper-world-defaults.yml

  2. Place redstone dust at Y 319 (max build height)

  3. Power the redstone

Image

Plugin and Datapack List

No plugins, no datapacks

Paper version

ver
[23:39:39 INFO]: This server is running Paper version 1.21.4-144-main@edacfdf (2025-02-09T10:56:49Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version

Other

No response

#

I was thinking about something along the lines of this:

+            EntityType.CREAKING, EntitySpawnReason.SPAWNER, level, blockPos, 5, creakingHeart.getDistanceCreakingTooFar() / creakingHeart.DISTANCE_CREAKING_TOO_FAR * SPAWN_RANGE_XZ, creakingHeart.getDistanceCreakingTooFar() / creakingHeart.DISTANCE_CREAKING_TOO_FARcreakingHeart.DISTANCE_CREAKING_TOO_FAR *SPAWN_RANGE_Y, SpawnUtil.Strategy.ON_TOP_OF_COLLIDER_NO_LEAVES, true // Paper - handle too far distance for avoid spawn out of limits
rustic folioBOT
#
[PaperMC/Paper] branch deleted: feat/tripwire-dupe-option
#

I am a bit confused regarding the usage of this method.

Simulating the spawning behaviour of an entity type is something that might be useful API, but I don't think I'd want it to live in random block state types like this.
Developers can very well just spawn a creeking and set it via the setter.
The spawnProtector method really doesn't do more than spawning it + game events.

#

I'd be in favour of potentially adding extra API to increase the spawn radius down the line, for now I am unsure if we need this? The most important usecase I see for this is reducing the range.

I am fine with the min here to avoid the look of spawning one outside the rage and have it die immediately.
Scaling it is a nice idea, but I think I'd prefer extra API.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

The only way this seems to be fixable is by checking for entities in the players line of sight as there doesn't seem to be a reliable way to distinguish an actual UseItemPacket from one that is falsely sent by the client in this case

I am fine with this solution, I mean line of sight checks are already used in player interact event for arm swing packets IIRC

rustic folioBOT
#

Hello! I encountered the exact same issue on my 1.21.3 Paper server. After some observations, I upgraded to 1.21.4 (most recent build), though it didn't fix the issue either.

After some trials & errors with my plugins, I discovered it was caused by HeadsPluginAPI. I'm not sure how it causes it, but on my side it was what caused those errors.

I'm guessing it is due to some incompatibility between some plugins and Paper๐Ÿ‘

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

The header documentation on https://jd.papermc.io/paper/1.21.4/io/papermc/paper/tag/PreFlattenTagRegistrar.html gives example code for creating a new tag but does not include the definition of the tag itself, just how to give it a value. The original PR included this bit of code which is missing:

public static final TagKey<ItemType> AXE_PICKAXE = TagKey.create(RegistryKey.ITEM, Key.key("test", "axe_pickaxe"));

Observed/Actual behavior

Non-functional example due to missing variable definition.

Steps/models to reproduce

Look at the documentation, try to use the example to make your own tag.

Plugin and Datapack List

N/A

Paper version

N/A

Other

No response

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

OfflinePlayer#getPlayer should return a valid Player instance at the moment it is called.

Observed/Actual behavior

OfflinePlayer#getPlayer created when the player was online and has since logged out and logged back in will return an outdated Player instance.

Steps/models to reproduce

  • Bukkit.getOfflinePlayer when the player is online.
  • Player logs out and logs back in.
  • OfflinePlayer#getPlayer and try something like Player#openInventory.

Plugin and Datapack List

None.

Paper version

1.21.4-147-main@3bd69f2

Other

I'll start off by saying that I am not sure if this is intentional or not, so if it is then apologies.

Because Bukkit.getOfflinePlayer returns the Player instance itself when the player is online and Player#getPlayer returns this it can be an unexpected behavior. This makes it so if you are expecting an OfflinePlayer but want to do something extra if they are online, like sending a message, but the...

rustic folioBOT
#

Is your feature request related to a problem?

I don't know of any reason why you can't pass your Scoreboard implementation to player#setScoreboard
In fact, this artificial restriction creates big problems for developers
For example: I want to โ€œmergeโ€ two Scoreboards (previous and new) using the previous one as a reference.
This is done when I want to leave the logic of another plugin and merge it with my own. People bypass this by making terrible implementations with ReflectionAPI, etc.
Example:

final class MergeScoreboard implements Scoreboard {
    private final Scoreboard left;
    private final Scoreboard right;

    MergeScoreboard(final Scoreboard left, final Scoreboard right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public Team registerNewTeam(final String name) {
        final Team l = this.left.registerNewTeam(name);
        final Team r = this.right.registerNewTeam(name);
        return new MergeTeam(l, r);
    }
}

...

rustic folioBOT
#

Generally I like the cleanup, passing the cause like this is a lot nicer.
The thing I am a bit confused on is the withers/setters in DamageSource now.
Some are withers, e.g. perform a copy, others actually mutate the instance.
It seems semi arbitrary, presumably this is fine like this as the setters are only called on instances copied prior, however that feels pretty much like we are asking for an explosion down the line given the inconsistent behaviour here.

The two setters, critial and customBlockState, are I think not in a hot enough code path where the one extra copy of a damage source (which involves 0 deep copying anyway) would be a problem.
Are there other reasons I missed as to why you decided to make them setters?

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Currently, it is not possible to use world presets outside the ones defined in the WorldType enum
It would be extremely helpful for creating worlds with custom generators and world height (or other values defined by a world preset)

For example: right now, it is not possible to modify the world height without affecting all other worlds or some very hacky java code

Describe the solution you'd like.

Expose the world presets by replacing the WorldType enum with an interface reflecting the registry content similar to how the Biome enum was replaced

Describe alternatives you've considered.

Other

No response

#

For example: right now, it is not possible to modify the world height without affecting all other worlds or some very hacky java code

You can easily override Minecraft stuff using datapacks. For height you just put this file https://github.com/InventivetalentDev/minecraft-assets/blob/58d92c8cee4c7ac22d02988fb2bc3e4648af9ef2/data/minecraft/dimension_type/overworld.json#L9 with modified height, which will override the height for the world

#

You can easily override Minecraft stuff using datapacks. For height you just put this file https://github.com/InventivetalentDev/minecraft-assets/blob/58d92c8cee4c7ac22d02988fb2bc3e4648af9ef2/data/minecraft/dimension_type/overworld.json#L9 with modified height, which will override the height for the world

This is exactly what I don't want to modify as this also affects all other normal worlds on the server which isn't optimal

rustic folioBOT
#

udp: I'll try to make this change in CraftBukkit first.

Also, do not that CraftBukkit died in 2014. You will find only failure in that change attempt. We no longer update based on any upstream but Minecraft itself, so changes you wish to see in Paper would need to be proposed in Paper.

Eh, I guess you're right, but my last CraftBukkit commit was merged into Paper, I thought you were updating. About the artificial limitation, perhaps I shouldn't have been so unsubstantiated, the problem turned out to be quite serious

#

kinda, I'm fine with it being read only for now but what I want is to be able to use all world presets which are present in the registry (i can add them myself with a datapack)

I'm specifically talking about world presets not dimension types as they are already present in the bukkit api in the form of the WorldType enum so it wouldn't require additional api just some small changes

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Haven't tested but just a thought to make sure. considering in the vanilla logic we would popresource i times that would produce multiple items on the ground that are not immediately bundled together right? though since we just creating one itemstack with i amount here those would all immediately be bundled together when they get spawned. not sure but just going to leave it here so we don't overlook it

rustic folioBOT
#

It appears paper has now added HopperInventorySearchEvent, however InventoryMoveItemEvent is still "broken". Now that I thought about it some more I think, it would be way more efficient if "protection" plugins just used HopperInventorySearchEvent, set target inventory to null and set cooldown, instead of doing processing in IMIE where stacks are already being processed.

And if plugins move from IMIE to HopperInventorySearchEvent, IMIE functionality could be restored so that IMIE is fired for every slot and that could be extended even further so that item taken from source inventory is actually item passed over by getItem from IMIE.

I've only added support for changing item amount (for even better implementation IMIE and its extended Paper's IMIE should check if not only getItem but also setItem was called and adjust items accordingly), just the change that restores full IMIE functionally and allows plugins to change amount of moved item would look like this:

![image](http...

rustic folioBOT
#

I wonder whether this may be related to a problem I'm seeing with FancyHolograms. Sometimes when I disconnect and reconnect within about 10 seconds the holograms disappear and won't reappear. Once in a while I can get these to reappear by moving away, but usually I have to restart the server for the holograms to start working again. The plugin doesn't show any issues with being loaded and everything looks normal in its DEBUG output. The holgrams are still available for editing and manipulating via commands, they just don't render.

Also, is it possible that this is related to #12107 ?

#

The only way we could technically "fix" this is with a new offlineplayer implementation that implements Player as well but, instead of being a CraftPlayer, has a Weak<Player> ref and then delegates all player method to that.

Idk if that is worth it for us to maintain when plugins could just not keep an offline player reference around and instead use a uuid.

#

I still wonder, why CraftPlayer even has an override of getPlayer, instead of letting it just get the player from CraftServer as per CraftOfflinePlayer impl? Player interface doesn't override the javadocs, indeed making it a conflicting undocumented behavior change when player object becomes invalid. While if player is online, it wouldn't have changed at all if it would have just request it from the player map and return the same instance

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

I tried to reproduce the tripwire hook duplication glitch as in the attached video. In vanilla, the bug still works, but with the latest version of PaperMC that I've attached to this request, it no longer does.

I've enabled the option in the configuration and reloaded the server:

skip-tripwire-hook-placement-validation: true

Observed/Actual behavior

Despite this, the duplication doesn't work. For everyone on the server, in version 1.21.4-150-main@46f4fda 1.21.4-R0.1-SNAPSHOT, the bug doesn't work either.

Can you confirm whether a fix has been applied to this version, or whether there's some other action to be taken?

Thank you in advance for your feedback.

Steps/models to reproduce

https://www.youtube.com/watch?v=syjbP8r8qx8

Plugin and Datapack List

0 Plugins

Paper version

1.21.4-150-main@46f4fda 1.21.4-R0.1-SNAPSHOT

Other

No response

rustic folioBOT
#

This is known.
Pick another farm that does not rely on the same-tick door update to break the thing for a temporary "fix".

It is caused by another fix to the block physics API. Obviously not ideal, but fixing that bug is even more difficult and, if a dupe is the only thing broken by it, just not at the top of the priority list.
Someone may care to investigate but, this option is in unsupported for a reason.

rustic folioBOT
#

I think CraftPlayer returning a player from craft server would be an okay "fix", maintaining a new implementation definitely doesn't seem worth it.

But yeah plugins should be using uuids instead. I found this issue on a plugin because of a completely different problem where attempting to open an inventory on an outdated player instance overrides the inventory holder if they had another inventory opened at the time and now could take items from said inventory.

rustic folioBOT
#

I don't think we can do that? That way Player#getPlayer would return the "updated" player too, which seems wrong.
The entire idea of keeping the OfflinePlayer of an online player around is just so wrong, I don't think we'd wanna encourage it by fixing things for that exact usecase.
I think this might just be on plugins to fix sadly.

Thank you for the report anyway, sorry if the resolution isn't what you were hoping for!

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Stack trace

Caused by: java.util.NoSuchElementException: No value present
        at java.base/java.util.Optional.orElseThrow(Optional.java:377) ~[?:?]
        at io.papermc.paper.util.ItemComponentSanitizer.dummyEnchantments(ItemComponentSanitizer.java:59) ~[paper-1.21.4.jar:1.21.4-151-9b9de82]
        at io.papermc.paper.util.ItemComponentSanitizer.lambda$static$0(ItemComponentSanitizer.java:30) ~[paper-1.21.4.jar:1.21.4-151-9b9de82]
        at net.minecraft.Util.make(Util.java:596) ~[paper-1.21.4.jar:1.21.4-151-9b9de82]
        at io.papermc.paper.util.ItemComponentSanitizer.<clinit>(ItemComponentSanitizer.java:28) ~[paper-1.21.4.jar:1.21.4-151-9b9de82]

https://pastes.dev/Zt43fOLbEs

Plugin and Datapack List

Disabled the vanilla datapack & removed all enchantments from mine

Actions to reproduce (if known)

  1. Disable the vanilla datapack
  2. Add a new datapack that contains the things vanilla requires (tags, some worldgen etc), but crucially no enchantments...
#

Lets you create custom dimension types and levelstems. This hooks into the vanilla way of creating new dimensions by modifing the levelstem registry.

This can easily be used to just break worlds as you can modify existing worlds, like change the overworld to use the nether-like chunk generator and the overworld will just switch.

Resolves https://github.com/PaperMC/Paper/issues/12110


I like the pattern I added here for copyGeneratorFrom since I don't want to add all needed API to create instances of chunk generators, so this just allows you to copy it from elsewhere. We can use this in future registry API when we don't want to go all the way.

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Cancelling the events causes the arrow(s) to not be consumed

Observed/Actual behavior

The arrows are consumed anyways

Steps/models to reproduce

Cancel EntityShootBowEvents or ProjectileLaunchEvents and fire a bow or crossbow and observe your arrow stack count/the crossbow unloading without firing an arrow.

Plugin and Datapack List

only testing plugin

Paper version

1.21.4#152

Other

This happens because the arrow is already removed from the inventory/crossbow before the events are even called

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

I am developing a fishing plugin and would like to implement fishing in lava.

However, the TagKey<Fluid> referenced by the NMS FishingHook class is hardcoded. To allow fishing in lava, I would have to completely reimplement the vanilla water fishing mechanics from scratch. This would require significant effort and could negatively impact server performance.

Describe the solution you'd like.

  • Add a TagKey<Fluid> field to the FishingHook class and set its default value to FluidTags.WATER.
  • Modify references to FluidTags.WATER within the FishingHook class to use the newly added field instead.
  • Add two methods to the Bukkit FishHook class:
    • TagKey<Fluid> getBobbingFluids()
    • void setBobbingFluids(TagKey<Fluid> fluids)
  • Implement these methods in CraftFishHook. (Would parsing with PaperRegistries.toNms be the appropriate implementation?)

I considered adding this as a World Configuration option, but sinc...

#

Expected behavior

disable-tripwire-updates should cancel all tripwire block state updates completely

Observed/Actual behavior

The option correctly cancels updates related to other tripwire blocks placed nearby and entities stepping on it.

It does NOT cancel updates from tripwire hook blocks, which change the attached state property of the tripwire โ€” that's a bug.

Steps/models to reproduce

  1. Set up a paper server
  2. Change the block-updates.disable-tripwire-updates option in paper-global.yml to true
  3. Start the server and join the world
  4. Place two solid blocks 3 blocks apart
  5. Place tripwire hooks on the sides of the placed blocks facing each other
  6. Place a string inbetween them
  7. The string will have the attached state property changed to true โ€” bug

Plugin and Datapack List

[15:28:45 INFO]: Server Plugins (0):
[15:28:56 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[...
rustic folioBOT
#

Fixes #12127

Currently the disable-tripwire-updates has a bug, it does NOT cancel updates from tripwire hook blocks, which change the attached state property of the tripwire.

This PR fixes this by blocking the calculateState method inside TripWireHookBlock from running.

This is justified as the methods only functionality is:

  • Checking nearby blocks to find a correct tripwire line
  • Setting attached appropriately
  • Also managing redstone signals and firing events related to them (which already never happens when disable-tripwire-updates is on as the tripwires never get powered)

TLDR it only does block updates and nothing else, half of which are already not being ran with disable-tripwire-updates, hence I think the best solution is to just cancel the entire method.

#

Fixes #12127

Currently the disable-tripwire-updates has a bug, it does NOT cancel updates from tripwire hook blocks, which change the attached state property of the tripwire.

This PR fixes this by blocking the calculateState method inside TripWireHookBlock from running.

This is justified as the methods only functionality is:

  • Checking nearby blocks to find a correct tripwire line
  • Setting attached appropriately
  • Also managing redstone signals and firing events related to them (which already never happens when disable-tripwire-updates is on as the tripwires never get powered)

TLDR it only does block updates and nothing else, half of which are already not being ran with disable-tripwire-updates, hence I think the best solution is to just cancel the entire method.

rustic folioBOT
#

Is there any way in specific we should handle this case

I got this comment on spigot a few months ago. Do we either

  1. specify the discrepancy in the API documentation
  2. each PoiType internal would run through something like CraftMenus but for PaperPoiTypes etc that will map to some Predicate that can make up for the non straightforward discrepancies. This isn't super straightforward and kind of annoying, but it does "fix" some things internals is a bit uneven about.

Just tested this, and will I get the expected result for Villager workstation (specifically farmer).
I do not get the result for beehives.
For beehives it gets only found for occupancy ANY, and returns null for the other two ones. Regardless if it is empty, 1 / 2 Bees or full.

rustic folioBOT
#

Sorry for the late reply, maybe someone will still look here, so I thought that it could be worth mentioning what motivated me to create this PR, or rather what was I basing it on.

It's hard for me to disagree with the above answers, and I won't discuss, but there's a little inconsistency in official stance on this topic. In the documentation of scheduler, a similar method of converting units to the one I proposed in this PR is shown. There is a small mention in upper section that if the server runs 10 ticks per second, the conversion rate to human time will be different, but if it is such a problem as you say, in my opinion it should be more emphasized, especially since below, there is an entire section with a bolded header dedicated to the topic of 'ignorant' (referring to the above discussion, this is not intended to offend anyone who created this part of the documentation) unit conversion.

Anyway, I understand why my PR was re...

rustic folioBOT
#

We need to figure out how to handle the home removal as the block entity right now isn't notified of such removal and is left in an invalid state where its protector does not believe it is its protector.

idk what the best approach for that is and my brain is kinda fried rn

Hmm i can try think if not just remove that for now...

rustic folioBOT
#

Is your feature request related to a problem?

Currently, only the initial interaction with a brush item throws an event. Dragging the brush between blocks while holding allows players to continue brushing suspicious blocks without plugin oversight.

Describe the solution you'd like.

BrushableBlockEntity should throw EntityChangeBlockEvents before making changes to the block. This may require some reshuffling of the logic to preserve loot table state. Events should be thrown both for the dusted property change as well as the final brushingCompleted change.

Describe alternatives you've considered.

https://github.com/PaperMC/Paper/pull/9898#pullrequestreview-1726114004

Other

No response

rustic folioBOT
rustic folioBOT
#

not sounds bad, how about that part in NMS where check for Block based in BlockState and not for Fluid for particles? this also need to be adapted based in the fluild or is a side case?

Wow, you're right! I totally didn't notice that.
Why is it even handled based on BlockState in the first place?
It looks like switching it to FluidState shouldn't cause any issues!

While we're at it, it would be nice to have a way to change the particles being sent.
But I guess that would be better handled by extending PlayerFishEvent, so it might be outside the scope of this topic.

I forgot that we also need the FluidRegistry modification API. However, since this is off-topic for this issue, we should create a separate issue.

Why do you need registry modification for fluids? I don't think that will happen for a while. Shouldn't the getter/setter for the tag be enough?

That's true, too. Sorry ๐Ÿ˜‰

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Everything looks mostly good, some small style stuff, but we can fix that.

The new PredicateChoice requires an example stack, but this might not really make sense for use in the PotionMix

I think what we can do is just create a dummy example stack there. The only place the old predicate choice was used was in potion mixes where the example stack didn't matter. So just creating a random itemstack isn't going to break anything unless people start using the now-deprecated method for actual recipes. Which is their problem.

rustic folioBOT
#

Is your feature request related to a problem?

In many cases, users of plugins encounter errors when starting them. Unfortunately, it is not clear to users what actions they need to take to solve the problem. In some cases, the problem is also that users generally do not understand the error.

Describe the solution you'd like.

Image

Describe alternatives you've considered.

Using Doc's function, you could throw a specific exception and extra fields at the OnEnable, which then contains more detailed information on why the plugin is disabled or what you have to do to get the plugin functional again.

Other

This would give developers a way to give users UX-friendly help and make it uniform

rustic folioBOT
#
[PaperMC/Paper] New branch created: bugfix/brigadier-dead-redirects-commands-yaml
#

While the paper command system no longer uses redirects for namespaced
registration, vanilla still does. This means that removal of vanilla
redirecting target nodes still causes issues, e.g. the removal of the
vanilla 'msg' node in favour of a command alias one.
Redirecting nodes like tell, minecraft:msg and minecraft:tell are broken
by this and need to by flattened before sending them to the client.

rustic folioBOT
#

The event calls are too late right now.
Right now, the block would drop its content even if people cancelled the change event.
It would also unpack its loottable, which, that modifies the block.

We need to move the unpacking down, dropContent calls it so, I think we can just move it right before the block set when a completion state changed (needs testing).
But yea, cancelling these events should maintain the block in the same state (not drop items/unpack loot tables).

#

Welcome to paper :tada:

Thank you for the PR!
I am a bit unsure on cancelling the entire method here.
We are only preventing updates to tripwires, not to the hooks.
Additionally, if something else ever happens in this method in the future, this change would make it very difficult for us to spot that during a version update.

Does moving this check down to the actual update of the tripwire also solve the issue correctly? (I'd imagine so)

rustic folioBOT
#

Expected behavior

The getVelocity() method should return the player velocity.

Observed/Actual behavior

The getVelocity() method always returns zero as the player velocity.

Steps/models to reproduce

Calling getVelocity() on player while moving

Plugin and Datapack List

Single plugin calling getVelocity()

Paper version

This server is running Paper version 1.21.4-164-main@8eb8e44 (2025-02-16T22:13:26Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-151-9b9de82 (MC: 1.21.4)

Other

No response

#

Expected behavior

The method should return the player's movement direction from -1 to 1

Observed/Actual behavior

The method always returns 0 even when player is moving

Steps/models to reproduce

Check getForwardsMovement value while a player is moving

Plugin and Datapack List

Single plugin checking getForwardsMovement

Paper version

This server is running Paper version 1.21.4-164-main@8eb8e44 (2025-02-16T22:13:26Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-151-9b9de82 (MC: 1.21.4)

Other

No response

rustic folioBOT
#

It would also unpack its loottable, which, that modifies the block.

Ran into this now the loot should only be unpacked after the first permitted brush Cancelling the event should not persist the state.
image

We need to move the unpacking down, dropContent calls

I moved these down as well and it seems to be working as intended to me.

I did some more playing around with the event and wasn't able to change the state after cancelling as intended using the vanilla brushing behavior. The patch needs a bit of cleaning up, but I'll leave it as is for now to see if this is what we will go with before I do that.

rustic folioBOT
#

Mhmmm, I did not even think about the brushCount, good catch.
This makes this entire block a lot more difficult, but yea, I think this is the way to go forward (shuffling).
The client should be perfectly fine and we still unpack the loottable on the first brush (the first brush count moves from 0 to 1 in completion stage)

Event is still not fully cancelling the "last" and final brush tho, the game event is still called and the brushCount is not reset either.

rustic folioBOT
#
[PaperMC/Paper] New branch created: feature/adventure-4.19
rustic folioBOT
#

Simplified Conditionals:

Combined multiple conditional blocks and removed unnecessary checks for a more concise flow. For example, the check for $isreject is simplified and placed directly inside the logic that handles applying the patch.
Refactored Reset Logic:

Consolidated the multiple $gitcmd reset --hard and $gitcmd clean -f calls into a single block. This prevents redundancy and makes the script more efficient.
Improved Variable Names:

No major changes to variable names, but the variable names are used consistently and meaningfully (e.g., summaryfail, summarygood, missingfiles).
Error Handling:

The script checks and logs errors related to missing files and patch application failures in a more streamlined manner, improving the clarity of the error output.
Patch Application:

The check for successfully applying the patch ($gitcmd am -3 "$file") is now more direct, skipping unnecessary steps if the patch application succeeds.
Handling Rejected Patches:

The bl...

rustic folioBOT
rustic folioBOT
#

Thanks for the review @lynxplay

I moved the check down to the part of code that updates the block, and ensured it only runs for tripwire and not tripwire hooks.

It still does function correctly like that and the tripwire doesn't get updated (all fields are false).

Though the hook now sets attached to true if it found a valid tripwire line when placed and doesn't update afterwards unless the other hook is broken. This might seem a little inconsistent, tell me if I should cancel updating specifically the attached property for the hook too (by removing the first condition inside the if statement). Just mentioning it, I don't know if it's a concern or not. Other than that all is good. ๐Ÿ‘

#

Thanks for the quick response!
I think that is fine, the tripwire hooks are not part of the cancelled update, even if the resulting state looks fine.
Complete nitpick on my end, but can you just move the if statement directly infront of the setBlock line.
E.g.

if (!config.disableUpdatesTripWire) level.setBlock(blockPos1,....) // Paper - rest of comment

That way, in future updates, the patch fails to apply if the setBlock line there changes and we can correct it.
Beyond that, LGTM

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

No spam in the logs ๐Ÿ˜…

Observed/Actual behavior

Since build 163 of paper 1.21.4 I've been spammed with logs that look like the following:

[Mon 21:48:37 ERROR ca.spottedleaf.dataconverter.minecraft.converters.custom.V3818_Commands] Failed to convert command '/say im a big fat idiot with no life lol'
java.lang.IllegalStateException: Cannot handle non-root redirects
    at ca.spottedleaf.dataconverter.util.CommandArgumentUpgrader.copyCommand(CommandArgumentUpgrader.java:460)
    at ca.spottedleaf.dataconverter.util.CommandArgumentUpgrader.copyCommand(CommandArgumentUpgrader.java:500)
    at ca.spottedleaf.dataconverter.util.CommandArgumentUpgrader.<init>(CommandArgumentUpgrader.java:108)
    at ca.spottedleaf.dataconverter.util.CommandArgumentUpgrader.<init>(CommandArgumentUpgrader.java:87)
    at ca.spottedleaf.dataconverter.util.CommandArgumentUpgrader.upgrader_1_20_4_to_1_20_5(CommandArgumentUpgrader.java:75)
    at ca.spottedleaf.dataconverter.mine...
rustic folioBOT
#
[PaperMC/Paper] New branch created: bugfix/data-converted-redirect-fun
#
[PaperMC/Paper] branch deleted: bugfix/brigadier-dead-redirects-commands-yaml
#
[PaperMC/Paper] branch deleted: bugfix/data-converted-redirect-fun
rustic folioBOT
#

@Machine-Maker
Lava fishing works, and FishHookState transitions correctly. However, the fishing hook does not float on top of lava.

While testing various things, I realized that, just as you mentioned, there is indeed a strange desync issue with the client. It took some time to figure out, but thanks to your heads-up, I was able to notice it. I really appreciate it!

For now, I'll open the PR and include a video showing the strange behavior as proof.

rustic folioBOT
#

Implements #12126

This PR allows modifying the TagKey referenced by FishHook for bobbing.
If the associated TagKey includes lava or flowing_lava, fish will now be able to bite in those fluids as well.

โš  Important Notes

This works correctly on the server-side, but there are some strange client-side desync issues to be aware of.

If the TagKey includes lava or flowing_lava without including water or flowing_water, the client perceives the behavior differently:

  • The fishing hook does not appear to bob on lava.
  • The fishing hook appears to bob on water, even if it shouldn't.

To make this issue clearer, Iโ€™ve attached a video demonstrating the behavior.

https://github.com/user-attachments/assets/befab695-133e-46a3-862b-5a68bf354217

I'm not very familiar with packet handling, so I donโ€™t know of a good solution for thisโ€”sorry about that.

Other Notes

Iโ€™ve read the CONTRIBUTING.md, but...

rustic folioBOT
rustic folioBOT
#

Expected behavior

PlayerDeathEvent should only be called once

Observed/Actual behavior

PlayerDeathEvent is called twice

Steps/models to reproduce

Listen to an EntityDamageEvent and PlayerDeathEvent.

if the entity in the damage event is a player, cancel the event and call entity.setHealth(0);

Take fall damage or something so that you die, and the player death event will be called twice

Plugin and Datapack List

Irrelevant, confirmed by @lynxplay

Paper version

This server is running Paper version 1.21.4-164-main@8eb8e44 (2025-02-16T22:13:26Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are 8 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 1.21.1-119-7cd4f2c (MC: 1.21.1)

Other

No response

rustic folioBOT
#

TL;DR, setHealth(0) will call die which will setClientLoaded(false)
The original damage of the process will call actuallyHurt with the cancelled event but, a non client loaded player is completely invuln, leading to that method returning true. That last bit of behaviour is new since the addition of the client loaded world packet and is the root cause of this issue.

Solutions are a bit out there. One attempt would be revisiting simply moving the event cancellation check outside of the invuln check. Seems incorrect to return true from that method if the event was cancelled but the player is invuln. That might however also lead to other issues not currently on my radar so, testing be advised.

rustic folioBOT
#

The server has a movement check that prevents players from moving at high speeds, singleplayer does not have this. After doing /gamerule disablePlayerMovementCheck true I was able to reproduce your expected behaviour by getting launched thousands of blocks into the air.

Could you confirm whether this gamerule fixes your issue?

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

so the content of plugin.yml is

name: genocideauth
version: '1'
main: shaylyn.gg.genocideauth.discordauth
api-version: '1.21.4'
authors: [Shaylyn]
description: DiscordAuth For GenoCide
website: https://discord.gg/SVGgaxpAj7
commands:
discordauth:
description: ๋””์Šค์ฝ”๋“œ ์ธ์ฆ ํ”Œ๋Ÿฌ๊ทธ์ธ ๋ช…๋ น์–ด
usage: /discordauth help
permission: discordauth.admin
permissions:
discordauth.admin:
description: ๋””์Šค์ฝ”๋“œ ์ธ์ฆ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ
default: op

this and the version is 1.21.4(https://papermc.io/downloads/all)
please fix for me

Observed/Actual behavior

[22:04:34 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'DiscordAuth-1.jar' in folder 'plugins.paper-remapped'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `shaylyn.gg.genocideauth.discordauth'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:80) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvi...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Full disable/no access to End world.

Observed/Actual behavior

When I disabled it on bukkit.yml and deleted the world_the_end folder, it still generates of which it shouldn't.

Steps/models to reproduce

Just disable the end in bukkit.yml

Plugin and Datapack List

[09:03:51 INFO]: Bukkit Plugins (35):
[09:03:51 INFO]: - AdvancedEnchantments, AuctionHouse, AuraSkills, BetterRTP, BetterStructures, Chunky, Citizens, CMILib, DailyRewardsPlus, DecentHolograms
[09:03:51 INFO]: DeluxeMenus, Denizen, EconomyBridge, EliteMobs, Essentials, EssentialsChat, EssentialsSpawn, ExcellentCrates, FastAsyncWorldEdit, ItemsAdder
[09:03:51 INFO]: Jobs, LoneLibs, LuckPerms, Multiverse-Core, nightcore, PlaceholderAPI, ProtocolLib, ShopGUIPlus, SkinsRestorer, TerraformGenerator
[09:03:51 INFO]: Vault, ViaBackwards, ViaVersion, VoidGen, WorldGuard

Paper version

I am using Purpur version latest (Current Purpur Version: 1.21.4-2398-196c176 (MC: 1.21.4)*) but I th...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

I'm a little torn, because of the fact that we arent sharing any inheritance I really think we should make the EntityHarvestBlockEvent "more proper".

  • clone itemstacks, add getters/setters
  • make the list immutable, add a setter/getter

Issue is then people wanting to use the other event may get a bit confused.

yeah i prefer keep the two events like the same.. if not then modify the two with this new "behaviours" but set itemstack? i mean all are in the list or i bad read something?

rustic folioBOT
rustic folioBOT
#

Expected behavior

it shouldn't spam itself

Observed/Actual behavior

it spamming itself continuously until you take a step back from the damager block (like magma, cactus, campfire etc.)

Steps/models to reproduce

in EntityDamageEvent, just make the damage lower than 1 by using event.setDamage (like 0.9). then, just jump on a damager block (like magma, cactus, campfire etc.). and don't forget to make an output next to it, so you can see it's spamming itself.

Example Code:
public void test(EntityDamageEvent event) {
Bukkit.getServer().broadcast(Component.text("hit."))
event.setDamage(0.9) // - bug starts when you set this lower than 1
}

Plugin and Datapack List

nothing, just a clean server with my test plugin.

Paper version

This server is running Paper version 1.21.4-174-main@5e2a3bc (2025-02-20T09:56:44Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

I've tried it in multiple versions but problem still exists. (in 1.21.1, 1.21.3, 1.2...

rustic folioBOT
#

Expected behavior

I use this code to check for Respawn Anchor Damage and it should work:
Image

Observed/Actual behavior

In the console I get the error that the Block is null:
Image

Steps/models to reproduce

  1. Use the code mentioned above and register the Event
  2. Damage/Kill yourself with a Respawn Anchor

Plugin and Datapack List

Only my testing Plugin that only contains the code from above

Paper version

This server is running Paper version 1.21.4-174-main@5e2a3bc (2025-02-20T09:56:44Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

The API Version is 1.21, so everything is up-to-date

#

Full Error:
`[19:20:29 ERROR]: Could not pass event EntityDamageByBlockEvent to DebugPlugin v1.0.0
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getType()" because "damager" is null
at debug-plugin-1.0.0.jar/de.skyking_px.debugPlugin.DebugPlugin.onEntityDamageByBlock(DebugPlugin.java:29) ~[debug-plugin-1.0.0.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.21.4.jar:1.21.4-174-5e2a3bc]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.21.4.jar:1.21.4-174-5e2a3bc]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.21.4-R0.1-S...

rustic folioBOT
#

Always passes the respective block to a damage source when passing a
block state. While we could technically use the damageSourcePosition
here by, we'd have to translate it back to a block position by
subtracting .5 from all its components.
Such behaviour however relies on the caller logic's mutation of the
damageSourcePosition and will break once this position is not the centre
of the block.

Passing in the block at the specific callsite is a lot more future
proof.

Resolves: #12157

rustic folioBOT
#

Expected behavior

Tripwire should stay after door opens
https://youtu.be/gTsdEnRWYb8?si=OfCVbWiIFRsQvMox

Observed/Actual behavior

Tripwire breaks after setting it on iron door and iron door open but doesn't dupe.

Steps/models to reproduce

Make paper server
Turn skip-tripwire-hook-placement-validation to true
build: https://youtu.be/gTsdEnRWYb8?si=OfCVbWiIFRsQvMox

Plugin and Datapack List

I tried with and without plugins. Both didn't work.
Backuper, CoreProtect, dynmap, Essentials, EssentialsChat, EssentialsSpawn, floodgate, Geyser-Spigot, GSit, LuckPerms, LWC, Multiverse-Core, NoteBlockAPI, PL-Hide, PlugManX, Sit, SkinsRestorer, TAB, Vault, voicechat, voicechat-discord, WeatherVote, WorldEdit, WorldGuard

Paper version

This server is running Paper version 1.21.4-175-main@ab984a0 (2025-02-20T19:29:15Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-144-edacfdf (MC: 1.21.4)

Other

Tripwire ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Welcome to Paper! Just from quickly looking at the video: Do the items instantly get burned when you fish? We definitely have to figure out an efficient way to have the client keep up with the hooks position as otherwise setBobbingFluids isn't really doing what it says it does.

The fishing hook moves back and forth between the lava and the air, so sometimes the caught items burn, and sometimes they donโ€™t. This is expected behavior.

#

I feel like something like this is very tricky to get right without Vanilla here, especially due to the rather large desync introduced by Vanilla. Probably better to just wait for them to add a fluid tag at one point into this area of code, since the desync is unavoidable without some nasty hacks. Because of course, the client expects water.

I've been trying various approaches over the past few days, but as you said, the only available methods are dirty hacks.
The simplest approach was to send a MotionPacket only when the tag is set to something other than FluidTags.WATER, but it seems that the client ignores the motion packet for the fishing hook, so that didn't work ๐Ÿฅฒ

#

When I added lava to fluid/water.json, the fishing mechanics worked correctly.
Iโ€™d like to confirm something: My understanding is that the server sends the water tag and its associated values to the client, and the client reads this tag to determine whether the fishing hook can bob on a fluid. Is this correct?

Implementing this with a hack could cause compatibility issues in the future if Vanilla updates its mechanics. So, Iโ€™ve decided to temporarily withdraw this PR and wait for Vanilla to make changes.
If there are no objections, could you kindly close this PR?

In the meantime, Iโ€™ll add details about the issue preventing this featureโ€™s implementation to #12126.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Implementation is currently impossible due to desync issues between the client and server until Vanilla supports modifying the fluid registry.

  • The client determines whether a fishing hook can float by referencing the water tag.
  • The server does not send any packets to the client between shooting the fishing hook and a fish biting.
  • The client ignores velocity packets sent for the fishing hook.

If Vanilla ever adds support for modifying the fluid registry, feel free to ping me in this issueโ€”I'd be happy to work on the PR again! :)

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

An entity within activation range should be ticking as normal.

Observed/Actual behavior

Following setup:

  • fresh new server/world
  • server.properties unchanged (therefore view/sim distance = 10)
  • all configs unchanged except activation/tracking ranges in spigot.yml all set to 500

Entities not so far away are not moving.
(The pigs in the video are about 32 blocks away, well within the 500 block activation range)

https://github.com/user-attachments/assets/1f96ce3f-58b2-4921-a350-1fcd048e2ca7

When I move closer, they activate:

https://github.com/user-attachments/assets/faf5a2b5-6b93-4cb2-9921-9d91a8990763

Added bonus:
If I set the pigs ablaze... they run for their lives:
https://github.com/user-attachments/assets/0842b6c8-958e-4232-9ab2-fd2d6106b52a

Steps/models to reproduce

See above for setup.
Just log in, and look at how mobs are not moving.

Plugin and Datapack List

No datapacks, only plugin Im using is Skript, just for debugging (ie: ...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#
  • Adds overloads to World#rayTrace and World#rayTraceBlocks, as well as the method PositionedRayTraceConfigurationBuilder#blockCollisionMode, that take a BlockCollisionMode instead of the boolean ignorePassableBlocks to determine block collisions.
  • Add FluidCollisionMode.WATER.
  • Remove outdated javadocs on World#rayTrace, World#rayTraceBlocks, PositionedRayTraceConfigurationBuilder#fluidCollisionMode, and PositionedRayTraceConfigurationBuilder#ignorePassableBlocks that mention caveats with portal blocks and fluids that no longer exist. Portal blocks are always considered 'passable', and the value of ignorePassableBlocks has no effect on fluid collisions.
rustic folioBOT
#

Expected behavior

Taking Cramming(Squishing) Damage

Observed/Actual behavior

Not Taking Cramming(Squishing) Damage

Steps/models to reproduce

Paper

https://github.com/user-attachments/assets/f49fde13-5f3c-4a2c-abb5-ec3bcba5d96f

Vanilla

https://github.com/user-attachments/assets/e1f208da-d9b9-4352-b263-f6d98e1ce6e0

Plugin and Datapack List

  • No Plugins
  • Bulit-in Datapacks(vanilla, file/bukkit, paper)

Paper version

This server is running Paper version 1.21.4-177-main@e5a8ee8 (2025-02-21T11:12:22Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version

Other

No response

rustic folioBOT
#

Is your feature request related to a problem?

Currently there is no event when an Eyeblossom opens/closes, to this cannot be logged or stopped by plugins. Same for Creaking hearts that activate/deactivate.

Describe the solution you'd like.

For the opening/closing Eyeblossom spigot is using the BlockFormEvent, maybe that could be called in paper too or maybe some other event. For the heart maybe the same event.

I am not completely happy with the BlockFormEvent, but it is used for block transforming itself like concrete powder->concrete too so it could be fine. And i think it is better than using the BlockGrowEvent, because it is not realy about growing.

Or maybe some completely new event, but I don't know how it should be named.

Describe alternatives you've considered.

/

Other

No response

rustic folioBOT
#

Currently, PlayerFishEvent is not triggered when a FishHook changes its state. This means that if you want to track state transitions, you have to monitor them using a scheduler, which is inefficient. To address this, I have implemented FishHookStateChangeEvent.

  • This event is useful when you want to send messages, titles, or sounds to players based on fishing hook state transitions.
  • Canceling the transition to HookState.BOBBING prevents Minecraft#FishingHook#catchingFish from executing.
  • Be cautious when handling this event, as canceling it will not prevent the state transition from being re-evaluated in the next tick. If the conditions are still met, the event will be instantiated and called repeatedly. (This behavior is documented in the Javadoc.)

For consistency, this event is mostly copied from PufferFishStateChangeEvent. However, I feel that "State Transition" might be a more appropriate term than "State Change."

rustic folioBOT
rustic folioBOT
#

Stack trace

https://mclo.gs/X1CLWUm

Plugin and Datapack List

  • FancyHolograms, qXP-Boosts
    Bukkit Plugins (77):
  • AdvancedBan, AutoPickup, AutoReplant, AxAuctions, AxiomPaper, Backuper, BannedWordsEffective, BetterGUI, BetterMessages, BetterRTP
    BottledExp, CatchBall, Chunky, Citizens, CleanroomGenerator, Clumps, CMILib, CommunityQuests, CrazyEnchantments, CustomAnvil
    DelphiVote, DiscordSRV, dynmap, Dynmap-Towny, EasyArmorStands, Elevator, Emojis, Essentials, EssentialsChat, EssentialsProtect
    EssentialsSpawn, ExecutableBlocks, ExecutableEvents, ExecutableItems, EzChestShopReborn, FastAsyncWorldEdit, GrimAC, GSit, Infiniteannouncements, InteractiveChat
    InvisibleItemFrames, Jobs, LuckPerms, Maintenance, mcMMO, MilkyPixelart, MiniMOTD, MobFarmManager, MobSizeRandomizer, Multiverse-Core
    MyCommand, MyFurniture, ODailyQuests, packetevents, PlaceholderAPI, PlayerPoints, PlayerWarps, ProtocolLib, Quests, RealScoreboard
    *ResourcePack, SCore, SilkSpawners_v2, SimplePronouns, StaffC...
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Not really a problem per se, just some of the methods for using TypedKey/TagKey seem awfully verbose.

Comparing a Block to a TypedKey
(I dont think anyone would do this, just wanted to show it off)
(block referencing a Bukkit Block)

TypedKey<BlockType> blockTypedKey = TypedKey.create(RegistryKey.BLOCK, block.getType().key());
if (blockTypedKey.equals(BlockTypeKeys.STONE)) {
}

Checking if a Block matches a TagKey
(as far as I know this is the shortest way?!?!?)
(block referencing a Bukkit Block)

TypedKey<BlockType> blockTypedKey = TypedKey.create(RegistryKey.BLOCK, block.getType().key());
Tag<BlockType> tag = RegistryAccess.registryAccess().getRegistry(RegistryKey.BLOCK).getTag(myTagKey);
if (tag.contains(blockTypedKey)) {
}

Describe the solution you'd like.

I would like to see some additions similar to NMS Methods.
Ex: NMS ItemStack:
(I believe BlockStateBehaviour has these as well)
<img width="32...

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Transferring a player will require both sender and receiver to have transfers enabled in paper-global.yml and server.properties respectively.

This increases security as server staff with elevated permissions can send players to self-hosted servers to ip-grab them without having console access in the "sender" server.
This also breaks attack vectors where server staff is tricked into transferring players directly via command or clicking a sign.

#

Transferring a player will require both sender and receiver to have transfers enabled in paper-global.yml and server.properties respectively.

This increases security as server staff with elevated permissions can send players to self-hosted servers to ip-grab them without having console access in the "sender" server.
This also breaks attack vectors where server staff is tricked into transferring players directly via command or clicking a sign.

#

To follow up on this, the transfer command is not something normal players have access to.

A server would have to effectively grant operator permissions to someone for them to be able to use it or explicitly the transfer permissions. That is already incredibly dangerous, transferring seems like the least of your worries if someone has such level of permissions.

The angle of a plugin transferring has two parts.
Either the plugin maliciously does it, at which point, you have malware.
Or the plugin exposes a transfer mechanism and somehow a staff member not meant to have that permission gained that? Which is pretty much the same point as above.

I just really don't see an angle where a server might have accidental transfers enabled without it being aggressively missconfigured, which I doubt those servers will use a config option to fix that.

I'll throw it at some other members for their input, but from my point of view, I don't think I want to pull this change.

#

Sometimes people upload malicious plugins to official platforms like it happened in modrinth a couple of months ago.
Other times server owners get custom plugins from other people like "friends" or worse, players.

Tbh, that last one is mostly their fault ๐Ÿ˜…
But still is something that sometimes happens, specially for non experienced server owners, and the ones at risk ends up being the players

#

Yea malware certainly exist :sweat_smile: Issue with that is usually "ah fuck, malware might as well just change the parsed config value before sending this". Fighting malware outside of "do not install it in the first place" is sadly usually a lost cause.

I'll throw the PR at someone else before I close it just to make sure the team agrees with me on this. But yea, thank you already for the PR no matter the outcome!

#

Sometimes people upload malicious plugins to official platforms like it happened in modrinth a couple of months ago.

Tbh I can't see a reason why would someone transfer people instead of silently grab the exact same information on your server and send it back to the bad dev. People will quickly start to notice those transfers and complain, exposing the plugin, all this for no extra information that a transferred server could extract.

rustic folioBOT
#

Sometimes people upload malicious plugins to official platforms like it happened in modrinth a couple of months ago.

Tbh I can't see a reason why would someone transfer people instead of silently grab the exact same information on your server and send it back to the bad dev. People will quickly start to notice those transfers and complain, exposing the plugin, all this for no extra information that a transferred server could extract.

True, if they managed to get the plugin on the server they can already have access to player information there.
The original idea was based on the /transfer command where the attacker doesn't necessarily have access to the console and then I thought of the plugins making the same.

But yh, limiting access to the command via permission plus the fact that plugins already have console access and can make worse stuff than just transferring players makes this config a bit pointless.

Btw, I think it would be a good idea to mention stuff ...

rustic folioBOT
rustic folioBOT
#

I vote no on this:

  1. Regarding the command, as already stated, commands have permissions and should be negated. No one but the server owner should be op, therefor no one but the server owner should have permission for that command.

  2. Regarding malicious plugins.... no matter what, a malicious plugin would still be able to change the config option and force transfer a player. The config option wont stop anyone.

rustic folioBOT
#

This implementation is far too trivial to bypass by anybody remotely familiar with the networking library in use, and wouldn't take much rocket science to see how to bypass the method here. The only way you'd be able to do this is to handle this in the pipeline itself, but, this generally just offers a fake security assurance which nobody can promise when you're running arbitrary code on your server.

rustic folioBOT
#

Is your feature request related to a problem?

At present, it's not possible to detect when an armadillo changes its state and cancel it. This is problematic for vanish plugins, as they can't cancel the state change caused by a vanished player.

Describe the solution you'd like.

I suggest introducing a new cancellable ArmadilloStateChangeEvent, similar to the WardenAngerChangeEvent.

#12026 seems to be a good basis for this feature request, as it adds API features for armadillos (such as an enum for the armadillo state).

Describe alternatives you've considered.

N/A

Other

No response

rustic folioBOT
#

Expected behavior

On teleporting with minecraft command /tp chunk should load one time

Observed/Actual behavior

Chunk gets loaded multiple times

Image

` public SomeEventListener(Plugin plugin) {
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
map.keySet().stream()
.filter(key -> map.get(key) > 1)
.forEach(key -> {
Bukkit.getConsoleSender().sendMessage("Chunks that loaded: " + key + " times: " + map.get(key));
});
map.clear();
}, 20L, 20L);
}

@EventHandler
public void onChunkLoad(ChunkLoadEvent e) {
    map.put(e.getChunk().toString(), map.getOrDefault(e.getChunk().toString(), 0) + 1);
}`

Steps/models to reproduce

Teleport to unloaded chunks

Plugin and Datapack List

![Image](https://github.com/user-attachments/assets/7da79423-9a...

rustic folioBOT
#

This small change allows to use recent changes from Adventure 4.17.0. Passing Pointered to MiniMessage#deserialize(String, Pointered) method allows to take Pointered from MiniMessage context (net.kyori.adventure.text.minimessage.Context) using Context#target method.

Usage example:

static TagResolver DISPLAY_NAME_TAG_RESOLVER = TagResolver.resolver("display_name", new BiFunction<ArgumentQueue, Context, Tag>() { // without the use of lambda for clarity
            @Override
            public Tag apply(final ArgumentQueue argumentQueue, final Context context) {
                Audience target = context.targetAsType(Audience.class); // Or CommandSender, Player, etc.

                return Tag.inserting(target.get(Identity.DISPLAY_NAME).orElseThrow());
            }
        });

...

player.sendRichMessage("You display name is: <display_name>", DISPLAY_NAME_TAG_RESOLVER);

The simplest testing:
![image](https://github.com/user-attachments/assets/...

#

This small change allows to use recent changes from Adventure 4.17.0. Passing Pointered to MiniMessage#deserialize(String, Pointered) method allows to take Pointered from MiniMessage context (net.kyori.adventure.text.minimessage.Context) using Context#target method.

Usage example:

static TagResolver DISPLAY_NAME_TAG_RESOLVER = TagResolver.resolver("display_name", new BiFunction<ArgumentQueue, Context, Tag>() { // without the use of lambda for clarity
            @Override
            public Tag apply(final ArgumentQueue argumentQueue, final Context context) {
                Audience target = context.targetAsType(Audience.class); // Or CommandSender, Player, etc.

                return Tag.inserting(target.get(Identity.DISPLAY_NAME).orElseThrow());
            }
        });

...

player.sendRichMessage("You display name is: <display_name>", DISPLAY_NAME_TAG_RESOLVER);

The simplest testing:
![image](https://github.com/user-attachments/assets/...

rustic folioBOT
#

Expected behavior

Expected behavior

Image

Opening the fence gate should make so the bees inside the hive "gets out" instantly.

Observed/Actual behavior

Bee's dont go out instant as it should in vanilla. They seem to get out after some random seconds instead of instant.

Steps/models to reproduce

See picture "Expected behavior".
Build a box with a bee hive in it. Have the fence gate closed when you put the hive down.
Open the fencegate and no bees get out of the hive. Reproduce in vanilla and see difference.

Plugin and Datapack List

Tested with no datapacks and no plugins.

Paper version

Paper 1.21.4-177

Other

No response

#

This isn't a bug as described; the events are not fired incorrectly. The entity is being added, removed, and added back in quick succession, and the events are firing properly to reflect this. The worst case here for a properly implemented consumer of the events should be performing redundant work.

I think this issue is best interpreted as a feature request to change the redundant but correct chunk loading behavior around player joins. Spectator mode and the relevant gamerule for generating chunks make the implementation in #11398 & the Moonrise equivalent non-ideal. But this does seem like a desirable behavior change.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Generally looks good to me, however I am a bit split on what is then actually included in the toString().

The fact that 99% of entities now only expose their uuid is fine to me, I don't think toString() is a reliable
debugging source in the first place.
Noting that, I am confused why you chose to keep CraftHumanEntity's name in the toString impl?
It sticks out a bit given other entities lost their debug information (like horse variants or itemframe rotations).

rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Among the numerous kinds of doors that Minecraft has accumulated over the years, many of them have unique sounds when opening or closing them. Currently there is no way to get these sounds via the API. If you wish to emulate opening or closing a door through code, the sounds aren't played automatically, but you also have no way of knowing which sound to play in a robust and future-proof way.

Describe the solution you'd like.

A way to access the sounds given a Door or TrapDoor kind of object representing the specific kind of door.

Describe alternatives you've considered.

Hard-coding everything and crying when Mojang adds yet another wood type in the next update.

Other

Vanilla has a BlockSetType for this, which is stored in the field of a DoorBlock. I'd love for an equivalent to be exposed. I tried implementing this myself but failed because the Material system is so incompatible with vanilla's system. I'm hoping...

rustic folioBOT
#

Expected behavior

If using CustomArgumentType<T, N> and also overriding the parse(reader, source) function, it should default to it instead of using the less advanced parse(reader) function.
This should make it possible to access the source and adapt the parsed content to it.

Observed/Actual behavior

Override the parse(reader, source) function does effectively nothing. There is no way to parse based on source/context, and it always only uses the parse(reader) function instead.
In code comments (and Paper Docs) there is no word about this behavior, or how to deal with it, of the CustomArgumentType, so it looks like it is just not working as intended / thought.

Steps/models to reproduce

  • Implement CustomArgumentType<*, *>
  • Override parse(reader, source)
  • Try to use it

Plugin and Datapack List

/

Paper version

This server is running Paper version 1.21.4-177-main@e5a8ee8 (2025-02-21T11:12:22Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are runni...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

My RCON client expects a valid response to an empty command to detect the end of fragmentation.

Observed/Actual behavior

The server throws an ArrayIndexOutOfBoundsException:

[16:48:50 INFO]: Thread RCON Client /127.0.0.1 started
[16:48:54 WARN]: Unexpected exception while parsing console command ""
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1031) ~[paper-1.21.4.jar:1.21.4-178-636ae0c]
	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1021) ~[paper-1.21.4.jar:1.21.4-178-636ae0c]
	at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer.java:1002) ~[paper-1.21.4.jar:1.21.4-178-636ae0c]
	at net.minecraft.server.dedicated.DedicatedServer.lambda$runCommand$4(DedicatedServer.java:743) ~[paper-1.21.4.jar:1.21.4-178-636ae0c]
	at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

If a plugin changes the damage in EntityDamageEvent, it can cause the INVULNERABILITY_REDUCTION damage modifier to be set to 0 and render invulnerability damage reduction, added in https://github.com/PaperMC/Paper/pull/11599, ineffective

This happens because a float (the lastHurt value in a Player) is being compared to a double (stored in the modifiers of EntityDamageEvent), and a float can be greater than a double, even if they are the same value:

jshell> 3.2D < 3.2F
$2 ==> true

Due to lossy floating point precision, 3.2F is implicitly casting to 3.200000047683716, which indeed would be greater than 3.2.

float lastHurt is the result of casting the double from EntityDamageEvent#getFinalDamage, which causes this imprecision. The fix is to cast the doubles from EntityDamageEvent to floats when comparing them here. This ensures that if they are the same value, then one will not be less than the other, because they have both been cast from the same dou...

rustic folioBOT
rustic folioBOT
#

Expected behavior

Good question - no server timeout, of course. To be more specific, it would be fine for the cartographer villager to have treasure maps that don't work in his inventory. So there would be no treasure chest. The issue seems to be around the server code trying to generate whatever is required for a treasure map in a void world but not being able to, probably ending up in an infinite loop, I'm guessing.

Observed/Actual behavior

Forced server shutdown after ranking up a cartographer through trading (which triggers treasure maps to attempt to be generated).

Log:

[21:37:59 ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - 1.21.4-183-f63dbea (MC: 1.21.4) ---
[21:37:59 ERROR]: The server has not responded for 10 seconds! Creating thread dump
[21:37:59 ERROR]: ------------------------------
[21:37:59 ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[21:37:59 ERROR]: ------------------------------
[21:37:...
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

In order to ensure the API functions properly, some adjustments are needed. Iโ€™ve tested it, and currently, the API throws an error for any menu that doesnโ€™t have a MenuType. This is an issue in scenarios like the playerโ€™s inventory or with animals, where a MenuType is not applicable. In these cases, it results in an UnsupportedOperationException. If youโ€™re aiming for this to be merged, Iโ€™d recommend modifying the behavior to return null instead of throwing the exception. Otherwise, everything else seems fine. I'm not in love with the CraftContainer impl, but I think its pretty much unavoidable at this point sadly.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

In these cases, it results in an UnsupportedOperationException.

@Y2Kwastaken does it also throw in CraftContainer implementation? It seems that CraftContainer.getNotchInventoryType never returns null, so there should be no issues, but I want to verify it.

The naive conversion for Inventory's is fine and won't throw that exception to see why its thrown see AbstractContainerMenu#getType

rustic folioBOT
#

The treasure map option lives in the world configuration no?
You should be able to just disable them for your void world.

I don't think we can really have a nicer option than just disabling them for the specific void worlds that do not generate structures. We could investigate if we can skip this kind of structure search in case the worlds chunk generator states defines 0 possible structures, but the world might already have structures to find so, I don't think that is a proper solution here either.
You are probably best off just using the config option for the specific world.

rustic folioBOT
#

rather than just stating null if not applicable might be smart to list the cases where null is returned here as far as I'm aware this is the case only player and animal menus, but it might be worth poking around a bit more to make sure that I'm 100% right about this. Might just be nice to have a little paragraph not in the return statement being more involved on why this method might return null

rustic folioBOT
#

In the custom chunk generator there is an Override that I set to true for the void worlds:

    @Override
    public boolean shouldGenerateStructures() {
        return false;

    }

Could you key off this and not have the villager code try? The issue is that as the plugin author, I can't edit this file or disable it unless there's an API - I assume there isn't one is there? (I could access the file directly and edit it, but that's a bit of a security no-no). Right now I have to inform users to edit this file to turn off treasure maps otherwise their server will crash, which isn't a great user experience and TBH I'm already getting blamed for this error. The text says it's not a Paper Error etc, etc.

rustic folioBOT
#
getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, e -> {
            e.registrar().register(Commands.literal("place").then(
                    Commands.argument("block_state", ArgumentTypes.blockState())
                        .executes(commandContext -> {
                            final BlockState state = commandContext.getArgument("block_state", BlockState.class);
                            final CommandSender sender = commandContext.getSource().getSender();
                            if (!(sender instanceof final Player player)) return 0;

                            final BlockState copy = state.copy(player.getLocation());
                            copy.update(true);
                            return 1;
                        })
                ).build()
            );
        });

with
/place chest{Items:[{Slot:0b,id:"minecraft:cake",count:1}]}

rustic folioBOT
#

This is a client limitation that Mojang resolved as a "Won't Fix" https://bugs.mojang.com/browse/MC/issues/MC-277546, display entities must exist on the client with their full state before any interpolation can take place, it needs the previous state to interpolate to the new state, and interpolation starts on the next client tick.

This is simply not something the server can fix. The only viable solution for plugins is to wait some time (one server tick might not be enough, as this whole mechanism relies on client ticks), or for Paper to add API for the client end tick packet (which a modified client might also choose to not send), but that event would be very hot so it'd come with a "handle with care" label.

#

Minecarts don't care about frictionState if they're not on a rail, so they're already treated differently than other entities.

I wouldn't bother with this change if they didn't make minecarts work on rails underwater.

Currently:

  • minecarts on rails in air respect frictionState,
  • minecarts on rails in water don't respect frictionState.
  • minecarts not on rails don't respect frictionState.

I think minecarts should respect frictionState on rails regardless of water so map makers can set them off at a specific speed without worrying about them being treated differently in an underwater section of the railway.

It's a unique situation to minecarts. I don't think other entities not ignoring water needs to be considered unless this change evolves into adding a water friction flag.

rustic folioBOT
rustic folioBOT
#

Expected behavior

beacons will not break

Observed/Actual behavior

beacons break, they do not drop item

Steps/models to reproduce

  1. place a beacon
  2. cancell PlayerInteractEvent using plugin: @EventHandler public void PlayerInteractEvent(PlayerInteractEvent event) { event.setCancelled(true); }
  3. go in survival mode and try to break beacon

Plugin and Datapack List

testplugin (what I used for cancelling block event)

Paper version

1.21.4-185-main@0a6e743 (2025-02-26T13:10:43Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

No response

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is your feature request related to a problem?

Mojang added a new packet in 1.21.3, ServerboundClientTickEndPacket, to let the server know when a client-sided tick ends. Some features, namely display entity interpolation, are wholly dependent on the client's tick loop, not the server's. Currently, it is impossible for a client to tell if it is safe to perform transformations on a display entity and having the guarantee that it will be interpolated expectedly.

Describe the solution you'd like.

A ClientTickEndEvent that is called when the server receives the aforementioned ServerboundClientTickEndPacket.

Describe alternatives you've considered.

Delaying applying transformations to a display entity for an arbitrary amount of time (one server tick might not be enough to guarantee the client will interpolate the changes) (yuck), or using internals to listen to the packet being received (yucker).

Other

I recognise the event would be very hot, with potential...

rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Expected behavior

Projectile is expected to hit the entity, however, occasionally goes ignores the entity.

Observed/Actual behavior

The projectile completely ignores entities.

Steps/models to reproduce

I can consistently reproduce with an arrow or fishing rod in survival mode. It was impossible for me to reproduce this while in creative mode.

Latest version of Paper with a plugin to spawn the bot (no event listeners).

https://youtu.be/_Uk5kCJ3Z0o
https://youtu.be/B-FhIEWiy1Q
https://youtu.be/OPEVF-fKsdc

Plugin and Datapack List

Only 1 private plugin.

Paper version

This server is running Paper version 1.21.4-185-main@0a6e743 (2025-02-26T13:10:43Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)\nYou are running the latest version\nPrevious version: 1.21.4-177-e5a8ee8 (MC: 1.21.4)

Other

I attempted to fix this by using a task to manually check if bounding box between projectile and entities overlap, and this also failed.

rustic folioBOT
rustic folioBOT
#

Expected behavior

For example: If I set the worldborder to 2.5k radius and do /tp 500000 0 500000 I would be teleported to 2500 0 2500 instead of 500000 0 500000. Previous versions was like this until the latest one.

Observed/Actual behavior

When I set the worldborder to 2.5k radius and tped to 500000 0 500000, I was actually tped to that coordinate instead of 2500 0 2500.

Steps/models to reproduce

Just install the latest version of paper. Do /worldborder center 0 0, then /worldborder set 5000 and /tp 1000000 0 100000(or anything higher/outside the worldborder limit).

Plugin and Datapack List

[23:56:41 INFO]: โ„น Server Plugins (0):

[23:57:00 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)]
[23:57:00 INFO]: There are no more data packs available

Paper version

[23:57:21 INFO]: This server is running Paper version 1.21.4-185-main@0a6e743 (2025-02-26T13:10:43Z) (Implementing API version 1.21.4-R0.1-SNA...

rustic folioBOT
rustic folioBOT
#

Tbh can't be sure what it is to make a better explanation, the only 5 vanilla usages are

  • {"sound":"minecraft:ambient.basalt_deltas.additions","tick_chance":0.0111}
  • {"sound":"minecraft:ambient.crimson_forest.additions","tick_chance":0.0111}
  • {"sound":"minecraft:ambient.nether_wastes.additions","tick_chance":0.0111}
  • {"sound":"minecraft:ambient.soul_sand_valley.additions","tick_chance":0.0111}
  • {"sound":"minecraft:ambient.warped_forest.additions","tick_chance":0.0111}

They really seems like an addition to other sounds, and wiki doesn't have any more info than what's in this javadoc

#

Expected behavior

When loading a structure block over a filled container, the container should be overwritten so that the items inside the container are removed

Observed/Actual behavior

Items in containers overwritten by structure blocks drop on the ground, as though the inventory was broken, when it should have instead been overwritten

Steps/models to reproduce

Load a structure block over a container that contains items, like a chest or a dispenser. When the structure block loads, all of the items in that container will fall on the ground

Plugin and Datapack List

CoreProtect, LuckPerms, Gsit, Armor Stand editor, Dynmap, one custom datapack

Paper version

This server is running Paper version 1.21.4-150-main@46f4fda (2025-02-12T22:37:19Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

This issue does on occur in Vanilla or in Spigot

rustic folioBOT
rustic folioBOT
#

My colleague and I were looking to reproduce this bug and further our investigation of it. However, we cannot seem to reproduce the bug. I would like to request some guidance in the step of creating the plug-in. More specifically whether the class EntityKnockbackByEntityEvent needs an explicit declaration of the getHandlers() or getHandlerList() methods, taking into account the fact that the event classes that extend Event do not inherit these methods from said class, according to Paperโ€™s website. While EntityKnockbackEvent possesses the referred methods, EntityKnockbackByEntityEvent lacks declarations for them. Is this supposed to happen? Documentation on Paperโ€™s guide clearly states that entities lacking the getHandlerList() method cannot be listened to.

Reference:
https://docs.papermc.io/paper/dev/event-listeners

rustic folioBOT
#

It walks up the class hierarchy to look for the handler list to use

On Fri, 28 Feb 2025 at 22:26, Afonso Mendonรงa Jacinto <
@.***> wrote:

My colleague and I were looking forward to reproducing this bug and
further our investigation of it. However, we cannot seem to reproduce the
bug. I would like to request some guidance in the step of creating the
plug-in. More specifically whether the class EntityKnockbackByEntityEvent
needs an explicit declaration of the getHandlers() or getHandlerList()
methods, taking into account the fact that the event classes that extend
Event do not inherit these methods from said class, according to Paperโ€™s
website. While EntityKnockbackEvent possesses the referred methods,
EntityKnockbackByEntityEvent lacks declarations for them. Is this supposed
to happen? Documentation on Paperโ€™s guide clearly states that entities
lacking the getHandlerList() method cannot be listened to.

Reference:
https://docs.pape...

rustic folioBOT
#

It walks up the class hierarchy to look for the handler list to use

On Fri, 28 Feb 2025 at 22:26, Afonso Mendonรงa Jacinto <

@.***> wrote:

My colleague and I were looking forward to reproducing this bug and

further our investigation of it. However, we cannot seem to reproduce the

bug. I would like to request some guidance in the step of creating the

plug-in. More specifically whether the class EntityKnockbackByEntityEvent

needs an explicit declaration of the getHandlers() or getHandlerList()

methods, taking into account the fact that the event classes that extend

Event do not inherit these methods from said class, according to Paperโ€™s

website. While EntityKnockbackEvent possesses the referred methods,

EntityKnockbackByEntityEvent lacks declarations for them. Is this supposed

to happen? Documentation on Paperโ€™s guide clearly states that entities

lacking the getHandlerList() metho...

#

Is your feature request related to a problem?

ItemStack#enchantWithLevels should allow using any level > 1 to enchant with (any level lower would effectively do nothing). The vanilla logic already allows this, there's just a level cap at 30 for some reason. Vanilla loot tables already use level 39, as seen in the end city treasure table.

Describe the solution you'd like.

ItemStack#enchantWithLevels and the ItemFactory equivalents should accept levels up to max int, as there is really no vanilla restriction to the method. The minimum value of 1 still makes sense, as calling it with 0 or lower would do nothing.

Describe alternatives you've considered.

Only alternatives currently for the desired functionality are calling game internals.

Other

No response

rustic folioBOT
rustic folioBOT
#

This is just because the attack does actually knockback the entity twice. Dealing damage does knockback (see nms.LivingEntity#hurtServer). Separately, mobs & players can deal additional knockback via the minecraft:attack_knockback attribute - this extra knockback is also dealt when players are sprinting, since sprinting increases attack knockback for players by 1.

These are two separate sources of knockback, so the event will be called twice.

rustic folioBOT
#

Expected behavior

Calling Entity::new with a null Level within a custom implementation of Entity will create an Entity instance without requiring a costly Level object, useable for constructing packets which take an Entity as a parameter without huge overhead. The constructor will succeed even with a null Level.

Observed/Actual behavior

As of 2f58805, calling Entity::new in the described scenario throws a NullPointerException due to no null check being present for the Level in the recently merged custom despawn time system.

Steps/models to reproduce

Create a custom implementation of Entity, which passes a null Level to the super constructor. Create a new instance of the custom entity.

Plugin and Datapack List

None

Paper version

This server is running Paper version 1.21.4-187-main@1d5e5a5 (2025-02-28T19:53:30Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21-130-b1b5d4c (MC: 1.21)

Other

htt...

#

If you are using the entity just to send packets you could just send the packets without the entity object itself

I would prefer to not use an Entity object but some packet constructors (e.g. ClientboundSetPassengersPacket...) do not have a public constructor that does not take a nullable Entity as a parameter. Note all of the functionality used to manipulate the data serialized in this packet does not require a Level reference to use (e.g. Entity.passengers access is widened).

Image

rustic folioBOT
rustic folioBOT
#

What OP seems to be suggesting is that rather than the event being called twice, the expected behaviour would be that the event is called only once, only with increased force, compared to non-sprinting knockback events. A knockback event being called twice loses part of its' meaning and takes value away from the "knockback" attribute.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

Is the following theoretical scenario impossible?


When calling the EntityKnockbackByEntityEvent, since it inherits from EntityKnockbackEvent, it has the getCause() method, so it is possible to check what causes the Event. If it returns either SWEEP_ATTACK or ENTITY_ATTACK, and since EntityKnockbackEvent implements cancellable, could we cancel this knockback event? Since we already have the damage knockback. Only issue I can see, for now, is the amount of knockback. @electronicboy said that it was incremented when a player sprints, so I assume it will be associated with the event we pretend to cancel, and not with the damage knockback, so I fear the amount of knockback might become too little.

rustic folioBOT
#

Is your feature request related to a problem?

There is currently a bug in vanilla, where the compass (and clocks, have not tested) goes crazy. They spin around like they have taken something.... this only happens in dimensions outside the "vanilla overworld".

Describe the solution you'd like.

Getting the bug fixed.

Describe alternatives you've considered.

There is a workaround, using resourcepack:

Image

Other

I hope I posted this in the correct category.. since it's a vanilla bug - and not a paper bug.

rustic folioBOT
rustic folioBOT
rustic folioBOT
#

What prevents you from simply assigning the default world to the entity?

This is the plan.

I am not particularly a friend of introducing code changes just for NMS usage given people using NMS are expected to deal with breaking changes like this.

It's worth noting that null world constructor has had a null check in Spigot since at least 1.8, and is only broken explicitly by Paper now in 1.24.4. Vanilla 1.24.4 does not even use the Level at all in the Entity constructor. In this case, the breaking change was not introduced by Mojang, it is a Paper-only issue. If this change was introduced by Mojang I would not expect Paper to fix it.

#

NMS is not API and we reserve ourselves the ability to modify internals in whatever way we see fit at any point in time, including mid version, such as this change.

"Fixing" this (even tho it is not a bug as stated before) would be simple, I am just not particularly supportive of changes to NMS like this because I do not want to set a precedent in the community that NMS was remotely stable and that issues like yours are something people can expect to be addressed by us.

I'll throw it at some more people in the team, given that some of our other diff in Entity does null-check the level and given the "fix" is so simple, but yea.

rustic folioBOT
#

Stack trace

java.lang.RuntimeException: Failed to encode Minecraft Component: translation{key='chat.square_brackets', args=[empty[style={italic}, siblings=[io.papermc.paper.adventure.AdventureComponent@d7c3825c]]]}[style={color=aqua,hoverEvent=TypedHoverEvent[action=<action show_item>, value=net.minecraft.network.chat.HoverEvent$ItemStackInfo@9f802d36]}]; Value must be within range [1;99]: 169
	at io.papermc.paper.adventure.WrapperAwareSerializer.lambda$deserialize$0(WrapperAwareSerializer.java:28) ~[paper-1.21.4.jar:1.21.4-DEV-1d5e5a5]
	at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287) ~[datafixerupper-8.0.16.jar:?]
	at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:28) ~[paper-1.21.4.jar:1.21.4-DEV-1d5e5a5]
	at io.papermc.paper.adventure.WrapperAwareSerializer.deserialize(WrapperAwareSerializer.java:13) ~[paper-1.21.4.jar:1.21.4-DEV-1d5e5a5]
	at io.papermc.paper.adventure.PaperAdventure.asAdventure(Pape...
rustic folioBOT
#

The ItemStack ctors/factory method did never enforce this amount, not prior to 1.20.4 either.
We actively decided not to include such a check as it was/is semi common to create an oversized ItemStack and send it off to Inventory#addItem, which correctly handles these items by splitting them.

For this case, we'd be able to throw a precondition in the ItemStack#asHoverEvent method given hover events always fail with oversized items anyway. The factory methods are to be left untouched.

rustic folioBOT
rustic folioBOT
#

When the PlayerInteractEvent gets canceled, the destroyPos field won't be updated, meaning the block won't get broken because the position doesn't match in the check at ServerPlayerGamemode line 261. However, the default value for destroyPos is BlockPos.ZERO.

This leads to the condition returning to true if the player has not mined any blocks before, even if the interactevent was denied. The issue also happens if someone is allowed to break a block the first time, but is denied the second time, since the destroyPos will stay the same

This commit fixes #12196 by making the destroyPos nullable instead of using BlockPos.ZERO as a null value.

rustic folioBOT
rustic folioBOT
#

Okay i found a way to replicate this.

ItemStack itemStack = new ItemStack(Material.STICK, 200);
player.sendMessage(Component.text("Item1").appendSpace().append(itemStack.displayName()));

this code not use the ItemStack ItemStack::asHoverEvent or ItemFactory::asHoverEvent, the code provided fails because the displayName used in the ItemFactory use the NMS method for displayname who add the hoverevent internally for show the item and use the NMS methods nothing with the paper/bukkit side.

Image

i think this make a little more hard fix and avoid mess (because cannot add a precondition for getDisplayName just for create an item over the limit if is used for split in inventory like lynx say)... unless wanna omit the hoverevent from NMS if the item has more size elements like.

public Component getDisplayName() {
        MutableComponent mutableComponent = Component.empty().append...