#help-development
1 messages · Page 1090 of 1

What are the default values of the player's speed and attack attributes? 1.0?
you can get them with AttributeInstance#getDefaultValue
I would like to spawn 3 armorstands: in front, to the left (90° to the left) and to the right of a player, then have them destroy themselves 0.25s later.
How may I do this 🤔 ?
You can use the bukkit scheduler to coordinate code to run 5 ticks (.25s ideally) later
In fact what I don't know at all is how to make them spawn :(. With a custom data to dectect if the player clicked on it.
I have these utilities to get the left and right direction:
/**
* Gets the direction to the left of this block face.
* @return The direction to the left.
*/
fun BlockFace.getLeftDirection() =
when (this) {
BlockFace.NORTH -> BlockFace.WEST
BlockFace.WEST -> BlockFace.SOUTH
BlockFace.SOUTH -> BlockFace.EAST
BlockFace.EAST -> BlockFace.NORTH
else -> this
}
/**
* Gets the direction to the right of this block face.
* @return The direction to the right.
*/
fun BlockFace.getRightDirection() =
when (this) {
BlockFace.NORTH -> BlockFace.EAST
BlockFace.EAST -> BlockFace.SOUTH
BlockFace.SOUTH -> BlockFace.WEST
BlockFace.WEST -> BlockFace.NORTH
else -> this
}
its a Player so it will not be BlockFace
Yea but you can get the direction the player is looking
it will not align to a BlockFace though
Well yea, I use these for a slightly different purpose but w/e
You can still just get the nearest
for a Location```java
/**
* Location left or right of the source.
*
* @param location the source.
* @param offset distance to the new Location.
* @param direction LEFT or RIGHT
* @return a new Location LEFT or RIGHT of the origin.
*/
public Location getSide(Location location, double offset, SIDE direction) {
double rad = Math.toRadians(location.getYaw() + ((direction == Side.LEFT)? 0: 180) );
double x = Math.cos(rad);
double z = Math.sin(rad);
Vector shift = new Vector(x, 0, z).normalize().multiply(offset);
Location finalLoc = location.clone().add(shift);
finalLoc.setDirection(location.getDirection()); // Set same facing as the Location.
return finalLoc;
}
public enum Side {LEFT, RIGHT}```
why is side uppercase
enum
Yea but the enum name
ah yep, thats wrong
How would I get the second value of the hashmap
well, it could be argued it is a constant
I disagree
tabs or spaces
in what?
there was one that uses less bytes
okey nice thanks
others use spaces 😉
I think in vscode im using spaces
There is no definitive reply
I think most use spaces these days
tabs are a remnant from old type writer days
Just use .editorconfig and your IDE will handle it on reformat
In this case it's for left?
that code will give you left or right. you choose
yes, 1.0 is one block
Oh okay.
Is it possible to display the entity's health above its head in this manner?
This option only applies to players
then what could I use instead?
text display
You can mount a text display on an entity and give it an offset
Add Passenger?
is it possible to make the health value in the textdisplay automatically updated?
Only via events
not that I know, its just a piece of text
so you have to update it manually
holy spam lol
which events?
sorry for not knowing java aswell as you do
Figured it out anyway
It's not a list, the lookups are key dependent in a map
HashMap<Player, Player>
what about it
You assign a key to a value and to get said value you have to retrieve using said key
also something I would change is instead of player save their UUID this way it can still work if the player logs out depending on the usecase
as the player object is invalid when a player logs out or relogs
so what
So you should handle people logging anyway
then it would make sense to use uuid even more
eh
player / uuid doesn't make much difference here
UUID is better practice however
oh yeah let me do something with the message I got from the player that has logged out
You wouldn't...
How may I spawn armor stands, with a transparency very low with these positions and add custom data, like "lores" for items:
Location target_loc = target.getLocation();
Location left = getSideLoc(target_loc, 1.0, SIDE.LEFT);
Location right = getSideLoc(target_loc, 1.0, SIDE.RIGHT);
Location front = getFrontLoc(target_loc, 1.0);
They logged out so the replying is no longer valid which should be handled anyway
yeah but they might handle it like a queue
Based on their responses I don't think they know how to implement that
i.e. the message still gets sent but only received when the other player logs in
well its about the principle anyways
dude
but this is going nowhere
What do you mean by "transparency very low"? Do you want them to be invisible?
And what do you mean by "custom data, like "lores""? Give an example. Entities dont have any lore.
He barely knows java
then he shouldnt be making plugins
And for some reason he is so let us help
but I guess until they run into issues it doesnt really matter to change it to uuid
Ghostly type, so that it's not too visible, and in fact I need "custom data" to know if the player has tapped the armorstand and if he has done it does something, but I want to check that it's these armorstands and not others.
i dont think thats possible in minecraft vanilla
unless you use chainmail armour or something
This is why text displays exist
Display entities have an opacity. But with actual armorstands this is impossible.
What is your overall goal?
In fact I'm trying to make a cmd to test a player if he has a ff, and by spawning armorstands around him with more than 180° degrees to do in less than 0.25s. I was thinking of armorstands but would there be another more practical thing?
ff?
Forcefield.
Armorstands are almost always ignored by hacks
Does someone know in what version are EntityEffect and player#attack methods added to spigot api?
The proper way would be to send the player an entity packet, and check if the client sends an interaction for it back immediately.
This is not documented properly anywhere. Would have to dig through stash for that.
What prevents you from simply using 1.20 or 1.21? Why do you need to explicitly need to know when this API was implemented?
ProtocolLib would probably be the easiest
Creating a plugin with multi-version support. I wanna know for which version I should use reflection
and for which I can simply go with spigot api
I meaaan, you can't control the opacity, but you could add them to a team and make them invisible :d (although I'm not sure if that works, can't say I've messed with team options that much)

Hi smile
Could wrap that in a class
LocationPositioner
getRightBlock, getLeftBlock, etc
spawn location is null?
public static MapConfig deserialize(Configuration config){
double minY = config.getDouble("minimum y");
Vector spawn = config.getVector("spawn location");
return new MapConfig(minY, spawn);
}
replace space with a dot
i mean, you can use spaces in paths, just, they'll be quoted in the yaml
yes
but that isn't how you define a vector in yaml, that's just an array of ints
Hello, if you know, can I know how to teleport a minecraft player from the hub to the last position where it was in survival? , I would need for my minecraft server but I can’t find anything on the internet, Thanks
are you making a plugin?
i replaced it with "spawn location": [0, 100, 0] but it still returns null
because it's not a vector, so getVector won't find a vector
that's just an array of ints
no, I’m just looking for what is the plugin that teleports you to the last location where you were
vectors are annoying to write manually, like
==: !org.bukkit.util.Vector
x: 1.2
y: 3.4
z: 5.6
#help-server then
ok thank you
and idek if that's correct
it's easier to just have it in your code config.set("whatever", new Vector(1, 2, 3))
its not plugin, its a setting in the spigot server properties file
forget exactly where
and I think maybe bungee has a setting too
ok thank you i wiill parse it from int array
hi, when i tp a player to another world does he lose his inventory, if i tp him back to the original world do his advancements/xp/stuff get saved?
inventory dont change with tp
i read there is aconfig which allows each world saving its own inventory
or smthn
it is set to true by default
try and see, idk how inventory are saved but there's never a problem with inventory sync while you stay in the server (sync inventory between server its more difficult but its another history)
They aren’t saved by default
You have some plugin like multiverse inventories for that
really? for others worlds teleport maybe, tp from default world to default nether/end will save it but not custom worlds you mean?
so lets say im making a minigame that involves another world, whenever a player joins the minigame world id have to save his inventory/xp/health and whenever he leaves the game i load it back?
there isnt a way to do this without addons?
Inventory is the same across all worlds by default
so there is an option to disable this and make each world have its inventory
thats my question
Not without a plugin
alr thnx
this wouldnt make sense as it means losing your items when you step through a nether portal..
unless by save you mean keep the player data
BlockBreakEvent
Called when a block is broken by a player.
Isn't this kind of counter intuitive?
BlockBreakEvent sounds like it'd be for a general block break
not necessarily by a player
hey, I would like to ask if someone could help me with fixing my plugin (glitch)
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I just can't send recordings here :/
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
tell that to whoever came up with that name 13 years ago lol
I guess you mean that
bukkit moment
I think most other ways have different events
Looks like you doing something in a scheduled task every 20 ticks. Is that an actual player?
what version
You’re sending a spawn packet each time?
Should only really do that when it’s needed. Use a teleport packet
I dont understand the purpose of this code
:/
players' own render distance system
Also using mapped and non mapped code
oh spigot doesn't have per-player send view distance
This method of mine works, but the problem is that the prostate glands rotate so much
I know that
What
Keep track on who sees who and just dont send packets if the player already sees his target
What
Yes, but that's just terrible naming
This has to be some sort of joke
and why isn't there a block break event that works for every block break

huh
If anyone here has used ACF (aikar commands) before, do you know if you can put subcommands in different classes?
How would I even go about doing it tho
Just try declaring it as another command, just with the same @CommandAlias
Hello slightly off-topic, is there a way to convert an item (the lore or however it would be displayed in-game) into an image
Oh yeah good idea I’ll try that
Sort of similar to InteractiveChat, but it's not on spigot
It's a forge mod that i've been working on
Just one of those command generators online
Just draw text on that background
Hello, how can I get the last resources update (Like the page: https://www.spigotmc.org/resources/) thru the api (api.spigotmc.org)?

lol
its too slow to do anything ok with it (https://api.spiget.org/v2/resources/recentUpdates)
Holy fuck that is slow
No idea then
Wait are those not cached? What is it doing so long?
🗿
braindead
what
its cached
like the last update is like 30-60 minutes old
but the servers are slow
Bet they're doing some kind of web scraping
But just have some shitty regexes
Like that one cloudflare regex moment
spigot dont have an API for this?
Pretty sure they discourage using something like that
because they don't like robots accessing spigot 😂
Does anyone know how I can find the vanilla game's enchanting logic?
e.g. what chance there is to get multiple enchantments at what level etc
You can work through the code backwards. If you start by looking at the Enchantment table
see what methods it calls and check those
my poor plugin installer
Friend?, only the debug message is working, can you help? It doesn't give an error in the console
there wouldnt happen to be an event api for when the vault block changes its state when a player is near it would there?
when i run /pvp i get this error
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.flags.StateFlag;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import work.constt.simpleCore.SimpleCore;
import org.bukkit.plugin.java.JavaPlugin;
import static org.bukkit.Bukkit.getServer;
import static org.bukkit.Bukkit.getWorld;
public class pvp implements CommandExecutor {
private boolean a = true;
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
World world = (World) getWorld("world");
RegionManager regions = container.get(world);
ProtectedRegion region = regions.getRegion("area");
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (a) {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fenabled pvp!");
region.setFlag(Flags.PVP, StateFlag.State.ALLOW);
} else {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fdisabled pvp!");
region.setFlag(Flags.PVP, StateFlag.State.DENY);
}
a = !a;
return true;
}
}
Cannot execute command 'pvp' in plugin SimpleCore v0.0.1 - plugin is disabled.
check the log during startup for errors during enabling
do you have WorldGuard as a depend/softdepend in your plugin.yml?
Looks like WorldGuard is disabled
Check for startup errors
doesnt say its disabled
[17:11:30] [Server thread/INFO]: [WorldGuard] (world) TNT ignition is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world) Lighters are PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world) Lava fire is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world'
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_nether) Lava fire is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_nether'
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_the_end) Lava fire is PERMITTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED.
[17:11:30] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_the_end'
[17:11:30] [Server thread/INFO]: [WorldGuard] Loading region data...
[17:11:31] [Server thread/INFO]: Running delayed init tasks```
clean build?
mvn clean package
rn i build it with build artifact and then build
what one?
you're not gonna believe what i'm about to say
ok? 😄
xD
and??? dont make it so intresting
lol
:}
you really gotta get in this troubleshooting mindset
Emily isnt wrong issue is clearly in startup
is there api to register custom enchantments now?
no api
sucks
gotta do it through data packs
no still have to do the fun stuff
or heh the same way night express does his for excellent enchants xD
at least there is a supported mechanism for custom enchantments, unlike before
actually, if you could make the custom enchants by name in a datapack, and such you could have a plugin handle the rest for the actual enchant. For the most part.
.<
but meh
You'd have to touch the plugin loader for that
Quite the scary endeavor
I did 😭
:D
send the whole log
oh
...
you have load: STARTUP in your plugin.yml, don't you?
yeah that's the issue;
your plugin enables before worlds load
worldguard enables after worlds load
you are trying to use worldguard when your plugin enables
worldguard is not yet enabled
if you have no reason to use load: STARTUP, remove it, otherwise if you do need it, there are other ways around it
Hi, I have a question. I have a library project, and then a plugin that shades that library into its jar file. However, I have an issue. My library plugin also uses stuff from another library, which means that instead of only shading my library project into my plugin, I have to shade in my library project and this other dependency. Is there a way to make it so that in my library project, it automatically will shade this other dependency into the jar file if the plugin depends on this library? I am using gradle.
That is not the same error, I believe your previous issue was fixed, look at the new error
its asking if my own plugin is up to date but it should be
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.CraftWorld cannot be cast to class com.sk89q.worldedit.world.World
It is telling you what the error is
You cannot cast a CraftWorld to a worldedit world
https://github.com/EngineHub/WorldEdit/blob/version/7.3.x/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java THat is their own class
Did you import the wrong .World
@drifting bluff code?
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.WorldGuard;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.flags.StateFlag;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import work.constt.simpleCore.SimpleCore;
import org.bukkit.plugin.java.JavaPlugin;
import static org.bukkit.Bukkit.getServer;
import static org.bukkit.Bukkit.getWorld;
public class pvp implements CommandExecutor {
private boolean a = true;
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
World world = (World) getWorld("world");
RegionManager regions = container.get(world);
ProtectedRegion region = regions.getRegion("area");
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (a) {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fenabled pvp!");
region.setFlag(Flags.PVP, StateFlag.State.ALLOW);
} else {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fdisabled pvp!");
region.setFlag(Flags.PVP, StateFlag.State.DENY);
}
a = !a;
return true;
}
}
you can't just cast a regular bukkit World to a worldedit World
see the BukkitAdapter class
Is World supposed to be WorldEdit.world or Bukkit.World
Looking at the spelling of the word “world” just feels wrong
what
Just as I said 🤷♂️

is there a way to use private pathfinder goals in nms classes?
like i wanna make a custom nms entity based on the drowned mob
and i want its pathfinder goals with it
but theyre private
anywone here?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
no, it's bedtime in europe, everyone's asleep
it's 6:21pm silly
i am sleeping
exactly
sleeping at work 
are you at work?
yes
i thought you couldn't answer any questions
NO
:trollface:

org.bukkit.command.CommandException: Unhandled exception executing command 'ss' in plugin MixelsSystem
sucks to be you
org.bukkit.command.CommandException: Unhandled exception executing command 'ss' in plugin MixelsSystem v2.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:999) ~[paper-1.20.4.jar:git-Paper-436]
at org.bukkit.craftbukkit.v1_20_R3.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.4.jar:git-Paper-436]
at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-
oh no!
a null pointer !
surely it's a bug in paper
100%
is that a question
I thi n k you got a null pointer
MixelsSystem 2.0
i cant send file
bug
Damnnn :(
:(
no file no answer
Hey, i think this is the right place to ask, what would be the best way to implement a custom world format?
I literally was talking about making an own world format today
not really
hey
the anvil format is not the best
i paste it
it works
save the paste and send the link
I got this problem can some body help
when I try to compile jar
I get that error saying
cannot access io.lumine.mythic.core.mobs.ActiveMob
and dependancy is added to pom.xml
Click External Libraries on your project menu and check if the library is there
maybe the library is there but the class name got changed between versions or smthing
jsut to be sure
"A non-stable dependency is a dependency which refers to or affects the global state, such as external service, file system, or a database.
However, there still are dependencies which are better represented using Singleton. They are ambient dependencies. Ambient dependencies are dependencies which span across multiple classes and often multiple layers. They act as cross-cutting concerns for your application."
does anyone know if spigot is robot friendly? (as in my robot wont be blocked by the website)
im tryna make a util that will check resources for red flags
It is not
hopefully i can do what i need with just api
XD
robot fwendly 🥺
is kacper a rwobot 🥺
@onyx fjord
🤣
it's a theoretical question, how can we confirm that you are not a robot?
spigot API is not sufficient, we might need packets for this dirty job
if I want to have a permanent armorstand hologram on my server, what is the best way to create it? not from inside the plugin?
my robot dog can do that
✨ display entities
what's that?
something other than an armor stand?
a new minecraft feature, basically native holograms
armorstands were just a trick, now you can spawn actual holograms
oh shit
whats the class called?
display entities are lighter on the server, and have more features
u can for example spawn display items
and scale display entities
declaration: package: org.bukkit.entity, interface: Display
check subinterfaces
u can do text, blocks and items
Dope
new favorite gif?
If the magic level of the item in the inventory is 1 and the magic level of the book in my hand is 1, I prevent that item from appearing in the gui.
But it's not working
Damn okay
Yes yes we are
another favorite
val isSameLevelAsBooks = books.any { book ->
EnchantmentUtils.getStoredEnchantmentLevel(book, enchantment) == itemLevel
}
whats wrong
Idk tbh
mhmm
provide more context
You're so kind and straightforward
well my question about holograms still stands
where is the best place to create it?
like the first time the server boots up it wont exist so I need to create it
but I dont need to create a new one every time the server starts
hell yea
Depends
If you have all the locations predetermined at the start but why remove them on shutdown?
Then you don't need to Recreate them
Hi! Does anyone know about packets in 1.20.1? I need to change the nametag text with packets.
can i extract the nametag text out of this one? [b[id=16, serializer=net.minecraft.network.syncher.DataWatcherSerializer$1@4bd30626, value=0]]
hey, I have a question: is it possible to disable the "Player health indicators" mod that displays the opponent's hearts above the nickname? https://imgur.com/a/f3qwIz1
yes but if I create them in server startup then it will create a new one every time the server starts
I only need it to create one if there isnt one already
so should I check if it exists, and create it if it doesnt?
Sí senor
okay so if its a TextDisplay do I just check the area for entities and loop through them to see if its there?
Sure
Im running into some issues comparing Inventory objects.
In my GUI class that implements Listener to handle click events I have this constructor set up:
private final Inventory inventory;
public TestGUI() {
this.inventory = Bukkit.createInventory(null, 27, "Test");
setItems();
}
However, after opening the GUI and clicking around the InventoryClick event handler always returns false:
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
System.out.println(event.getInventory() == inventory);
}
What am I missing? How is this not the same reference? Should I write my own equals function and check them that way?
_ _
I found a lot of examples and they all use this or something similar, except it works for them. I also see a lot of people checking the name of the inventories, but that just looks bad to me from a programmer's perspective and wouldnt even work in my usecase.
yeah thats what i thought, but a surprising amount of examples do it
Could you show your usage of that class
It's only used in this class where the openGUI function is called when a certain block is right clicked.
private final Map<String, TestGUI> guis = new HashMap<>();
private void openGUI(String guiID, Player player) {
TestGUI gui = guis.get(guiID);
if (gui == null) {
gui = new TestGUI();
guis.put(guiID, gui);
}
gui.openInventory(player);
}
and where are you registering the listener
In the OnEnable() in my main JavaPlugin class:
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new RightClickListener(), plugin);
getServer().getPluginManager().registerEvents(new TestGUI(), plugin);
this.saveDefaultConfig();
}
computeIfAbsent
So I should register them in the openGUI function above?
I don't know what you mean by this 😅
how can I make a TextDisplay always point towards the player like a nametag on an armorstand?
its a method on a map which makes you write that method in one line
oh I'll look into that thanks
== and equals() is not the same
it is in the case of inventories
How are you opening it?
this openGUI function is called when a certain block is right clicked
and that calls this:
public void openInventory(HumanEntity entity) {
entity.openInventory(inventory);
}
And what is the inventory variable here?
In the EventHandler
I'm not sure if this is what you meant, but I removed the registering from the onEnable function and changed the openGUI function to this, but unfortunately that doesn't change anything.
private void openGUI(String guiID, Player player) {
TestGUI gui = guis.get(guiID);
if (gui == null) {
gui = new TestGUI();
plugin.getServer().getPluginManager().registerEvents(gui, plugin);
guis.put(guiID, gui);
}
gui.openInventory(player);
}
Can you show your entire RightClickListener pls
And why do you even need to register the GUI itself
That's the private final Inventory inventory; that every instance of the TestGUI has, which is the same as I'm comparing in the EventHandler there
Because the ClickEvent handlers are in there as well
Yeah but you are creating a new instance when registering it
So it will never be the same reference
TradeGUI shouldn't be a listener, have only RightClickListener and loop through your cached GUIs in there
public class TestListener implements Listener {
private final Map<String, TestGUI> guis = new HashMap<>();
@EventHandler
public void onBlockClick(PlayerInteractEvent event) {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
Block clickedBlock = event.getClickedBlock();
if (clickedBlock == null) return;
Location clickedLocation = clickedBlock.getLocation();
if (!isRegisteredLocation(clickedLocation)) return;
Player player = event.getPlayer();
String guiID = String.format("%s-%d,%d,%d", player.getUniqueId(), clickedLocation.getBlockX(), clickedLocation.getBlockY(), clickedLocation.getBlockZ());
openGUI(guiID, player);
}
private void openGUI(String guiID, Player player) {
TestGUI gui = guis.get(guiID);
if (gui == null) {
gui = new TestGUI();
plugin.getServer().getPluginManager().registerEvents(gui, plugin);
guis.put(guiID, gui);
}
gui.openInventory(player);
}
...
Don't register TestGUI
And don't have it be a listener
Then pull your guis field up into another class, that passes that reference to both TestListener and RightClickListener
?gui
Im not sure what you mean by that
I've only been messing around with Spigot for about a week nwo sorry 😄
is there no way to make TextDisplays point toward the player like armor stand nametags do automatically?
hey, I have a question: is it possible to disable the "Player health indicators" mod that displays the opponent's hearts above the nickname? https://imgur.com/a/f3qwIz1
Do you have an example of this? I messed around some more but still couldn't get it to work. I have to go now but I'd be happy to hear from you 🙂
Is there any way to manipulate the players camera to force them into an f3 type view via a plugin?
No
anything similar i could do?
You won't be able to only remove the bar, if the client knows the entity, then it also knows its health
Depends on what you are trying to achieve
have the player view themseveles from a third person perspective, only way i can think of it making a fake player and then setting the player into spectator and move the fake player
Can you force a player as a passenger on an armor stand?
Perhaps you can play with this @hidden spade
not sure it would exactly work for my use
but thank you for the idea 🙏🏼
My only concern is that I'm not sure how you'd still let the player move around
whether it be an armor stand or another entity
the only way i can really think rn is spawning a fake player and setting the player invisible
then just mirroring the packets from the player to the fake player
hacked clients use it quite often
yeah
I'm not too sure on how people do npcs but yeah I think that's your best bet
its something like this
public void spawnFor(Player p) {
PlayerConnection connection = ((CraftPlayer) p).getHandle().playerConnection;
// add player in player list for player
connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, # EntityPlayer instance));
// make player spawn in world
connection.sendPacket(new PacketPlayOutNamedEntitySpawn(# EntityPlayer instance));
// change head rotation
connection.sendPacket(new PacketPlayOutEntityHeadRotation(this, (byte) ((loc.getYaw() * 256f) / 360f)));
// now remove player from tab list
connection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, # EntityPlayer instance));
}
I feel like you'd do two entities, one for the player model, and one for the like f3 view kinda thing
the f3 would the the actual player
Yeah but I'm just figuring how you'd actually put the player here
wdym?
Just woke up lol I meant put
i guess you would just force the player into the sky using packets
may cause some issues with ac's though not sure
Well that's why i'm suggesting a second entity, passenger the player to this entity and maybe some magic to relay movements to both the passenger entity and the fake player
less packet work imo is better
well the minecraft client is recieving thousands of packets a second same with the server whats another thousand more xD
if i wanted to make custom chat formatting would i just cancel the asyncchatevent and then Bukkit.broadcast the new message?
Anyone have an API that can convert an item's tooltip to a png or similar? Trying to create something for forge, so if spigot users have something i can start off with
wdym?
Yeah but still, when you can use the api, I think most people would suggest it
very true
its only an idea im having for a plugin im working on would be cool if i got it to work
but im still trying to figure out how the "new" display entities work
so i can make custom crops/blocks
They're quite easy actually
This is a text display example, rather for displaying gradient formatted text but still
I get the basics of how they work just not sure how to get my hitbox right
ew bounding boxes
because in a normal block you would use a barrier no?
but with crops you can walk through them and trample them and all
but then i still have to be able to break them
all the homies hate bounding boxes
Well we do have sendBlockChange / related methods in the api now
any chance you would have a simiple enough example on a custom crop plugin xD
all the ones ive looked at are like oraxen
Unfortunately no, never made one, but I feel there's probably some open source one?
which is a cool plugin and all but the codebase is way to messy to learn anything from
ive found ones for blocks only but never crops 💔
I feel like it's the same concept
I mean most things are handled in the crops pdc anyway
im more concerned about the hit boxes
I'm no help there either lol, messed around with bounding boxes once and uh not doing that again for a while kek
they arnt that bad in mods
I wonder if @floral drum knows
i used to be a hacked client developer so i used them alot for prediction algos for best placement of crystals during ca
Well minecraft trusts the client too much anyway so I feel at the heart of most hacked clients its just some packet manipulation no?
sometimes
but when it comes to ac's thats where it gets fun
some ac's have weird work arounds that arnt even possible in vanilla minecraft properly
we made an elytra fly module that using a flaw in the ac we could acc at 720kmh / about 200 blocks a second before the ac reset the player and then just do it all over again
What in the fuck
@Override
public void onUpdate() {
if (timer.passed(1000)) {
prevPosX = mc.player.prevPosX;
prevPosZ = mc.player.prevPosZ;
}
if (timerTakeoff.isEnabled() && !tookOff && (mc.player.isElytraFlying() || takeOffTimer.passed(3000) || mc.player.onGround) && checkTime) {
mc.timer.tickLength = 50f;
tookOff = true;
checkTime = false;
}
if (timerTakeoff.isEnabled() && mc.player.motionY < 0 && !tookOff) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
mc.timer.tickLength = 50f / timerSpeed.getValue().floatValue();
checkTime = true;
}
if (!mc.world.isBlockLoaded(new BlockPos(mc.player.posX + mc.player.motionX, mc.player.posY, mc.player.posZ + mc.player.motionZ), false)) {
mc.player.motionX = 0;
mc.player.motionZ = 0;
}
if (mc.player.moveForward > 0.0f) {
ticks++;
if (ticks % 4 == 0 && ticks % 16 != 0) {
fricLiv += (step.getValue().floatValue() / 100f);
fricMove += (step.getValue().floatValue() / 100f);
}
} else {
ticks = 0;
}
mc.gameSettings.gammaSetting = 1000f;
}
I did this once thinking the lower value slowed it down
thats a code snippit of how i did it
That's kinda cursed lol
u think thats cursed?
private static final float MOVE_FRICTION = 4.02f;
private static final float LIVING_UPDATE_FRICTION = 3.170326f;
these where pretty much the exact values you had to use to the point
otherwise it wouldnt work
How did you find these values is my question lol
alot of redbull cans
fair enough kek
kinda just messed around enough that it started working
and cuz you have hotswapping in ides
i would just change it hotswap class try again
if I want to import file with the data path like read a file and I send into the function to read the file "fire.txt", where do I have to place my file once my plugin is builded and in my plugins folder?
in the plugin folder
When .jar files?
Or make another folder that it goes inside
the plugin by default access /plugin when its loaded so ideally you would make a folder for your plugin and place it there
.saveConfig or other method automatically creates the data folder btw
Well I am trying to link firebase and spigot and... I placed the firebase.json file in plugins folder, the folder of my plugin and others place and nothing...
@blazing ocean do you know if there is a way to get static extension functions in kotlin e.g. SomeJavaClass.thing() vs instance.thing()
static extension functiond don't exist sadly
top level functions
damns whatever ig
^
Could anyone help me with this? b[id=2, serializer=net.minecraft.network.syncher.DataWatcherSerializer$1@2ed6d7a1, value=Optional[empty[siblings=[literal{Weak!}[style={color=red,bold,!italic,!underlined,!strikethrough,!obfuscated}]]]]] im receiving packets in 1.20 and trying to modify the nametag inside the packet so how could i edit this and send it back?
wouldnt companion object work here?
that's what I'm doing anyways
Pretty sure he meant adding static functions
can't add Companions to a java class
that would work if it were extending kotlin
FileInputStream serviceAccount =
new FileInputStream("firebase.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("url of my db")
.build();
FirebaseApp.initializeApp(options);
``` This is my code, I put firebase.json into plugins folder in my server files and... getting an error (I did a try catch).
ah i thought you had a full kotlin cb
if i had a custom CB instance I'd just add the methods myself :P
what error
Saying that it does not find my file.
Probably need to be in the server root if you only specify file name like that
You should tell it to look in your plugins data folder
^
Or you can tree it even more
What even is it that gets call after the player loads in?
Do you mean protocol?
PlayerJoinEvent?
yeah or api
https://paste.md-5.net/ayuhixarif.md it's in french so some words are french xd.
that is before the player is loaded
Define loaded
uhh you can play?
._.
on join happens during the connecting bit and the player loads after that event have been called
[22:44:08 WARN]: at fr.program.neoworld.Database.FirebaseManager.initialize(FirebaseManager.java:13)
can you send us this class
idk how else to say it ;sob
Let's try this again, what are you doing
package fr.program.neoworld.Database;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import fr.program.neoworld.Main;
import java.io.*;
public class FirebaseManager {
public static void initialize(Main NeoWorldPlugin) {
try {
FileInputStream serviceAccount = new FileInputStream("firebase.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("my urlF")
.build();
FirebaseApp.initializeApp(options);
} catch (IOException e) {
e.printStackTrace();
}
}
}
I've seen on other servers that they somehow block it. it means that, for example, it still shows me that the player has 1 heart
You're not dictating a place to search it seems
I thought it could be done in packages somehow. or that some antiheat is blocking it
So I have a manager that applies a shader to the player during a certain effect, the effect can only be applied once the player has fully loaded in otherwise it doesnt work
You've got to define where your file function is actually going to look, ie: your plugin's data folder
Yes you can intercept the info packet and modify the health value
You’d have to mess with outgoing packets
How? I set my working directory in the run of spigot jar.
It's server folder.
You can probably fake it yeah, just not remove it
@EventHandler
public void onPlayerJoinEvent(PlayerJoinEvent event) {
PlayerModel playerModel = this.plugin.getPlayerManager().getPlayerModel(event.getPlayer(), event.getPlayer().getUniqueId());
Player player = event.getPlayer();
System.out.println("Checking if player is tripping on starbrew");
}
[21:47:16] [Server thread/INFO]: Checking if player is tripping on starbrew
[21:47:16] [Server thread/INFO]: Appai joined the game
[21:47:16] [Server thread/INFO]: Appai[/127.0.0.1:62803] logged in with entity id 319 at ([world]33.40283129165808, 71.0, -32.9072558058955)
the only question is how it can be cheated. because with packages, I also knew that I had already tried it and it didn't work 😦
Don't rely on those messages. As far as the server is concerned you have fully joined the server by that point
Packages? Checkout ProtocolLib and modify outgoing packets
From what you're trying to do you probably want to know when the resourcepack has been applied
Not when they have joined
So use https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerResourcePackStatusEvent.html
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
Sounds like something in your code is wrong
Could you share it
?paste
Send the full path to firebase.json but now getting error :(.
[22:51:48 ERROR]: com/google/firebase/FirebaseOptions$Builder initializing NeoWorld v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/google/firebase/FirebaseOptions$Builder
at fr.program.neoworld.Database.FirebaseManager.initialize(FirebaseManager.java:15) ~[?:?]
at fr.program.neoworld.Main.onLoad(Main.java:57) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:296) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:744) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.Bukkit.reload(Bukkit.java:534) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:353) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:317) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
Caused by: java.lang.ClassNotFoundException: com.google.firebase.FirebaseOptions$Builder
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_422]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_422]
at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_422]
... 14 more
So the issue is that code that doesn't exist cannot run. You need to include Firebase in your plugin via a process called shading
?
?
Did not understand.
The firebase code is missing at runtime
Code that doesn't exist cannot run
So you have an error
Yes and? ```gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.0'
}
group = 'fr.program'
version = '1.0'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly 'org.spigotmc:spigot:1.8-R0.1-SNAPSHOT'
implementation 'com.google.firebase:firebase-admin:6.11.0'
implementation 'com.google.guava:guava:32.0.0-android'
}
shadowJar {
archiveClassifier.set('')
mergeServiceFiles()
dependencies {
exclude(dependency('com.google.guava:guava'))
}
manifest {
attributes 'Main-Class': 'fr.program.neoworld.Main'
}
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
setLibsDirName("../server/plugins")
How I put it into shadow jar then?
You should use the goooler fork of shadow
??
And what's the name?
Files.newInputStream(plugin.getDataFolder().toPath().resolve("firebase.json"))
Indeed
idk what is going on with shadow that repo is already deprecated
but there is literally no other version 8.1.8 posted
now its under https://github.com/gradleup/shadow but no updates
huh
wdym
I mean the new version moved under the repo posted above but they haven't updated it properly since 2023
Hey, So i have a code that replenish the crops you break, however this is consuming a lot:
Should i use nms to avoid this or is there other way?
it's not fully moved to the gradleup org yet, that's why
the problem is the setBlockData or setType
kinda premature to archive the old one then no, atleast my opinion.
(Bukkit methods)
ah
the gooler shadow fork was the maintained version, now the johnrengelman repo has moved to a gradle managed one and gooler is maintaining it there
show code then
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'fr.program'
version = '1.0'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly 'org.spigotmc:spigot:1.8-R0.1-SNAPSHOT'
implementation 'com.google.firebase:firebase-admin:9.3.0'
implementation 'com.google.guava:guava:32.0.0-android'
}
shadowJar {
archiveBaseName.set('NeoWorld')
archiveClassifier.set('all')
mergeServiceFiles()
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
setLibsDirName("../server/plugins")
And getting this error:
[23:09:18 ERROR]: sealing violation: package com.google.common.base is sealed initializing NeoWorld v1.0 (Is it up to date?)
java.lang.SecurityException: sealing violation: package com.google.common.base is sealed
at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:405) ~[?:1.8.0_422]
at java.net.URLClassLoader.definePackageInternal(URLClassLoader.java:425) ~[?:1.8.0_422]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:457) ~[?:1.8.0_422]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_422]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_422]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_422]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_422]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_422]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:195) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:97) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_422]
at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_422]
at com.google.auth.oauth2.ServiceAccountCredentials.<init>(ServiceAccountCredentials.java:134) ~[?:?]
at com.google.auth.oauth2.ServiceAccountCredentials.fromPkcs8(ServiceAccountCredentials.java:439) ~[?:?]
at com.google.auth.oauth2.ServiceAccountCredentials.fromJson(ServiceAccountCredentials.java:199) ~[?:?]
at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:200) ~[?:?]
at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:166) ~[?:?]
at fr.program.neoworld.Database.FirebaseManager.initialize(FirebaseManager.java:17) ~[?:?]
at fr.program.neoworld.Main.onLoad(Main.java:57) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:296) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:744) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.Bukkit.reload(Bukkit.java:534) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:353) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:317) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
looks like youll have to open it
theres a jvm flag --add-opens or smth
or is sealed smth else
you are shading guava
🗿
either don't do that or relocate it
Removed an still not :(.
me looking at the last msg again without context
surely you must've gotten a different error
[23:12:31 ERROR]: sealing violation: package com.google.common.base is sealed initializing NeoWorld v1.0 (Is it up to date?)
java.lang.SecurityException: sealing violation: package com.google.common.base is sealed
at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:405) ~[?:1.8.0_422]
at java.net.URLClassLoader.definePackageInternal(URLClassLoader.java:425) ~[?:1.8.0_422]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:457) ~[?:1.8.0_422]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_422]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_422]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_422]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_422]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_422]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:195) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:97) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_422]
at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_422]
at com.google.auth.oauth2.ServiceAccountCredentials.<init>(ServiceAccountCredentials.java:134) ~[?:?]
at com.google.auth.oauth2.ServiceAccountCredentials.fromPkcs8(ServiceAccountCredentials.java:439) ~[?:?]
at com.google.auth.oauth2.ServiceAccountCredentials.fromJson(ServiceAccountCredentials.java:199) ~[?:?]
at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:200) ~[?:?]
at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:166) ~[?:?]
at fr.program.neoworld.Database.FirebaseManager.initialize(FirebaseManager.java:17) ~[?:?]
at fr.program.neoworld.Main.onLoad(Main.java:57) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:296) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:505) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
You are probably shading in an already existing sealed package
Wdym?
The package com.google.common.base is sealed. So if you load it on the classpath twice, you will get a sealing violation
No?
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'fr.program'
version = '1.0'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly 'org.spigotmc:spigot:1.8-R0.1-SNAPSHOT'
implementation 'com.google.firebase:firebase-admin:9.3.0'
}
shadowJar {
archiveBaseName.set('NeoWorld')
mergeServiceFiles()
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
setLibsDirName("../server/plugins")
Does exception.GetMessage return the same thing as exception.printStackTrace?
no
Don't understand :(.
write whatever tooltip minecraft displays when you hover over an item into a bufferedimage or similar, then output it so you can send your items as an image in discord or wherever you want
printStackTrace prints the whole stack trace, getMessage only returns the exception message, passed to the constructor
you may just have to make a custom renderer for it for just take a ss of it ingame
so something like
public static Image getFromItemStack(ItemStack stack) {
// magic
return tooltipImage;
}
ah
fun
yep
would be better off making like a api that you can send data to to render an image with
shadowJar {
archiveBaseName.set('NeoWorld')
mergeServiceFiles()
dependencies {
include(dependency("com.google.guava:guava:"))
}
}
``` with adding guava I am getting this error no but just it's due to deprecated function no?
[23:18:58 ERROR]: com/google/firebase/FirebaseOptions$Builder initializing NeoWorld v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/google/firebase/FirebaseOptions$Builder
at fr.program.neoworld.Database.FirebaseManager.initialize(FirebaseManager.java:14) ~[?:?]
at fr.program.neoworld.Main.onLoad(Main.java:57) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:296) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.reload(CraftServer.java:744) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.Bukkit.reload(Bukkit.java:534) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchServerCommand(CraftServer.java:632) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.aM(DedicatedServer.java:353) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:317) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]
Caused by: java.lang.ClassNotFoundException: com.google.firebase.FirebaseOptions$Builder
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_422]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.jar:git-Spigot-c3c767f-33d5de3]
at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_422]
at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_422]
... 14 more
[
it was more me trying to see if i can like capture the way minecraft does it in the first place, and instead of rendering it onto the screen render it into some other place that i can do stuff with
this has exactly what i want, except it's for fabric
and i can't make heads or tails of some of the methods
that has nothing to do with deprecated functions
i don't really feel like solving the whole issue for you; the problem is that firebase needs (a modern version of) guava, 1.8 has an ancient version of guava, so you need to shade guava, but the server gets mad, so you need to relocate it, see https://gradleup.com/shadow/configuration/relocation/ you'd relocate guava from com.google.common to your.funny.package.google.common or something idk
I'm using forge if that helps
you'd also want to relocate firebase
yes a bit different from spigot but, same principle
fairly sure there wouldnt be much difference i guess
There are a lot of significant differences between forge and spigot.
It is highly unlikely that any spigot knowledge will help you write forge mods, unless they are server-side only.
Hi, personally since the change to java 21 in spigot java development ive had some troubles. One of them is the way of sending action bars. Can anyone enlighten me on how to do that? (Ive looked on google)
The entire core principle is fundamentally different.
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
This is used for about 8 years now btw
Idk why, would like to know why tho. But i cant access the net.md_5.bungee classes in 1.20.6 spigot. Thats the only change ive done, change the spigot version,
I know. Ive used that before too. But as mentioned, since the update to 1.20.6 it doesnt work.
update Intelij
How? - I mean, ive already heard that tip, so i reinstalled intelij 3 days ago
No clue I don;t use it.
Okay, thanks anyway.
I just know Ij has issues since 1.20.6 if its not fully upto date
install JetBrains Toolbox, it'll make it a click to update
Glad that its not only me
I'll look into that, thansk,.
meanwhile me using the eap version and having >3 internal crashes a day
I've got quite a good understanding of spigot, done it for much longer than forge, if anyone has an idea of how to convert a spigot itemstack, that would help too
Using Eclipse, zero crashes per week 😉
The majority of the problem isn't to do with the version
i could even do this standalone, i would just need an itemstack object or similar
Are you writing something for a weird spigot/forge merge implementation?
not really, it's forge mainly. I just know some people here have quite good general knowledge in the minecraft field that's all
my google searches are going in circles
Then how would you "convert a spigot ItemStack"? You mean at runtime?
a more generalized question would be, what's the best way to convert a list of strings (with formatting) to a rendered tooltip
this is how minecraft displays it, idk if it's better to create my own image from scratch or somehow extract this?
so this is just an example with a title, enchantments and lore
basically just anything that's displayed in the lore
Just look at how the client renders the tooltip and copy a bunch from it.
Then throw it in your own renderer.
Problem is that there are now 2 ways of hogging the render pipeline.
But you are far better off asking at the forge discord for that.
what version did that change
1.19 i think
currently working in 1.12 :')
compatibility issues
at least there wont be a problem there
i'll go ask in the forge discord
thanks though
If I know the location of a TextDisplay entity, what would be the best method to get it?
idk if there is a better way usually I do Location#getNearbyEntities(location, 0, 0, 0, (e) -> e instanceof TextDisplay).findFirst()
why are you storing the location but not the uuid?
okay I'll see if that works better for me
this was the code I was using:
public static TextDisplay getDisplay(Block block, double radius) {
List<Entity> entitiesFullyWithinBlock = new ArrayList<>();
World world = block.getWorld();
int x = block.getX();
int y = block.getY();
int z = block.getZ();
BoundingBox blockBoundingBox = new BoundingBox(x - radius, y - radius, z - radius, x + 1 + radius, y + 1 + radius, z + 1 + radius);
for(Entity e: world.getNearbyEntities(blockBoundingBox)) {
BoundingBox entityBoundingBox = e.getBoundingBox();
if(blockBoundingBox.contains(entityBoundingBox)) {
entitiesFullyWithinBlock.add(e);
}
}
for(Entity e: entitiesFullyWithinBlock) {
if(e.getType().equals(EntityType.TEXT_DISPLAY)) {
return (TextDisplay) e;
}
}
return null;
}
because its in a PlayerInteractEvent handler
you can;t interact with a Display
player clicks a block and I check for a TextDisplay there
Ive updated now, still not working with the net.md_5.bungee.api.ChatMessageType class. Any other tips?
make sure you're on java 21 :3
how are you depending on spigot?
Dis why you attach an interaction entity to the display
inb4 bukkit as a transitive dep
I am, thanks :)
If you want interaction
then just put the UUID of the display in the Interaction entity pdc
1.8 🗿
Not sure i understand? - I am just using maven and then spigot-1.20.6
If it’s a passenger of the display you can just use getVehicle
much better idea
nothing seems out of the ordinary, what happens if you actually try to compile? mvn clean package
I'll try, thanks :)
The import still doesnt work - everything else work perfect. But the all the net.md_5 classes seems to not being initialized at all
are you running maven to build or somethign like artifacts or export?
Just maven as far as i know.
tell us what you do to build
correct
yes thx, but its the import itself thats wrong it cant even work in the code
what intellij version are you actually running? somewhere in Help -> About
using InteliJ?
IntelliJ IDEA 2024.1.5 (Community Edition)
Build #IC-241.18968.26, built on August 4, 2024
Runtime version: 17.0.11+1-b1207.30 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
ide.balloon.shadow.size=0
ide.new.editor.tabs.vertical.borders=true
ide.animate.toolwindows=true
ide.editor.tab.selection.animation=true
Non-Bundled Plugins:
com.chrisrm.idea.MaterialThemeUI (9.3.1)
Kotlin: 241.18968.26-IJ
reinstalled it as you said in the toolbox :P
so that's not the matter
you think its wierd?
oh
try refreshing maven in IJ
what is the jdk configured in intellij? project settings, jdk/sdk
ive tried multiple times unless you have another way of doing it instead of just pressing "refresh"
nope
SDK: 21 oracle OpenJDK version 21.0.4
do you really need to depend on spigot? and not just the API?
oh, didn't spot that one, also not using the specialsource plugin if that's the case
also, move teh spigot dependency up to the top so nothign else is getting priority
some plugins/libs accidentally include Bukkit dependencies
yeah you should also check your dependency tree, mvn tree:dependencies (i think?), see that nothing's adding bukkit
fwiw, you can invalidate caches and restart if you think it'd help, but doesn't sound likely in this case. But it doesnt hurt to try usually
what cool didnt know dependencies and so on had priorities
Thanks for advice ive cleaned so much you dont get it
ill look into that
Hey, I am trying to use this:
public static void spawnNpc(Player player, double x, double y, double z, float yaw, float pitch) {
CraftPlayer craftPlayer = (CraftPlayer) player;
MinecraftServer server = craftPlayer.getHandle().getServer();
ServerLevel level = craftPlayer.getHandle().serverLevel();
ServerPlayer npc = new ServerPlayer(server, level, new GameProfile(UUID.randomUUID(), "Test"), ClientInformation.createDefault());
npc.absMoveTo(x,y,z,yaw,pitch);
ServerEntity npcServerEntity = new ServerEntity(npc.serverLevel(), npc, 0, false, packet -> {
}, Set.of());
ServerGamePacketListenerImpl ps = craftPlayer.getHandle().connection;
ps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
ps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
}
for spawning a player like npc. But every time I execute it, i got this:
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.ServerGamePacketListenerImpl.latency()" because "player.connection" is null
does anyone knows a solution? MC Version 1.21
~ @uncut grove
did you remap?
yep
?paste your pom
Its not the priority thing, ive tried that
NPCs don't have a connection so you can't really send a packet to a npc
You did not remap
?nms
pretty sure they did remap not remapping ends up with a ClassDefNotFoundError
I don't think I've ever seen an NPE
look at their pom. no remap
lucky coincidence ig
https://paste.md-5.net/iqofigixuw.xml if this is right. Then the error is still there
how are you building 👇
your remap is wrong. you are depending on 1.21 but yoru remap is tryign to do 1.20.4 (in places)_
fixed, but still does not work
show the error and exact code pointing out the line of the error
https://paste.md-5.net/jofirejaho.java code + error at the bottom
I fkn hate spigot and its new 1.20.6 java 21
blame mojang
thats uncalled for
- Skill Issue
- Gets Angry
- Blames Third Party
what other alternatives
@shy zinc have you invalidated your IntelliJ caches sometimes it holds onto broken things
May i ask how, like just clear my cache?
File > Invalidate Caches > Click all of the checkboxes
Thanks mate :)
to not say anything at all
nope, best to hissy-fit and throw toys out the pram
tried to invalidate caches didnt work..
its so wierd, cause its only the net.md_5 classes everyting else in spigot works
did you build spigot using buildtools?
To download nms should i mark this option?
yes
Ok thanks
and to give multiple version compatibily should I put all the versions in the dependecies section in maven?
I've looking for some example, but didn't found anything
no you would have to do modules
But how do I get the imports?
thanks
man we need a github repo of this to just dump on ppl :,^)
or did alex put one?
?mvn-multiversion
perfect
I'd do ?modules
well I'd hope there been one for gradle
but else myea maybe modules would be more suitable
Hello, I'm new at creating plugins, I created the entire functions of commands, now I want to know how can I make autocompletion for subcommand, example: /example version
TabCompleter interface
do i need to create a list with all the subcommands right?
there's this utility method to complete a partial input token
how can I remove this?
how did you get a different result after using the same cmd?
i edited it :}
makes sense
yea lol
You're looking for ItemFlag#HIDE_ADDITIONAL_TOOLTIP
Hey, i'm trying to download nms and getting this error: java.lang.OutOfMemoryError: Java heap space
I'm giving 1g of ram, why could this happen
?
I assume it may be due to the lack of memory the JVM is given
1g probably isn't enough
But when i run it with 2g I can't even run it xd
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
how much ACTUAL memory does your system have?
bro is strapped for ram
32
how much is in use already?
and 65% free
🤨
11.5 in use
reboot
I'll do that later, thanks
Yes?
im not sure, but u might be able to circumvent this w 1g by using serial gc
mind u might
which specific md5 import is showing an error?
everyone of them, i cant even use the ChatColor.of() method for hex colors
its all md5 stuff
10/10 callout
Your pom says java 21 but your IDE says its using 17
🔥
🔥 🔥
Fabri... :)
:(
I was banned from forge IRC when I said I imagined Lex as having a huge bulging vein on his forehead.
declaration: package: net.minecraft.client.render, interface: VertexConsumerProvider
i neeeeeed
this
😭
Forgehead*
bad pun
I mean u got them, just under different names 
Ive changed to 21 now not a difference..
lf screenshots
huh?
That didn't work 😦
send screenshots
?img
