[SPIGOT-7558] World.Spigot#StrikeLightning/Effect isSilent option does nothing Created: 31/Dec/23  Updated: 25/Dec/24  Resolved: 31/Dec/23

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Shane Bee Assignee: md_5
Resolution: Fixed Votes: 0
Labels: None

Version: n/a
Guidelines Read: Yes

 Description   

Something I noticed recently in
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.Spigot.html#strikeLightning(org.bukkit.Location,boolean)
and
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.Spigot.html#strikeLightningEffect(org.bukkit.Location,boolean)

The boolean for isSilent actually does nothing.
Looking at the code, I see the param isn't even used.
Im assuming in the past it was used, and now Minecraft no longer supports it (based on a Quick Look at MC code)

My suggestion is to update the docs to state that option is deprecated and/or does nothing



 Comments   
Comment by md_5 [ 31/Dec/23 ]

It looks like the sound became client side in 1.17.
The method should therefore be deprecated and just redirect to the normal lightning methods.

Comment by Shane Bee [ 31/Dec/23 ]

Okay 2 things:
1) My apologies. I was looking at the code via a plugin of mine that was using PaperWeight. Im assuming paper removed that.

2) Im super confused then, as LighitningBolt entity in Minecraft doesn't appear to have an isSilent field. Are we sure that actually works?
Im currently looking at mappings, and decompiled MC (Which I can't send here) but there appears to be no such field for isSilent... but looking at the patch you sent, I see it was added, but the code is as follows:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0040-Implement-Silenceable-Lightning-API.patch#24
The sound is played only on the client (not the server) so basically that line is ignored
(correct me if im wrong)

Comment by md_5 [ 31/Dec/23 ]

Looks used to me: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0040-Implement-Silenceable-Lightning-API.patch#42

Generated at Sat Apr 05 09:38:19 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.