#help-development
1 messages ยท Page 501 of 1
odd whitespace
I'm not sure an IDE will ignore that blank line
I guess it might
add a sysout at the start of the run to see if your code is even being called
you can also use java if (helmet == null || chestplate == null || leggings == null || boots == null) continue;
instead of the first nesting
Songoda is going to get on my nerves, I cannot purchase any of their plugins due to a account on Paypal is required. I had a account but that got suspended due to my VPN. Just wanted fake players
add a continue; and you can remove the whole else { on the next line
k
i coded a plugin ages ago, and i dont remember the code, what was the event that stops moving of gravel and sand?
looks like this https://paste.md-5.net/cusuroyadi.java, lemme try ingame
can someone help quick
that is some cursed shit my guy
if (helmet == null || chestplate == null || leggings == null || boots == null) {
if (Nao.activeKits.containsKey(player.getName())){
Nao.activeKits.remove(player.getName());
}
continue; //Should be right here
}```
How do I make a NPC? Is it connected to NMS?
oh
you shoudl also auto format yrou code so it fixes your indents
i think its
sand falling
if eclipse CTRL+A then CTRL+SHIFT+F
No, im using IntelliJ
no clue on IJ
ctrl+f is search lol
CTRL+ALT+L is intelliJ
added
still doesnt work
I'd probably use a switch in yrou code instead of all the ifs
add sysout at teh start and make sure yoru code is being called
idk switch statements curse me
It is being called
one sec
This seems like something that should belong in a MutliWorld support channel, not this spigot development channel
Hello, how can I cancel a block sound ?
The only way I know of is to disable sending of the sound packets, something like ProtocolLib could do this easily.
okay thanks
there is any way to spawn a itemstack particle ? like carrot particle when you eat it
Google your question before asking it:
https://www.google.com/
But yeah you can spawn particles
I googled before asking and couldn't find an answer
i tried to provide item stack as particle type but nope
or
BlockLocation[0].getWorld().spawnParticle(((Particle) ItemModel), BlockLocation[0], 12);
declaration: package: org.bukkit, enum: Particle
Is possible to regenerate the gradle wrapper?
Do all your kits extend some base class?
I installed gradle but it isn't working it gives me this error Cause: org/gradle/api/plugins/MavenPlugin
paste the full stacktrace ๐
beyond that, are you talking about the wrapper or the cli
two different things
the wrapper can be generated from your cli using gradle wrapper
where as you'd call the wrapper with gradlew or ./gradlew
I have some question about deploying spigot plugins:
1. How to correctly organize github branches? master = newest mc version, and then branches for all the other versions?
2. How to get attention for a Plugin library for other devs?
3. Any additional information I need to know before publishing a plugin?
hi, does anyone know how to get the actual dimensions of a textDisplay (both getDisplayWidth/Height() and getWidth/Height() return 0)?
Also - not sure what unit getLineWidth() is given in (default is 200) - pixels, perhaps? If so, how can I get the pixel width of any given text?
How do I get blocks that can only be mined using a diamond pickaxe for a example?
- Depends on if you want a multiversion plugin or not. If you have one jar that supports multiple versions keep it all on one branch
- Good documentation

- Take time to write good documentation
ok thanks :D
you could have a single jar and you can still use multiple repos
not if you symlink the repos
git submodules 
I forgot you could do that
but I def need to have multiple jars if I use ProtocolLib? or does it automatically switch versions?
always glad to remind of the niche stuff 
Hi! I have plugin with some dependencies and I'm using shading for them. But with shading compilation time is much longer, is it possible to remove shading from first plugin, make second plugin, build it with shading and load into server, so it will be possible to access these dependencies in my first plugin?
If you're on a modern version (1.17.1+) and the libraries are on maven central you can use the libraries feature in the plugin.yml
beat me to it
anyways yes you can make a second jar containing your shaded and relocated dependencies
thank you
Hey there so I implemented the lombok project and its erroring
'dependencies.dependency.version' for org.projectlombok:lombok:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 101, column 22
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.projectlombok:lombok:jar -> version RELEASE vs 1.18.26 @ line 104, column 21
It is highly recommended to fix these problems because they threaten the stability of your build.
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
Specify a version
RELEASE is a placeholder they have for the actual version in the lombok docs
when I do that it errors too
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
or can I ignore that
malformed projects.
oh well thank you
oh lol, didnt saw that haha
anyone knows how to do this without scoreboards?
why not use scoreboards?
the heart thing
because I wanna show multiple lines, for example a bounty and the health
ah
perhaps this would be the solution for you
packets would be harder, armorstands would be wankier
but yeah please wait for a second opinion from somebody
maybe i'm overlooking something
ty anyways
anytime
Where can i find Spigot 1.19.2 source code?
https://hub.spigotmc.org/stash/projects/SPIGOT in here there's spigot but no source code
That is the source code
where
as i said in spigot folder
there's nothing
In the link you sent choose one of the projects to see the source code of
Spigot, Bukkit or Craftbukkit
yeah what do i choose
Depends on what you want to see
i have no idea
my current server has spigot-1.19.2.jar
i want a source code so i can change it
what do you want to change about it
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
You can skip the CLA since you're forking and not contributing
Hey um I am now getting this error
gencore-1.0-SNAPSHOT.jar, lombok-1.18.26.jar define 1 overlapping resource:
- META-INF/MANIFEST.MF
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
when trying to compile my jar file
Yep
Kit?
public abstract class Kit {
public abstract String getName();
public abstract Integer getWarmup();
public abstract Collection<PotionEffect> getEffects();
public abstract List<Material> getConsubmables();
public abstract Kits getKit();
public void addEffects(Player player) throws InterruptedException {
Collection<PotionEffect> active = player.getActivePotionEffects();
// remove effects
for (PotionEffect effect : active){
player.removePotionEffect(effect.getType());
}
Thread.sleep(getWarmup()*1000);
// add effects
player.addPotionEffects(getEffects());
}
}```
Thread.sleep(getWarmup()*1000);
what w that
wouldnt recommened that
Aint no way
?paste
This is doing it with a switch https://paste.md-5.net/anekomixib.java
I'd nto put the kits Sets in the runnable though
Much cleaner. To add new Kits you just create a new Set and add one line to your switch
generation
okay
yeah well, not in an IDE
Hello, can someone help me, I am writing a plugin to check for that night now or not, if yes, then check for randomness and if the chance is true to spawn mobs with the necessary parameters near the players, who can tell me how to do this and preferably in a separate java class, otherwise I was able to check for the night only in the main class.
World seWorld = Bukkit.getWorld("world");
BukkitScheduler scheduler = getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(this, new Runnable()
{
boolean day = false;
@Override
public void run()
{
if(seWorld.getTime() < 13000 && !day)
{
day = true;
}
else if (seWorld.getTime() >= 13000 && day)
{
day = false;
Bukkit.broadcastMessage("Night");
getServer().dispatchCommand(getServer().getConsoleSender(),"summon minecraft:allay -22 98 39");
}
}
}, 0L, 20L);
sec, it doesn;t return, its void
Thats a generics definition limiting what can be passed in teh arg
I do too, often ๐
Should enable polymorphism beyond type erasure
I look at it as another modifier like static or final, but I agree it shoudl really be after teh return type
Please help, I have 2 servers, on one of them bedwars and on the other a plugin that should show the available arenas from the second server in real time? How to implement it?
?pmc
Can anyone help me?
POM.XML: https://paste.md-5.net/guxopasobe.xml
TutNetHandler.class : https://paste.md-5.net/mogusisani.java
Screenshot of the error:
also, please don't clown on me. This isn't my code, as i am forking an existing project
what do i need to change?
the documentation on this plugin is non-existent
almost
what is your networkmanager?
I assume you are attempting to override the send method to prevent yoru server crashign with NPCs
yes
do you have a public class NetworkManager extends Connection
here are the errors
package de.firecreeper82.lotm.util;
import net.minecraft.network.Connection;
import net.minecraft.network.protocol.PacketFlow;
public class TutNetworkManager extends Connection {
public TutNetworkManager(PacketFlow enumprotocoldirection) {
super(enumprotocoldirection);
}
}
i have this
yes
then in your NPC class constructor shoudl be something like...```java
Npc(MinecraftServer minecraftServer, ServerLevel worldServer, GameProfile gameProfile, ProfilePublicKey publicKey) {
super(minecraftServer, worldServer, gameProfile, publicKey);
this.connection = new NetworkHandler(minecraftServer, new NetworkManager(PacketFlow.CLIENTBOUND), this);
}```
yes
public static ServerPlayer create(Location location, String name, String[] skin, boolean hideFromTab) {
UUID uuid = UUID.randomUUID();
MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
ServerLevel nmsWorld = ((CraftWorld) Objects.requireNonNull(location.getWorld())).getHandle();
GameProfile profile = new GameProfile(uuid, name);
NPC npc = new NPC(nmsServer, nmsWorld, profile);
npc.connection = new TutNetHandler(nmsServer, new TutNetworkManager(PacketFlow.CLIENTBOUND), npc);
setSkin(npc, skin);
setPosRot(npc, location);
npc.getBukkitEntity().setNoDamageTicks(0);
npc.getBukkitEntity().setHealth(1f);
Bukkit.getOnlinePlayers().forEach(player -> ((CraftPlayer) player).getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc)));
nmsWorld.addNewPlayer(npc);
Plugin.fakePlayers.put(uuid, npc);
NPC.showAll(npc, location, hideFromTab);
return npc;
}
this may be a little old 1.19.1 probably
i really should ask firecreeper82 to update the libs and the plugin
anyway
do you have any fixes?
it doesn't matter how it is done
1.19.2
um, same here
well your TutNetHandler is just fine. nothign wrong with it
increase teh version of yoru maven-compiler-plugin
3.8.1 is quite old
current is 3.11.0
mvn update
for IJ Idea there is a blue m button
with options
for eclipse right click on project -> maven -> update
other than that your pom looks ok
Is there a way to send messages to the plugin if there are no players on the server, and are there any alternatives?
sockets
or redis
or sql
Or any connection
will spring cloud work? it seems to me that sockets will be more difficult to learn?
sockets are really simple
If it can make a connection between two ips, it can be used
is there any api that supports 1.8.8 to do this?
Probably some of those hologram apis or nametag apis
update shade plugin to 3.4.1
is it also possible to move the player between servers without using plugin messages?
I mean the bungee api can do it so youโd just need to contact that.
once your pom is upto date, if the errors are not gone I'd do a clean run of buildtools --remapped
I have near identical code which was probably the base for that lib, and it runs fine
add a filter to yrou shade plugin
<filters>
<filter>
<artifact>com.lmax:disruptor</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>```
for whatever artifacts you are using
bruh
the owner of the plugin dmed
me
he ssaid
"im gonna look into citizens tomorrrow
...
malding
oh well
it's gonna be a time saver
thanks for trying to help me
where can i get spigot server 1.19.2 source code?
run buildtools.jarrr
buildtools work folder after runnign with --generate-sources
btw where do i add the filter?
in configuration section
oh alr thx
private static final String[] SERVER_ORDER = {"lobby1", "lobby2", "lobby3", "lobby4", "lobby5"};
`static void gotolobby(CommandSender sender) {
ProxiedPlayer p = (ProxiedPlayer) sender;
for (String serverId : SERVER_ORDER) {
ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(serverId);
if (serverInfo.getPlayers().size() < 20) {
try {
p.connect(serverInfo);
} catch (Exception all) {
p.sendMessage(new ComponentBuilder(ChatColor.RED + "This server is currently not active!").create());
}
break;
}
}
}`
BUNGEECOORD PLUGIN
The code above is just the example, I am not actually using this as a static BUT the question is if a server is full/down it doesn't get detected as a exception, how can I do this?
Does that detect if the server is full to?
no
So how can I do that?
?jd-bc
Oh server ping, ty!
Hello guys! For last 2 days, I am trying to find solution for replacing private method in net.minecraft.world.entity.raid.Raid by plugin. I need to alter spawning of enemies in raid. I was trying to do it by ByteBuddy, but without success...
Does anyone here have any experience with it? Or any other way how to do it differently?
The best solution would be to find a different way
If you really want to modify that method then you might want to look into creating a custom spigot.jar
So replacing private method is no-go? Public methods can be replaced? And what about completely replacing the class at runtime?
You shouldn't mess with bytecode dynamically. If you are able to inherit the original class, replace the method and replace the old references with the new one, then you might want to try that. But that should be done with caution as well
I mean, you may also try using ByteBuddy, but I promise that it won't take long for that to break. The deeper you go, the greater the chance that it will break (because i.a. of an update, other parts of NMS/other plugins expecting different behaviors ...)
Thats why I wanted to replace just the single method that is searching for spawn point
I basically want to have vanilla raid with custom spawning so I can create spawn points and make enemies spawn under roof of arena...
Sadly, if I create my own arena plugin with own villagers/enemies spawning, the AI is not the same.
Alternatively you could listen to the raid spawn event, remove them and respawn them at a different place. I have never done anything with raids, but that solution might do it as well
im trying to change the displayname of a player with a string taken from an arg of the command, but when i do it, it give me this error
[Async Chat Thread - #3/ERROR]: Chain link failed, continuing to next one java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:chat_type]: ResourceKey[minecraft:chat_type / minecraft:raw] at net.minecraft.core.IRegistry.e(SourceFile:88) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:59) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:49) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2119) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:2187) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at net.minecraft.server.network.PlayerConnection.lambda$17(PlayerConnection.java:1901) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?]
That would work if the bloody pillagers actually spawn ๐ They do not spawn and raid is cancelled because arena does not have valid spawn point, because it have roof
set the raid on the roof, then move them down as they spawn?
they spawn only on grass ๐
noooo ๐
Or teleport them after they spawned
I think this is not a proper way...
if it works
I have maybe another solution.... Can I create own Entities?
So what if I create CustomVindicator what extends Vindicator and I override the method that for example causes Vindicator to start opening doors to village huts?
Because original Vindicator opens doors only if its part of raid
And I cannot rly fake a raid without server cancelling it.
yeah a lot changed in 1.19
1.19 introduced Brainsright?
I've not messed with them. Others in here have though
Its kinda straight forward... I was looking into them for Villagers today...
You basically have Activities defined with priority and conditions when they should start
if Vindicators have the same thing I can maybe create fake raid with almost 100% same behavior as original one
But without same natural spawning I see... ๐ public static boolean isSpawnPositionOk(...) { /* compiled code */ } -_-
Thx btw... Will try to alter the Brains of the mobs first before experimenting more with byte buddy or custom spigot builds ๐
uh guys
so basically
i open buildtools
and
spigot folder appears
and there's no source code
only patches
i need to know
what's the right thing
bukkit or craftbukkit
for the spigot server source
did you run with --generate-sources ?
when you ran buildtools
its a jar file
?bt
if you just want version specific spigot/cb https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/branches
odd there is no 1.18 branch though
it doesnt extist
alr thx
im trying to change ore generator, but where is it located?
to change the way how the world generates
but i dont know where the files are
then all you ned to Generators and BlockPopulators
package org.bukkit.generator;
import java.util.Random;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.event.world.WorldInitEvent;
import org.jetbrains.annotations.NotNull;
/**
* A block populator is responsible for generating a small area of blocks.
* <p>
* For example, generating glowstone inside the nether or generating dungeons
* full of treasure
* <p>
* A BlockPopulator can be used in combination with a custom {@link ChunkGenerator}
* by returning it in the method {@link ChunkGenerator#getDefaultPopulators(World)}
* or by adding it manually to the worlds populator list returned by {@link World#getPopulators()}.
* <p>
* When adding a BlockPopulator manually to a world it is recommended to do so during
* the {@link WorldInitEvent}.
*/
public abstract class BlockPopulator {
/**
* Populates an area of blocks at or around the given chunk.
* <p>
* The chunks on each side of the specified chunk must already exist; that
* is, there must be one north, east, south and west of the specified
* chunk. The "corner" chunks may not exist, in which scenario the
* populator should record any changes required for those chunks and
* perform the changes when they are ready.
*
* @param world The world to generate in
* @param random The random generator to use
* @param source The chunk to generate for
* @deprecated Use {@link #populate(WorldInfo, Random, int, int, LimitedRegion)}
*/
@Deprecated
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk source) {
}
/**
* Populates an area of blocks at or around the given chunk.
* <p>
* Notes:
* <p>
* This method should <b>never</b> attempt to get the Chunk at the passed
* coordinates, as doing so may cause an infinite loop
* <p>
* This method should <b>never</b> modify a {@link LimitedRegion} at a later
* point of time.
* <p>
* This method <b>must</b> be completely thread safe and able to handle
* multiple concurrent callers.
* <p>
* No physics are applied, whether or not it is set to true in
* {@link org.bukkit.block.BlockState#update(boolean, boolean)}
* <p>
* <b>Only</b> use the {@link org.bukkit.block.BlockState} returned by
* {@link LimitedRegion},
* <b>never</b> use methods from a {@link World} to modify the chunk.
*
* @param worldInfo The world info of the world to generate in
* @param random The random generator to use
* @param chunkX The X-coordinate of the chunk
* @param chunkZ The Z-coordinate of the chunk
* @param limitedRegion The chunk region to populate
*/
public void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) {
}
}
the only thing i see
in spigot api
correct
also see org.bukkit.generator.ChunkGenerator
the java docs cover most of what you need to know
wait so
i just have to edit functions?
so if i have this public void setBlock(int x, int y, int z, @NotNull Material material);
yes, this is all in the API
not specifically that method
you want to alter ore generation
yeah
Alright thank you
i just expected that there will be the whole generation code with ores and other stuff so that i could just modify it
Hello, how can I replace a block breaking sound by another sound with ProtocolLib ?
Texturepacks would be the best bet.
it's a stone breaking sound
and it's only for 1 block (noteblock)
Sounds for breaking blocks are triggered by the client and not controllable form the server side
the client get the block from the server, right ?
of course you can play a sound during a block being broken but that would play on top of the breaking sound instead of overriding it.
Sure but the client knows when itโs breaking a block and then decided based on that for what sound to play
so, I can fake the client by sending it another block
You could try that, though then the block wouldnโt appear the way youโd want it to (?)
that's right

just send the block at the last second of breaking it
There may be a way to set its hardness as well though i donโt know it off the top of my head
for a sound ? ๐ค
yes pro move
And thatโll help how..? ๐คฃ
What if the sound needs to be played throughout the duration of the block breaking experience?
this isnt a specific code question but for those of you that have worked on larger plugins how did you go about planning them before hand?
I made this and it's working :java event.getPlayer().stopSound(Sound.BLOCK_WOOD_BREAK); event.getPlayer().playSound(block.getLocation(), Sound.BLOCK_STONE_BREAK, 1, 1);
ive been wokring on one for a while and realize that expanding it is extremely difficult because of my abilities at the start vs what i know now and want to start over and any advice is appreciated
Map it out, make each feature not need to be intertwined with everything else.
are there any tools yall use for mapping or just classic pen and paper
drawio
Is there an event for when a block is being broken ?
playerdamageevent or something like that
declaration: package: org.bukkit.event.block, class: BlockDamageEvent
not playerdamage ??
only when you start to damage
what are you trying to do with it
I only need to play a break sound from the start of the block break to the end
so I think it's perfect
you can get teh start with the interact you can get the end with the break event. you have no way of knowing if teh player stops in the middle
no problem ๐
I just thought what your problem may be. Check that lib doesn't shade any mojmapped classes by mistake
i was else-if to the if statement that checks if player has kit on
not the other kit
๐
hell nah
Hii, whats the best way to format the CHAT using Json, I have an idea about sending a broadcast message, not the message with the format, I was wondering if you have any other ideas on this :)
Thanks
what?
chat formatting using json?
Yeah, like to add hover or click and other stuff
The single way is to cancel the event and then send the message to all players?
hello, i am getting this error , i dont know why, i tried many things but it still doesnt work, am pretty sure its something that am missing but i cant find what it is, anyone please help. thanks alot
Caused by: java.lang.ExceptionInInitializerError
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.getItem(HotbarEditor.java:49) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.initializeItems(HotbarEditor.java:39) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.<init>(HotbarEditor.java:25) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarCommand.execute(HotbarCommand.java:20) ~[?:?]
at com.andrei1058.bedwars.commands.bedwars.MainCommand.execute(MainCommand.java:225) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-21fe707-741a1bd]
at com.andrei1058.bedwars.player.hotbar.ItemType.<init>(ItemType.java:83) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.ItemType.<clinit>(ItemType.java:11) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.getItem(HotbarEditor.java:49) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.initializeItems(HotbarEditor.java:39) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarEditor.<init>(HotbarEditor.java:25) ~[?:?]
at com.andrei1058.bedwars.player.hotbar.HotbarCommand.execute(HotbarCommand.java:20) ~[?:?]
at com.andrei1058.bedwars.commands.bedwars.MainCommand.execute(MainCommand.java:225) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-21fe707-741a1bd]
... 14 more```
?nocode
Itโs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
public static ItemType getItem(int slot) {
if (slot < 0 || slot >= ItemType.values().length) {
return ItemType.EMPTY;
}
return ItemType.values()[slot];
}```
i was about to paste my bad
need to see ItemType constructor
at com.andrei1058.bedwars.player.hotbar.ItemType.<init>(ItemType.java:83) ~[?:?]
it's an enum
private ItemType(String title, List<Material> items, ItemStack itemStack) {
this.items = items;
this.itemStack = itemStack;
this.title = title == null ? "" : title;
ItemMeta meta = this.itemStack.getItemMeta();
meta.setDisplayName(this.title);
this.itemStack.setItemMeta(meta);
}
elements are defined something like this :
UTILS(
"Utils",
new ArrayList<>(
Arrays.asList(
Material.WATER_BUCKET,
Material.LAVA_BUCKET,
Material.TNT,
Material.FIREBALL,
Material.FIREWORK_CHARGE,
Material.ENDER_PEARL,
Material.GOLDEN_APPLE
)
),
new ItemStack(Material.TNT)
)```
ItemType.java:83
line 83:
meta.setDisplayName(this.title);
one of those things is null
which things
okay i will try something to make sure it is not null (meta)
can i have some help about placeholder here ? or maybe do they have a dicord support ?
?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!
turns out this is the reason, i looked it up and Air does not have meta
thanks alot guys
Okayy so i have install advanced drop manager, and i would like to have expression that give me a randomnumber. So i found this:
https://api.extendedclip.com/expansions/randomnumber/
So i did
/papi ecloud download RandomNumber
/papi reload
But when i do /papi parse me %randomnumber_number% it's doen't work. I can't find the solution
how can i change that?
like the numbers
and the bars
Like when you hover the bars there's text
packets
how can I convert an euler angle to a joml quaternion
didn't md5 tell you that yesterday?
๐
thanks
getting a nosuchmethoderror for org.bukkit.util.Vector.toVector3f()
im on paper though so that might be why
?whereami
I'd guess that the api version within the project is newer than the softeare version that you are actually running
declaration: package: org.bukkit.event.server, class: ServerListPingEvent
dawg i am aware did you see the message I sent
it's too late, you already have been cancelled
And I'd guess that the amount of bars are very likely being calculated by the client
my bad
did you add the repositories?
Reload project?
shoulda cut the name yea opening up a resource to check how they impl something and immediately the class names ๐ญ
pos as in piece of shit or point of sale?
Position
In BungeeCord, I spotted that ServerInfo#ping sometimes no response even a throwable error. Is this really happen?
Is this really happen or because of my code?
did you try invalidating caches
File -> Invalidate caches (I think it's there)
basically intellij sometimes shits in your mouth and forgets stuff that's there
to reset its dementia invalidate caches
invalidate yeah
eh I normally check everything
np
๐
Can I set ping timeout in ServerInfo#ping in BungeeCord?
What are the reason to use module for multi-version ?
instead of just create multiple package for each nms-version?
It literally looks like a random b64 string lol
There are many way to encode data
for itemstack you can encode just name-lore-enchantments-type-id (lossy version - readable)
or base64 (no data loss-unreadable)
the lossy one use less memory^
In somecases base64 is not that needed
Yeah^
In terms of compiling it gives you more flexibility. For instance if you want a per version jar you could do that. Also it helps keep everything organized especially when testing and encountering problems you know if its coming from one of the version specific modules.
Does anyone know that?
Version mismatch? Make sure spigot in pom.xml is the same as the server?
Those methods don't exist on Spigot
Use Paper or whatever api you're coding against

Hello is it possible to create plugins with Python and if it is how can I learn how to create them I know everything I should k is about Python
no you cannot
but if you know everything about python then java shouldnt be a problem
Ok
How do people even think of coding plugins in python for a game in java?
I mean I had a conversation with someone and told me that itโs possible and I wanted to make it sure if I can also there are libraries that can make it possible like Jython but itโs not that easy and it has not the same compatibility
You can
Ye should be possible but highly discouraged iโd say unless you can find something that offers an api for spigot/nms in python which is natively implemented
time to learn java
Hi are there premade maps and if so where can I download or find them?
planetminecraft probably
Ah ok I thought there are already maps that you can use automatically if you have the plugin ok thx.
if i am creating a library plugin and need to depend on spigot (like nms and craftbukkit) how would you go about doing that
like not a library plugin, but a actual library, hosted on like say jitpack
?nms
And for dep, just dep on spigot normally and add provided scope
show pom.xml for it
plugins {
id 'java-library'
}
group = 'me.partlysunny'
version = '1.0-RELEASE'
repositories {
mavenCentral()
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
}
dependencies {
compileOnly 'org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
here is a gradle
like without buildtools being run it doesn't work
on jitpack
yea building nms reliant things on jitpack is not going to be fun
is there any alternative or way to do it
iirc there are some repos out there that just, disregard the legal consequences and still host the minecraft server
like even using a custom jenkins build or something
which you could use
like self hosting?
if you self host then yea, this would be easy
usually that is not an option for a lot of people that use jitpack tho 
you can use paperweight userdev in gradle, has the downside that you are exposed to paper internals which are not the same as spigot internals
and hence might break your plugin on spigot servers
paperweight only goes as far as 1.17.1 right
yea but i plan to have from 1.12.2

gl
๐
jitpack can use github workflows
you need to create one and use sprax devs spigot thing, can build spigot on a workflow
bro ty ive never heard of sprax before
is it legit tho cuz its not buildtools right
people use it all the time for github workflows and needing buildtools
all im guessing it does is run buildtools in the background
how can I get list of items? it gives me null
isnt it "variations-barrel." + type
well size probably works ig
- '\'' + index + '\'' ?
i finally actually made proper PRs for this lol @remote swallow
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/852/overview been a few months now since u sent that but... if ur still interested :P
more like 4, but whos counting :P
duplicating api 
no way
nice tho, grats on the first PR
yeah, will let me completely remove https://github.com/winnpixie/server-settings/blob/main/src/main/java/io/github/winnpixie/serversettings/listeners/impl/ConnectionListener.java from my plugin 
Hey guys. I'm creating a "custom entity" and want to keep track of all of them. This entity is just a stronger cave spider (potions) that has some particles around it. There is a chance that when a cave spider spawns it will be one of these stronger ones (using creature spawn event). My question is how should I handle the particles thing? Should I use a set to keep track of all the "custom" entities using their UUID and then inside a task I get the entity from it's UUID using Bukkit#getEntity() or would it be too laggy? Would it be a better option to use a HashMap<UUID, CaveSpider> or just a Set<CaveSpider>? Also, when one of those custom mobs despawn I need to remove it from the set/map, so I'm using the EntitiesUnloadEvent and EntitiesLoadEvent. Any tips on this?
Maybe I'm too worried about performance, idk

?paste
this is the listener class I've got so far: https://paste.md-5.net/bipibuqawe.java
You also need chunk unload and load too
Also hashmap would be better. Set if you need order
You dont really need a task. The listeners from the api should be enough
I need a task to spawn the particles around them. It'll be like a circle around them
You dont need a task to spawn them. Just a task to move them
The only performance impactful thing you have is just the particles
There is some libs that can help with that
I'd use WeakHashMap to avoid mem leaks (unless you use UUIDs exclusively). You still need to handle chunk loading though
Yeah could use a weakhashmap too but doubt it would make much a difference though. Custom entities dont disappear they just transform back to normal entities lol
Well my thought was what happens if the entity gets removed
I suppose it would be wise to use that in case some plugin interferes
Performance-wise it'd be worse though. Best if you were to extend the NMS cave spider
Though that has other issues
I mean, they just have some potion effects, some particles around them and drop a new item
They aren't that custom lol
Yeah dont need nms for that lol
Yes but you'd be able to deal with entity removal much better
Pretty sure killing entities via api is just fine lol
No, what happens if others do it (perhaps even through NMS due to "performance")
Just catch the exception for it
So you'd need to choose between hoping nothing goes wrong, WeakHashMap or NMS
the thing is that I'm trying to avoid using a sync task to do the particles thing and if I use a map or a set which identifies the entity by its UUID I'd have to use Bukkit#getEntity() which can't be called inside a async task, right?
Catch exception check if entity is alive still, if not update whatever needs updating and carry on
No. I'm purely talking about memory leaks
Unless you use lists at which point that approach makes sense
I could use the isValid() method before spawning/moving the particles
As long as the entity gets removed at some point from whatever is tracking it. It wont be a memory leak
Then use CHM
the day that intellij stops RESETTING MY INDENT CONFIGURATION is the day I can die in peace
for fuck's sake
it's not even a big hassle
but oh my god
Set the config file to read only

Are you running out of space?
Next would be to check hard drive with check disk to see if there is any issues with the filesystem or hard drive
Occasionally the filesystem file gets screwed up especially if its super fragmented all of the place
Check disk will fix it if that is the issue
Otherwise its purely IJ for whatever reason
I can do it, but it still doesn't work
You need to create a new itemstack
Using what you pulled from config
Cant just cast a list to a list and expect the objects to magically convert lol
Casting the list only changes the list object itself and not the contents of the list to give more info
on an ssd
Is your ssd running out of writes?
that's the only thing that happens though lol, once every 3-4 weeks maybe my indent configuration is reset back to 4 spaces
no other errors are there
how can I check?
Need to look at the smart info
Typically the ssd will tell you how much it has left. It should be some insane large number
???
Object will always be an instance of itemstack
And vice versa
And will this fix my problem?
that is 100% going to break
No? What if its list of locations lol
huh
nvm
The list is generic
cant you pass ItemStack.class to the getList param
forgot itemstacks are? (de-)serializable
How does that matter, if list contains location, object inside of it will never be instance of itemstack
Anyways regardless generics and casting are not even necessary here
is it that or is it with a Bukkit InputStream
i dont remember
Because its generic the content doesnt have a specific type to begin with. Its not like yaml knows what it pulled is a location or not
So casting isnt going to help nor checking a type against a generic
What needs to be done is to iterate through the list and create new itemstack objects
can you iterate through every element in the list and see if it's an itemstack with isItemStack?
So that the server is aware of the itemstack objects
oh you sniped me
Even if you serialize objects when you deserializs you still need to create a new object there is no getting around that
if the ItemStack.serialize() method is used to save it to the yml file it should be able to deserialize into an ItemStack object immediately
so what should i do? it doesn't work)
The only difference with serialization is you can plug the data directly into the new object
You still have to create a new object. Objects just dont appear on the stack magically
the deserialize is only on craft stack iirc and its package private
A perfect example is blockstate data. You still have to create a block before you cab plug the data in directly.
programmatically you can get the ItemStack object with that deserialize method, ingame you still have to spawn it, thats what you mean?
No
Objects in the jvm dont appear just because you cast
The only way an object can appear in the jvm is for it to be created using the new keyword there is no other way without going through and using the unsafe package of course
we talking about the deserialize method?
So serialization saves the state of an object
Deserialization can if the method implements it create the objects for you
But it depends on that method
that still doesn't cover the statement that object is always instanceof itemstack
Otherwise deserialization just turns it from binary data to non-binary data that is more organized
unless the entry is manually changed
Obiect is generic. Since itemstack extends from object, itemstacks are always an instance of object
yes, itemstack is always instanceof object
but not vice versa
as any instance in java instanceof object == true
which is why casting is necessary
?
instanceof + cast in order to use the methods which can be used on the object
that is what i said, im arguing about frostalf statement
Object will always be an instance of itemstack
I'm talking about this.
Right your correct, but they way they are doing it isnt going to work unless they create some new objects. Casting doesnt make new objects automatically lol
casting doesnt change the list object, it just increases the amount of information you have at non-runtime
And casting a list doesnt change the contents of the list either
if the list contains nothing but serialized (using ConfigurationSerializable) Itemstacks this will work
of course, gotta make sure its a pure list of Itemstacks or there may be errors
Well need to deserialize and as long as the deserialization method creates the objects for you then yes will work
ah I see. I'm pretty sure Spigot will create those objects itself
Either that or I just did that accidentally
Serializing just saves the state of an object and its type. It isnt an object itself. So you need method that creates a new object and then you plug that object state in as the content of the object which includes type and you have your object you saved
I must have just used deserialize methods everywhere then
Lol
Just didnt actually realize those methods were taking care of the dirty work for you
And that is how apis should be
yeah, Ive made like 50 ConfigurationSerializable classes in my new project XD
Well at least you learned something that serializing doesnt mean the object itself is saved just its state.
So you have a better understanding of something now
๐ซก
java: package net.minecraft.server.v1_8_R3 does not exist is an error i get when compiling a plugin addon, how can i make it still work?
ive used buildtools to try and fix it (other's help) but it did not change anything
How did you import Spigot then?
How are you compiling it
Gradle ๐ซก
oh so sorry i didnt see the build.gradle
theres many versions
i pasted in the last version
1_19_R1
The code is written for 1.8 you can't depend on 1.19 and expect it to work
on the spigot page it sais 1.13 is native version
but it also sais tested for 1.19
The error you sent is caused by it trying to compile against 1.8.8
but you're probably not depending on it so it's failing
i dont understand, sorry
It might be worth hiring someone to compile that for you
since you don't appear to know Java
nor any dependency management in Gradle
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
alright
That's untrue as per newer minecraft versions: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#addPotionEffect(org.bukkit.potion.PotionEffect)
declaration: package: org.bukkit.entity, interface: LivingEntity
Anyone messed with NPCs? Trying to find a way to get one on my server
citizens
Money required, paypal account suspended. Not possible
Citizens is available for free ^^
hi , did anyone use KitClaimEvent event?
using EssentialsApi , ?
List<String> items = event.getKit().getItems();
string of items?
i want to get the item itself xd?
What does the string contain when you print it?
i didn't test xd
Didnt ask whether you have tested it or not
check src to see how essentials gives players the kit
it have a event called KitClaimEvent
You have to use this i assume
declaration: package: com.earth2me.essentials.items, class: CustomItemResolver
yeah, you have the kit you just need to see how to use it
Or this
declaration: package: net.ess3.api, interface: IItemDb, interface: ItemResolver
top 10 goofiest anime characters

does any event fire for the knockback player will get ?
No
Just the damage event but I don't think the amount of knockback received is exposed
Probably not set yet
i guess i can calculate it myself, how does mc calculate it
Hello Guys!
I've question, i wanna send a Bukkit Broadcast message when obsidian is generated by lava + water. Any help is much wanted (1.8.8 Spigot)
Thanks
Tried the BlockFromToEvent, BlockPhysicsEvent.
Have you tried BlockFormEvent
Yea, but I could just tried it wrong. Let me try again
Obsidian isn't getting caught ig, always only liquids
bruh
i could decompile
but i did something wrong ig
ye
but still wont work
what would be a good naming in this situation? i've got an interface in my API that's called registry and i want to create an implementation of it in my project. should I go with (IRegistry; Registry) or (Registry; RegistryImpl) or something else?
Works now! I was stupid and used getBlock instead of newState
hm, i'll go with (IRegistry; Registry) because it's more clear as to what's an interface and what isn't. thanks Olivo!
Use addPasenger
any idea why i keep getting this?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.0:jar (attach-javadocs) on project UnderscoreEnchantsAPI: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - G:\PROJ PLUGINS\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:3: error: package org.bukkit does not exist
[ERROR] import org.bukkit.NamespacedKey;
[ERROR] ^
[ERROR] G:\PROJ PLUGINS\premium\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:4: error: package org.bukkit.entity does not exist
[ERROR] import org.bukkit.entity.Entity;
[ERROR] ^
[ERROR] G:\PROJ PLUGINS\premium\UnderscoreEnchantsAPI\src\main\java\com\roughlyunderscore\enchantsapi\events\EnchantmentActivateEvent.java:5: error: package org.bukkit.entity does not exist
[ERROR] import org.bukkit.entity.Player;
[ERROR] ^
(this goes on forever)
pom (relevant):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<links>
<link>https://hub.spigotmc.org/javadocs/bukkit/</link>
<link>https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/</link>
</links>
</configuration>
</plugin>
jdk 16 corretto
i'm back just to post this i do not need help I'm perfectly sane
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (sender.hasPermission("eagle.multisummon")) {
if (args.length >= 2) {
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
p.getWorld().spawnEntity(p.getLocation(), entity);
}
p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
} catch (IllegalArgumentException e) {
p.sendMessage(colorize("&4This is not an entity."));
}
} else {
p.sendMessage(colorize("&e/multisummon [mob] [amount]."));
}
} else {
p.sendMessage(colorize("&4You don't have permission to do this."));
}
} else {
sender.sendMessage(colorize("&4You cannot do this. "));
}
return true;
}```
Please
please what?
seeing that code rememinds me why i blocked you
when did you unblock me
i didnt
epic, any ideas?
i just posted that as a reminder I have fixed the code
i just saw the "1 blocked message" so just check to see what it is
and you keep clicking it
damn
if (!player.hasPermission("server.summon")) {
player.sendMessage("You do not have permission to use this command.");
return true;
}
if (args.length < 2) {
player.sendMessage("Usage: /summon <entityType> <amount>");
return true;
}
int amount;
try {
amount = Integer.parseInt(args[1]);
} catch (NumberFormatException e) {
player.sendMessage("Invalid amount. Please enter a valid number.");
return true;
}
EntityType entityType = EntityType.valueOf(args[0].toUpperCase());
Location location = player.getLocation();
for (int i = 0; i < amount; i++) {
Objects.requireNonNull(location.getWorld()).spawnEntity(location, entityType);
}
player.sendMessage(colorize("&aSpawned &e" + amount + " &a" + entityType + (amount > 1 ? "s" : "") + "."));```
does ths help your eyes
i think i copied this from jefflib lmao
but i will check
ty
partially
yes
oh my god this javadoc shit just does not work
when you make it a material again use Material.getMaterial(String.toUpperCase())
why would you use that to get a material
string is just meaning whatever you have
copy a bit of it and give it ot chat pgt
ah
perhaps..
that's a bit too harsh
@tender shard may stand the chance to know
it makes stuff for me
i like it
true
yeah perhaps
it needs work butit does what i need
though i remember asking the same question like a year ago
and you know what helped
going from java 16 to java 8
stackoverflow
now i need java 16
but even downgrading does not help[
i'll just log off for the night
maybe alex will awaketh and help
i use chatsonic ๐
use catgpt
it's shit too
i think i need rubber duck gpt
i start explaining and it fixes itself even though i didn't even send my question yet
... light mode in chatgpt?
what do you ask it
because it seems to be able to code fine for me
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleSneakEvent;
public class CrouchExplosionListener implements Listener {
@EventHandler
public void onPlayerCrouch(PlayerToggleSneakEvent event) {
Player player = event.getPlayer();
if (player.isSneaking()) {
World world = player.getWorld();
Location location = player.getLocation();
world.createExplosion(location, 3f, false);
}
}
}
``` sample it created
?jd-s
What is going on here
you can't tell?
public void onPlayerCrouch
world.createExplosion(location, 3f, false);
hello, would it be a good idea to create a rest api and communicate with it instead of sql queries for database ?
for a bedwars plugin
is that simple enough for you
chatgpt*
bro what is there not to understand
Do you have issue with code i am asking this
maybe this can help
Hi in todays video I tell you how to make a Minecraft plugin with spigot and bukkit by using event listeners
IntelliJ - https://www.jetbrains.com/idea/download/#section=windows
Paper Server - https://www.youtube.com/watch?v=zDPzQxXB9Ks&ab_channel=TheBreakdown
what is that even suppose to mean
chatsonic
Ah god i dont get what is going on here
then why are you here
I saw you texted a code and i thought you have issue about code
Hello, tell me, how to spawn several mobs near the player?
randomly around them?
Thanks
is english your first language
yes
No
Do it with random object and iterate through blocks near of player
use ThreadLocalRandom.current() and pick adding or taking from their location then summon a mob there
this is suppose to be a reply to the guy who said chatgpt doesn't code for him so I said it works fine
hence message at the bottom where it says "sample it created"
Thanks
Unfortunately, I have not worked with mob spawn yet, can you throw off an example code?
does anybody know if the method Bukkit#getEntity() could cause lag if I used it inside a task every 5 ticks?
iirc theres a summonEntity or spawnEntity on world you just have to pass a location and the mob type
sorry, I'll actually call it for every element in a set
yea, I guess it may be laggy if there's a lot of entities xd
explain what you are doing, there may be a better way
I have a set of UUIDs and inside a task I'll have a loop which will take every entity from this set using Bukkit.getEntity() and then spawn some particles around then
I want a 5 letter word thats longer than 10... see if it replies fifty
how many entities are we talking?
Would it be better to directly store each entity inside the set instead of its uuid and then check if it is still valid?
no limit
no advantage to storing the entity over gettign it from Bukkit
I could use a async task
if I use Bukkit to get the entity I'm forced to use a sync task right?
I'd have no issue coding 50 entities every tick to spawn particles around them. Unless your server is a potato.
yes
particles can be spawned async though
they are just packets
@Override
public void run() {
final List<UUID> toRemove = new ArrayList<>();
for (UUID uuid: CoolantRaknoidsManager.RAKNOIDS_UUIDS) {
Entity entity = Bukkit.getEntity(uuid);
if (entity == null || !entity.isValid()) {
toRemove.add(uuid);
continue;
}
// Spawn particles
}
toRemove.forEach(CoolantRaknoidsManager.RAKNOIDS_UUIDS::remove);
}
atm I have smt like that
maybe I'm too worried about performance, I'll just keep it as is
thanks ๐
mans copying warframe's exploiter orb
Hello. Why don't my NBT tags get removed from the item?
My code to remove the tags:
public ItemStack fixSign(ItemStack itemStack) {
if(!itemStack.getType().toString().contains("SIGN")) return itemStack;
net.minecraft.server.v1_12_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
NBTTagCompound tag = nmsItem.getTag();
if (tag == null) return itemStack;
NBTTagCompound blockEntityTag = tag.getCompound("BlockEntityTag");
if (blockEntityTag == null) return itemStack;
System.out.println("Before removal: " + blockEntityTag);
blockEntityTag.remove("Text1");
blockEntityTag.remove("Text2");
blockEntityTag.remove("Text3");
blockEntityTag.remove("Text4");
System.out.println("After removal: " + blockEntityTag);
tag.set("BlockEntityTag", blockEntityTag);
nmsItem.setTag(tag);
return CraftItemStack.asBukkitCopy(nmsItem);
}
And then I just set the item:
if(event.getHand() == EquipmentSlot.HAND) player.getInventory().setItemInMainHand(nbtManager.fixSign(itemStack));
else player.getInventory().setItemInOffHand(nbtManager.fixSign(itemStack));
the respective output in the console:
[20:42:13 INFO]: Before removal: {Text4:"{\"text\":\"\"}",Text3:"{\"text\":\"\"}",Text2:"{\"text\":\"\"}",Text1:"{\"text\":\"\"}"}
[20:42:13 INFO]: After removal: {}
Also I printed the tag to the console: tag: {BlockEntityTag:{},display:{Name:"ะัะฐั ัะฐะฑะปะธัะบะฐ"}}
why it doesn`t have CustomModelData
does your texture pack have the custom model data for that item? nothing is visual without it
yes it has
looool
yeah I'm creating a plugin inspired on warframe
oh sorry, i didn`t reload it
Is it possible to update only a block texture without actually changing the block itself? The sort of change that reverts when the targeted block is updated
Player#sendBlockChange
is there a method which returns amount of specific Itemstack in Ineventory
count
is it possible to apply the shift effect seen in the player's name in an armor stand?
Changing the NBT data
hello, i am getting the following error when trying to compile using intellijidea
Index 6 out of bounds for length 0
there's no error in console and no error marked by the ide
all am getting is this
its a shade error so has to be something to do with your pom
even if i havent changed it ? because this is not the first build i do with the same file
then clear caches
how much far we can go with Gson ? we can save any type of object ? bc when i try to save something simple like a string or int it work properly but when i save something like player location or an item it just dosent work
how about somthing like a item or location ?
yes
Can someone help me set up a minecraft server with plugins?
lol BaseComponent's bukkit API is so buggy
public static void sendActionBar(Player player, String text) {
if (!Main.getInstance().getConfig().getBoolean("spigot")) {
CraftPlayer p = (CraftPlayer)player;
PacketPlayOutTitle sendactionbar = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR,
(IChatBaseComponent)IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + text + "\"}"));
(p.getHandle()).playerConnection.sendPacket((Packet)sendactionbar);
} else {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR,
(BaseComponent)new TextComponent(text));
}
}```
found out my old code
if (spigot) {}
else {}
basically just had a boolean so admins could define if they are on bukkit or on spigot
my good lord
How so?
bestest name eva
elgarl u made group manager right
originally no. 90% of ity is mine now though (past 10 years)
how does it feel tobe mentioned in essx faq
Am I? don;t care
Yeah, prissy new devs have no clue ๐
Looked at their essx code? I don;t go posting how bad it is on my faq
If I had a faq ๐
its awful
api docs are non existent and everything is interfaces
just building it is cancer
I should team up with smile and alex and write our own, with blackjack and hookers
I can describe few issues with my long time use experience:
ComponentSerializer#toString is broken, works, but not as expected (as example: BaseComponents arrays)
TextComponent#fromLegacyText has some issues, i don't trust on it
TextComponent#String constructor should work different, something like the TextComponent#fromLegacyText, but no
Thats three things i can list now, i've experienced some others issues before... The unique thing i really trust on the bukkit's component api is the ComponentSerializer#parse, on my oppinion the api should be completely refactored
I can provide steps to reproduce the issues if you want
if you have bugs you can submit them
Where?
?jira
if they are just, I'd do it differently, you'll get nowhere
isnt it bungee so github?
ah
need some help, pls, guys: #1103744316645589172
Your code looked fine to me. Your debugs gave the expected results. Are you sure you are testing the new modified ItemStack?
wdym?
Your method returns a NEW ItemStack, so not the one you pass in
as I understand, my method returns the modified NMSItem as an ItemStack
yes but a new one, not the original
yeah, but then I set this new ItemStack to the player's inventory
test teh ItemStack after you applied the removed NBT
check the topic again, I provided the code
after you applied, before you put int eh inventory
hi, im trying to get the amount of the item in InventoryMoveItemEvent but it always returns the event.getItem().getAmount() as 1
ok, lemme check it real quick