#help-development
1 messages · Page 845 of 1
need help on a dumb thing
<repository>
<id>papermc-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
but
Could not find artifact org.bukkit:bukkit:pom:1.20.4-R0.1-SNAPSHOT in papermc-repo (https://papermc.io/repo/repository/maven-public/)
how?
this ?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
by adding another repo tag?
not sure why you think you can only have one repository
but you can add as many repositories to the pom for maven to check that you want
also not sure if spigot or paper will have the bukkit api hosted itself
since bukkit is pretty much dead and the only reason it is kept around is for legacy reasons
this is why i want to use it
but, you can use buildtools to obtain the bukkit api though
are you sure?
I know spigot api is
I remember using it when I started
org.bukkit:bukkit-api:1.8.8-R0.1-SNAPSHOT
sum nlike this
goes all the way up to 1.15.2
i'm in 1.20.4
then use spigot
anyways, regardless they learned about specifying more then one repo XD
org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT
someone has used Lamp command?
spigot works but not bukkit
spigot-api bundles bukkit
yup but i want to use bukkit.craftbukkit and it is not provided
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
this precisely
not even the right version xDD
so you import spigot instead of spigot-api
mapped
And you need to run buildtools for that
I suck with dependency
given you're running maven I'd run the remapped flag
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is obviously written for 1.18.2. If you use another version, you of course have to replace every occurance of “1.18.2” with the version you actually use. What...
thx i worked things out
how do i fix those two?
and how do i fix that?
?nms
already got the build
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>```
fucked up the version
Hmm I decided to work again on my skyblock shenanigans
Might copy the minestom itemstack system
I'm thinking, for the ItemMeta system, should I make some sort of MetaValue system where I can have like
default void setCustomName(String name) {
setValue(MetaValue.CUSTOM_NAME, name)
}

Now I want to avoid a Map<MetaValue, Object> but I might need to do it
Yeah doesn’t sponge also have an object mapping approach, just like how minestom is object mapping it.
Thinking this
I might put the metavalues in the interface
Maybe
So that leather color would belong to the leathermeta interface instead of allowing any value to be set
Could not find artifact org.spigotmc:spigot-api:jar :remapped-mojang:1.20.4-R0.1-SNAPSHOT in papermc-repo (https://papermc.io/repo/repository/maven-public/)
wanna cry
did you run buildtools yet
did you run it with the remap tag
java -jar BuildTools.jar --rev 1.18.2 --remapped
this
java -jar BuildTools.jar --rev 1.20.4 --remapped ||in the right version||
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Nice except shouldn’t it be Integer since custom model data can be null, just a lil nitpick but else nice
I guess?
no, if its null then it will return 0
primitives can't be null
I think its better that it returns 0 instead of null
There you go
you really wanna represent its absence and the fact that it can be zero as two separate cases
nice compromise lol
but yeah since you changed it to Integer that would be correct
my old approach was to store every single field so eh
I'd rather just write it in a future-proof way
this has been stagnating my project for way too long
time to do it all over again with guis
did not get anything from that TBH i may have not searched enough but IDK
this would've been so much easier if I just compromised and locked into spigot
oh well
that one minestom user will appreciate
lol
there is a couple of posts
the first post leads you to the second in how to setup your pom
and obtain the remapped stuff
I guess the cool thing of this item builder is that I can make it immutable by just making the setValue method return a new copy
or somn
Could not find artifact org.spigotmc:spigot-api:jar:remapped-mojang:1.20.4-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
for this part:
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>papermc-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
what's wrong?
Send the dependencies too
here
Remove -api from spigot
Hi, does anyone know how to cancel a schedule sync repeating task (sorry for the dumb question, this.cancel() was not working btw)
thx again olivo
still having problems
BUT a lot of them are resolved so i'm happy actually
hi. I'm facing weird issue while making 2fa sensitive commands system.
When executing p.chat(command); or p.performCommand(command); and using /op player as command, player p receives No permission error, though this player have those permissions
Is there any other way I can sudo player?
.cancel() does work. Remember that it doesn't have the same effect like a return;, meaning that it continues to go through the remaining code for the one tick
didn't work for me, let me try it again
You could either use Player#setOp or Bukkit.getConsoleSender().performCommand("op abc")
could it be a probem with putting .cancel in if statements? @warm mica
No, that doesn't matter. Can you send a screenshot where you have that built in
it's just an example with /op command. I'm making system that sensitive commands should be approved on discord before executing from admins. Other commands, like /lp works without any problems, but when trying to use vanilla commands, like /op or /whitelist it just gives player "no permission" message
the real question is how did i manage to get minecraft and all the folders but not the actuals class
I sent it
ew wtf
When I put this.cancel at the start of the function it worked but once i moved it into the if statement it stopped working
And yes, i have checked that the if statement I actually runs.
public static void setBlockInNativeDataPalette(World world, int x, int y, int z, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));
ChunkSection cs = nmsChunk.getSections()[y >> 4];
if (cs == nmsChunk.a()) {
cs = new ChunkSection(y >> 4 << 4);
nmsChunk.getSections()[y >> 4] = cs;
}
if (applyPhysics)
cs.getBlocks().setBlock(x & 15, y & 15, z & 15, ibd);
else
cs.getBlocks().b(x & 15, y & 15, z & 15, ibd);
}```
can someone teach me or tell me how to convert this to 1.20 mappings
Gotta get that few microseconds
Don’t use both paper and spigot
k
added this error:
Could not find artifact com.mojang:brigadier:pom:1.0.18 in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
and look like this
Hey. guys how do i make a whitelist for a plugin.
?
wdym?
It looks fine. What do you see in your console? 5 4 3 2 1 5 4 3 2 1?
you're using obfuscated mappings
?nms
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
?switchmappings
idk, kinda took it from internet but the import are doing shity stuff
read this
you're using the wrong class names
you're using the obfuscated class names although you're on mojang maps
World e.g. is called Level in mojang maps
My SMP server has a data pack (terralith) and I’m looking to add seasons to the server. The problem is, I need to get every custom biome. Should I iterate through an array of terralith biome names, and get the registry for each?
the last blog post explains how you find out the correct names
k tysm
It’ll show you the names of the remappings
Level = World, LevelChunk = Chunk, etc
yup but i don't find my imports ||at this point i have a skill issue||
have you read this?
yup
then I don't see the issue
pls fully read the blog post
also important to remember you need to be on the correct version to
i thought that i was swiching from mojang to Spigot ;-;
well anyways got it
thx everyone
just realised that i need to translate all my code ;-;
quite ez in fact
just some stuff that i can't translate ez
yeah in that case
you gotta grab the mappings in the old version
and read what's there
and do stuff
did something else : look at the functions, looked at their return then chose by that
java is great sometime
I'd go by their names
You have a mappings viewer
@ivory sleet Any way I can hide get/setValue without making an abstract class?
hi guys, im asking this so i can figure it out. how can i make a whitelist feature to a plugin making it so people can't use it without a code.
reason why is im putting it on a minehut server with other people having access to the console
?
You join, run a command n then you get access
looked it up
is it good to work with 1.20?
Try it
let me see
nvm foudn the newest versions
how do i put it in my plugin
the method names are also shown in the mappings
for example TileEntityCommand.c() = CommandBlockEntity.getCommandBlock()
converters for what?
idk how to set it up
bukkit <-> my own item meta
who using Eclipse?
Why
Guys. is there a way to whitelist a plugin without authme?
basically restrict access to it with a code
i want to setup the project in eclipse
How can i get the UUID of a offline player by his username?
Bukkit.getOfflinePlayer(name).getUniqueId()
Keep in mind this can be a blocking method
How do I create a bukkit item meta based on its type 
I don't think Bukkit has an ItemMeta implementation
yeah I'm figuring I don't need it for now
idk I'm happy with this system but it has no point of entry
it'd require me to create some sort of singleton
There's no MinecraftItemstack.create("minecraft:stone") type deal
no way y2k awake after midnight
mostly because meta would be fuggly
Could use ItemFactory.createItemStack
yuh but that needs a singleton or sumn
I still need to access my platform adapters
Might need to do something similar to LuckPermsProvider
grr I hate singletons but I guessi t's for API purposes only
mm I hate this
We have progress
this is also viable
I should rename MinecraftMaterial to MinecraftItem and vice versa
yo @river oracle got a sample inventory API I can look into?
Gotta make uh
the whole thing
Thinking of this
I could delegate the slot stuff to a ContainerMetadata thing and just associate it with the menu type
Nah not on hand in bed atm
Generally though avoid how bukkit does it is my advice
I remember there was some weird generics magic going on
Sync your stuff with the MenuType registry
And use Menu's
They require a player instance but work much more nicely than whatever cluster fuck bukkit does underneath
I'll want you to go over this tomr
Alr ping me when your around I'll need like 10 hours tho xD gotta get my beauty rest
basically containers and inventory views are segmented
inventory views hold the title and the top/bottom containers
As well as the player n stuff
I'll give my reccomendations tomorrow for now I'll be off for the night though
Might dm you something when I wake up in the morning
no
because that doesn't even make any sense
also you've been keeping to ask this question several times now and nobody understands what you're even trying to do
so step one is that you try to figure out what you even wanna do yourself
enforce_secure_profile: false
listeners:
- query_port: 25565
motd: '&1Another Bungee server'
tab_list: GLOBAL_PING
query_enabled: false
proxy_protocol: false
forced_hosts: {}
ping_passthrough: false
priorities:
- auth
bind_local_address: true
host: 0.0.0.0:25565
max_players: 10000
tab_size: 60
force_default_server: true
remote_ping_cache: -1
network_compression_threshold: 256
permissions: {}
log_pings: false
connection_throttle_limit: 3
server_connect_timeout: 5000
timeout: 30000
player_limit: -1
prevent_proxy_connections: false
ip_forward: true
groups: {}
remote_ping_timeout: 5000
connection_throttle: 4000
log_commands: true
stats: a1c55607-d707-4956-88ff-1df70b3cfd36
online_mode: false
forge_support: false
disabled_commands:
- disabledcommandhere
servers:
skyblock:
motd: '&1Just another BungeeCord - Forced Host'
address: 0.0.0.0:25501
restricted: true
auth:
motd: '&1Just another BungeeCord - Forced Host'
address: 0.0.0.0:25511
restricted: true
lobby1:
motd: bruh
address: 78.38.186.117:25511
restricted: true
smp_1:
motd: bruh
address: 0.0.0.0:25101
restricted: true
smp_2:
motd: bruh
address: 0.0.0.0:25102
restricted: true
smp_3:
motd: bruh
address: 0.0.0.0:25103
restricted: true
does anyone know what is the problem? when i do a bungee command it recommends the commands and then the player names but when i execute a command in the servers it just gives player names untill i type something
will switching to waterfall help
bcz im using paper on the backend servers
adding waterfall didnt help
imma move to papermc help
ok so you know how some plugins (ex: axiom) has this paywall feature. were they allow some code or uuid to be used. where once you pay they allow it. i just want it so i can use it to prevent some guys with console (i'm doing this as im a dev on a server) so i can keep the plugins private without giving everybody with console the plugin.
if it makes you understand what im trying to do. then great.
if not sorry, im not the best at explaining at what im trying to do
public String onPlaceholderRequest(Player player, String identifier) {
if(identifier.equalsIgnoreCase("coins")) {
return null;
}
if(player == null){
return "";
}
return null;
}
}
can someone help me about that
how can i add a placeholder from my plugin
Did I understand correctly?
How can I send actionbar to player?
player.sendTitle("title", "actionbar", time, time, time); but its deprecated
ok I found it player.spigot().sendMessage(ChatMessageType.ACTION_BAR, *coponent*);
how do i reschedule a BukkitRunnable
how get structure chest in generation process. What the event need?
Make a new instance
yo so sometimes the join message that shows on PlayerJoinEvent doesnt show, but it shows to some players. My guess is the message fires before the player can properly join, anyone else heard of this?
i wanna make skyblock system
but someone give me idea for how works this system
i mean how do i store player islands ?
so you mean DRM / licensing for a plugin?
okok thanks
Yeah looks like a DRM
no just make it so you can't use the plugin without a code or your uuid added to a list
idk
im not the best with java and plugins right now
Yeah that's DRM
what does that mean
If you can't trust the people you're working with maybe find some other place
i trust them. just i don't know what they plan to do afterwards.
do those admins have access to the console?
entire server
Just tell them not to reuse the plugin
lool
If you trust them that should be the end of it
alr
what about the hired ones?
like those admin
If you cannot trust the people you give access to the server then you have some real problems
Tell them they‘ll get cute anime girls if they dont steal it
lol
no im a dev there
not the owner
Do NOT trust random people with user and system data
Well, in that case, hiring those admins is not an option
If you really want the DRM thing then just make the plugin send some data to a server (not Minecraft) you own
here the question is about quality: you can take high-quality hired ones but have the risk of being deceived or acquaintances but the quality may drop
Keep in mind that it's not hard to remove
It is lol
i was use it for test plugins
Compiled code is a mess
Not really
Decompiled kotlin definitely is a mess
purpose?
and ACF
what
what what
where are these links
ok time to go internet hunting
what event i can use for get chest for generated
structure
LootGenerateEvent gets called when the chest gets "populated", i.e. first opened
Player or anything interacting with it
oh
So the first time you open a chest for example
buried chests etc are empty until they're first opened
bruh i not can get structure from this event
Yeah
LootGenerateEvent
I wanted to get the structure and its chest when generating
for check and get the desired structure
and add item in chest
but i gess this impossible?
why do you need the structure?
why don't you just check the LootTable
you get the connection by calling getConnection() on the mysql driver object
What are you using for sql
Use this event: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/world/AsyncStructureGenerateEvent.html
declaration: package: org.bukkit.event.world, class: AsyncStructureGenerateEvent
generation depends on the structure. Village, pyramid, etc.
and why can't you just check the LootTable to identify which structure it is
link content and structure?
just get the loottable's namespacedkey and check if it's e.g. chests/jungle_temple or chests/village/...
via wiki
Yes use hikari
looking for someone who can modify a source code to keep the crops growing using an item placed in a chunk doing this job if there are no players nearby on no players in the server
?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/
nah need someone now to help me here
I mean, post what you have and what your issue is ?
you need to verify with your spigot forums account
Is there a way to tell if a player is touching a cobweb at all, like when checking if they're touching water at all
what is the best way to count how many mobs are there in a server
try !verify the /verify is broken until @sullen marlin check
its done i verified
touch?
what do i need to change in this code to make it the crops grow even if there is no player nearby the crops or no players in the server
why did you duplicate all that code like 7 times
and why do you use the chunk's coordinates as key if you already only store it inside that chunk anyway
@tender shardcome dm
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
is there a version of it in 1.20.4?
import org.bukkit.craftbukkit.v1_20_R4.CraftWorld;
is not working
https://www.spigotmc.org/wiki/spigot-nms-and-minecraft-versions-1-16/ 1.20.4 is 1_20_R3 too
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thx
Whats the point of relocating cb and nms
nms isn't relocated anymore
and choco told me for CB it's relocated so people don't use it lol
what is the best way to count how many mobs are there in a server
You can use World#getEntities for each world
if you want just hostile mobs you can filter by the enemy interface
bruh any1 know where I messed up https://paste.md-5.net/jisicikawo.md
@Override
public void run () {
if(!PearlQueue.pearlQueue.isEmpty()) {
HeeseLogger.getInstance().getLogger().info("Executing periodical database access...");
try {
Statement statement;
statement = GetConnection.getConnection().createStatement();
for (PearlThrowLog i : PearlQueue.pearlQueue) {
String sql = "INSERT INTO pearl_logs(uuid, world, x, y, z, yaw, pitch, timestamp) VALUES('" +
i.getPlayerUuid() + "', '" +
i.getPlayerLocation().getWorld().getName() + "', " +
i.getPlayerLocation().getBlockX() + ", " +
i.getPlayerLocation().getBlockY() + ", " +
i.getPlayerLocation().getBlockZ() + ", " +
i.getPlayerLocation().getYaw() + ", " +
i.getPlayerLocation().getPitch() + ", '" +
i.getTime() + "')";
statement.execute(sql);
PearlQueue.pearlQueue.poll();
}
statement.close();
}catch(SQLException e) {
HeeseLogger.getInstance().getLogger().info("Error with statement");
e.printStackTrace();
}
}
}
}```
i.getPlayerUuid() + "', '" +
i.getPlayerLocation().getWorld().getName() + "', " +
i.getPlayerLocation().getBlockX() + ", " +
i.getPlayerLocation().getBlockY() + ", " +
i.getPlayerLocation().getBlockZ() + ", " +
i.getPlayerLocation().getYaw() + ", " +
i.getPlayerLocation().getPitch() + ", " +
i.getTime() + ")";``` ok updated, still same issue
can someone help me, i want to make a method which soulbinds a item to certain player
bro
sql injection
easy'
?
check this
oh this only has coordinates location etc
It doesnt let the player enter anything
so SQL injection impossible
its impossible to do an SQL injection here because it doesnt promt the player for any input
Hello guys,
public static AdapterPlugin getInstance() {
if(instance == null) {
instance = new AdapterPlugin();
}
return instance;
}```
why it throw IllegalStateException?
why
Because there should only be one instance of your plugin
and it is
not two (or more for that matter)
No the way you've written your code there there will always be two instances
One that you tried to make and the other that Spigot makes when loading/enabling your plugin
hi can you help me, i need some help creating a soulbound item which cannot be dropped and be with player even if he dies, if he has a custom role/permission. can you like guide me on how to do that
im kinda confused
Hello anyone know why Cannot resolve method 'setCancelled' in 'PlayerQuitEvent'
@EventHandler
public void onQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
while (true) {
event.setCancelled(true);
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou cant leave server!"));
}
}```
if i delete event.setCancelled(true); and leave the server my server crashed
You want to cancel a player quitting?!?
to have more players?
i dont think you can do that xd
why
private final LobbyCommand instance = this;
@Override
public void onEnable() {
this.getCommand("lobby").setExecutor(LobbyCommand());
}
@Override
public void onDisable() {
instance.getLogger().info("Disabled.");
}
Why print NullPointerException?
maybe bcs of "this."
try this one
private final LobbyCommand instance = this;
@Override
public void onEnable() {
getCommand("lobby").setExecutor(LobbyCommand());
}
@Override
public void onDisable() {
instance.getLogger().info("Disabled.");
}```
Okey, wait.
its new LobbyCommand() not LobbyCommand()
u can use without new too
my issue but change after copy the code to send to discord server
yea
Sounds python
Then just use this instead of LobbyCommand()
hi Draco can you guide me on how to create a soulbound item which can be given to a player with custom permission? just a little guide
Okey, wait.
A soulbound item?
Hmm
Ok
like which cannot be dropped by dropping or dying
I built but i have NullPointerException on onDisable
Mhm. Do the die event and check if you have any soulbound item you want to keep. Then just give the item again
And before giving check if he has permission
Because you are not supposed to create a new instance of a plugin
you also have to listen to all inventory click event to ensure teh player isn;t moving the item/dropping it
oh ok hmmm, i will try to implement it thanks!
thanks got it
Also
?
but on disable not enable
private final LobbyCommand instance = this;
it's final variable
Why is it private? Just remove the variable
maybe try this? this.getCommand("lobby").setExecutor(instance);
Bro, I got NPE on onDisable(), no onEnable()
oh sorry my bad
thanks
but varaible is final and
nvm'
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
static access in a non static way
we've all been there 🙂
🥲
is there a way to check whether or not a redstone update would update any block around it
By checking
got this error but it's looking good in my IDE
I'd use something like MineDown or MiniMessage
but you could use legacy chat you essentially need to make a linear gradient
look at my createLinearGradient method
both MineDown and MiniMessage are Chat APIs
they parse an easy to use format into components
no no API could do that easily
you'd need to essentially read the chat component and do a reverse on the linear gradient to get the starting 2 colors
2 easy APIs to use are MiniMessage or MineDown for parsing strings into Styled Components
if you want to do any form of reading you'll need to make your own way
note that MiniMessage requires kyori adventure
whereas Minedown works natively with spigot
yes
yes
you don't
you'd need to write your own API for that
that parses the Json Based Components into colors again
no
because it seems unecessary to me and probably many others
no I'm not feeding you code
you have to make it yourself
Error occurred while enabling wamasterv3 v${project.version} (Is it up to date?)
java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
with:
package fr.axsc6_l.wamasterv3.commands.commandHook.mapping;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
import net.minecraft.commands.arguments.selector.EntitySelector;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BaseCommandBlock;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.CommandBlockEntity;
import fr.axsc6_l.wamasterv3.commands.commandHook.mapping.api.AMapping;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
import org.bukkit.entity.Entity;
public class NmsV1_20_R3 extends AMapping {
public NmsV1_20_R3() {
}
public List<Entity> getEntitiesFromSelector(String selector, Block commandBlock) {
List<Entity> entities = Collections.emptyList();
CommandSourceStack wrapper = this.getCommandListenerWrapper(commandBlock);
EntitySelectorParser argumentParser = this.getArgumentParser(selector);
try {
List<? extends net.minecraft.world.entity.Entity> nmsEntities = this.getNmsEntities(argumentParser, wrapper);
entities = this.convertToBukkitEntity(nmsEntities);
} catch (CommandSyntaxException var7) {
this.handleCommandSyntaxException(commandBlock, var7);
}
return entities;
}
public CommandSourceStack getCommandListenerWrapper(Block block) {
Level world = ((CraftWorld)block.getWorld()).getHandle();
BlockPos blockPosition = new BlockPos(block.getX(), block.getY(), block.getZ());
CommandBlockEntity tileEntityCommand = (CommandBlockEntity)world.getBlockEntity(blockPosition, true);
BaseCommandBlock commandBlockListenerAbstract = tileEntityCommand.getCommandBlock();
return commandBlockListenerAbstract.createCommandSourceStack();
}
public EntitySelectorParser getArgumentParser(String selector) {
StringReader stringReader = new StringReader(selector);
return new EntitySelectorParser(stringReader);
}
private List<? extends net.minecraft.world.entity.Entity> getNmsEntities(EntitySelectorParser argumentParser, CommandSourceStack wrapper) throws CommandSyntaxException {
EntitySelector selector = argumentParser.parse(false);
return selector.findEntities(wrapper);
}
private List<Entity> convertToBukkitEntity(List<? extends net.minecraft.world.entity.Entity> entities) {
return (List)entities.stream().map(net.minecraft.world.entity.Entity::getBukkitEntity).collect(Collectors.toList());
}
}```
rip can I not use a regular date?
ok ig ill just store unix time in seconds
sounds dumb but how do i remap?
read
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is obviously written for 1.18.2. If you use another version, you of course have to replace every occurance of “1.18.2” with the version you actually use. What...
I know its hard to read but I believe in you 😉
?paste
what jar are you using
maven should create 2 or 3 you have to use the one with 0 suffixes or prefixes
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>```
why are you compiling with java 8
use java 17 with latest version
maven should create 2 or 3 jars you have to use the one with 0 suffixes or prefixes
sure i'll check that
it's doing only one jar
i'm compiling with artifacts, i heard it was not the best way but it's working for me ||maybe not here apparently|| IDK if it change everything
don't ever compile with artifacts
ever ever ever
if you're using maven never compile like that
how should i compile ?
you should see a little M button on the right hand side of your intellij
click that open]
yep
hmm, how would i set biomes using packets?
i found dis:
but i have no clue how to use it, since there is no documentation and the constructors are:
k tysm
it kinda worked...
same error, but not same exact message:
actually i'm using the one without prefixes or suffixes and did not correct everything
don't ping staff for no reason
developer mode is so ambiguous too
my guess is you're in the wrong place
HOW I AM OPEN TICKET
how do I rebuild the jar before reloading?
I'm retarting the server everytime and it fells like a waste of time
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
That'll help with hotswapping code
Not all code can be hotswapped and some JVMs are better than others at it
You can make Intellij build and restart the server with a single button click
when calculating sha1 checksum of resource pack should i use zipped or unizpped file
okay i think that i cant even use unzipped
it makes sense that it is for the zipped archive since its the sha1 of the collection of files, not each individual file
how do i make plugin that has a world with a minigame build by me in it
or it spawns at certain coords
You'd load a world
and then start a minigame in that world
Honestly though you might want to be more specific
Block#defaultBlockState
client side block?
yeah
sent by a packet
i can break them in creative but not survival using a diamond pickaxe
client still sends a packet of it
you would have to listen for the packets and intercept them, since the server isn't aware about the block the server if it processes the packet just ignores it
so you have to intercept before the server can process it
okay. So how would i do that?
if you know how to send packets, you know how to listen for them
instead of injecting to outbound, you instead inject to listen for inbound instead
you would register a handler/listener on the network
Hey, little question, i have an inventory (from an other player) and i wanna set a players inventory to the inventory i have (called inv). how do i do that?
ProtocolLib helps if you dont want to inject a packet handler yourself
You copy the content of the players inventory into your view inventory.
what? what method do i use to do that? there is no player.setViewInventory or smth
Wait, do you want to display the content a player has in his inventory, or do you want to replace a players inventory with the content of another inventory?
i wanna replace the content, and i juste found this method, would it work? :
e.getEntity().getInventory().setContents(inv.getContents());
(getEntity returns a player)
Yes this should work
Would it be possible to make a player move faster when trying to walk around when falling in the air
how would I check the action in an EntityInteractAtEntityEvent?
the action is always right click
Represents an event that is called when a player right clicks an entity that also contains the location where the entity was clicked.
there might be an attribute for that i’m not sure
you could always check every tick if they’re on the ground or not then set speed accordingly
but i’m no expert
There's a flight speed attribute but idk if it affects falling
Good morning, I've been researching for a while, and I still don't know what the AnimatedScoreboard variable is, and I need the following:
Hours played variable
Time variable in today's world
And current date variable.
If you know what any of them are, please tell me. Thanks
What is Animated scoreboard? Is this a development question?
Yes, since it is a plugin I don't know what those variables are.
The answer is no
I have little to no clue what you are asking
if you're looking for the placeholder it's not a development question
How not? It is the development of the plugin itself.
so you want the code for it?
I need those variables
i think they're looking for PlaceholderAPI placeholders list?
What the hell even is AnimatedScoreboard?
a plugin
In that case that'd be #help-server - yes.
Ok, thanks
bruh can somebody please help ive been trying to figure this out all day
https://paste.md-5.net/ahamepazev.md
https://paste.md-5.net/irudiqehul.java
Column timestamp is the wrong type
its an integer
error says otherwise
where do i put that?
you create a start-server.sh or similar and put it there
put it where?
in your server directory
Does anyone know if achievements are handled by the server or client?
server
earning and removing server, rendering client
u can however handle the achievments menu from the server as well
So theoretically I can access and use achievements to determine if a player is within a structure?
why would u do that
Or is there a better way
I want to know when a player is in a structure and when they leave
how else would one do it
I tried plugins but there is no enter structure event
not that i know of
Yes. That uses nms.
And that requires a constant check
instead of one for entering and one for leaving
ok so how do u plan to detect when a player leaves the structure
oh yeah just use the "Left the structure" achievement
cuz i wanted to ask if it was the best way
u asked this
Yes.
explain to me how u detect when a player enters or leaves a structure w achievements
i want to know
location: structure: (the structure)
Then an achievent that requires the stucture to be none
or not that structure
Then I can just do a listener event that listens for an advancement.
Im trying to add a recipe for a "revive-star", basically an item that unbans a player in lifesteal. The recipe is supposed to have the head of the killed player and some diamond blocks and the revive-star should then unban the uuid from its lore. Do i need some crafting events for this or is there any better option?
you didn;t run buildtools with --remapped
how can i create a gui that interact with the bungeecord?
i ran java -jar BuildTools.jar --rev 1.20.1 --remapped
oop
hi, im trying to setup remapped nms on windows, i get this error: [ERROR] Failed to execute goal on project mc-infinite: Could not resolve dependencies for project live.mcinfinite:mc-infinite:jar:1.0: org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
. i ran java -jar BuildTools.jar --rev 1.20.1 --remapped. this is my pom.xml: http://0x0.st/H6at.xml
?nms
😂
Oh no, the quality video link is gone
Here, browser history to save your day: https://www.youtube.com/watch?v=2oItMdl-8pkY
Okay who the hell is commenting on that video?
What is max size of uploading image to spigot
I am trying to upload same image on my second project
I litterly downloaded it from my first one
and I am gettign error
If you have a direct link, then yes IIRC
why on earth do you use that high of a resolution
image is 900 Pixels
Although, could be AI-genned, at which point that doesn't make you that clinically insane
it is fine I got it working
How hard would it be to create my own server engine? Just an empty server, with no blocks and stuff. Like a queue server, no need for bukkit compatibility.
already exists
called a limbo
the way he speaks is ironical or that's just how he speaks
ik the image can't share sounds but if anyone is familiar with his content and knows for sure please let me know
yeah im pretty sure he just has a lisp
He said his own. You clearly didn't understand what he was asking.
@grim hound If you're asking how hard it would be to make something like Spigot, very difficult. If you're wanting to just make something simple and not efficient - could probably do it in a few days.
nah ur just a shit developer lmao
also how hard something is really depends on experience
whos so eager to get his lil ego up
also stop fighting
i sent him something
Yeah, but I can tell you from experience that making something simple and not efficient would be pretty straightforward.
You're the one acting rude. 🤷♂️
yes thats true but a question like how hard is it to make a server implementation is kind of a loaded question in any case
That's why I gave two answers.
fair
🖖
Why do you think that, lil bro
Child spotted.
I'm sorry, I thought this was Spigot. lol
litearlly stfu 💀
Randomly insulting each other isn’t gonna solve anything
also randomly replying to my replies isnt gonna solve the original problem
I could go on about that, but I'mma just head out. Lmfao.
.
So it's been awhile since I messed with Spigot and I've been noticing Paper a lot more. Is it worth learning and using Paper or can I just stick with base Spigot?
You should stick to spigot if you wanna upload your stuff to spigotmc
Working on a custom PvP server.
I mean, asking in spigot if you should use a competitor of spigot is kind of nonsensical
huh lol
I mean, paper competes with spigot for market share
Paper uses Spigot
how can you compete with what youre forking from lol
huh ?
yea, to the vanilla server software it is
But it branches from vanilla software.. lol
and still spigot aims to be the no 1 server software you use
and Paper uses spigot
xD
if paper "beat" spigot, there would be no paper. like what
I mean, the goal of every fork is to be so popular you hard fork
paper just makes a few adjustments to the efficiency of things. i fail to see them trying to compete with spigot lol
Well, their API changed rather drastically in a lot of places
just having a hard time understanding lol
I mean, asking people in this discord (people that generally believe spigot to be better, otherwise they'd be in the paper discord) if paper is better
like
do you see how that might not be a useful question
isnt that the point of paper though? to fix performance issues?
high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
I can obviously see it, yeah
isnt that how software grows though lol
spigot just grabs paper devs, i dont really see the hard contrast of the two
i havent really seen anything to drastically different in the paper api lol
when did you last check
a few days ago
i mean its not like i was taking an entire day out to study it lol
given paper deprecated all of legacy text in favour of adventure
Like a bunch of nerds

How xD
you asked a subjective opinionated question
I am just pointing out things that changed
which, you probably are best to just "try and see"
i asked if its worth learning and using paper or just to stick with spigot
how is that subjective or opinionated
probably not the place to ask considering its highly subjective
If I believe paper is better than spigot I'd say yes, its worth learning paper. If I don't believe that I'd obviously say no ?

paper modifies the API and server in ways other users may not like
so say no, and give reasons why?
thus its subjective
i dont understand whats so hard about that lol
I can't choose for you
but im asking for it.. lol
My opinion is that I prefer spigot 🤷♂️
I mean there are millions of opinions
to me, all i know is paper just adds performance
try it out for a while and see how you like it
thats why i asked the question bro
Paper is better
that's how you form opinions
A third opinion
well machine might think its a fact xD
Tho I heard thi Machine_Maker guy is biased
im an adult, i can take in multiple opinions and form my own
the thing with Minecraft server software is its really easy to try new stuff out and decide for yourself
I mean, given you can literally just go try paper-api rn and compare the usage to spigot-api
idk why you'd instead ask the opinion of people in the spigot discord channel
because its faster?.. lol
if someone already knows about it and has tried it, why would i not ask
I mean, wouldn't you ask in the paper discord channel xD
the paper api adds tons of new events, a complete text component system available everywhere components can be used.
the paper server adds dramatic performance increases, fixes inconsistencies and long-standing vanilla bugs
no, because like i said i used to develop in spigot
all those damn paper nerds are over there I heard 
because im currently focused on spigot, why would i go to paper lol

™️
choco pls 🙏
I'm not on copium I'm not on copium 😭
Hey our component system will be merged soon
available everywhere components can be used.
see i wasnt a big fan of the component thing either lol
think i just used my own string handling stuff
paper's got minimessage natively for easy lossless string representations of text
"Intellij disable inspection"
it'll be less annoying once String templates get added to java too
oh yea, my god string templates
or when minecraft updates ig
Do y'all use Krita or still stick with Java?
I will brute force that API java version bump faster than you can say "but the section sign is less verbose"
But the section sign is less verbose
ew
yeah, less verbose. like how brainf*ck is a less verbose programming language
you were faster for me lytnx
💪
I prefer js ${player}
💪
Pineapple."<red>Hi there <gold><$player>
I just realized we deviated from MiniMessage @remote swallow well whatever who tf cares
Is that something from a component system or template string?
isnt that also kotline and groovye too
java templated strings
I never got into Java other than to do MC stuff. Lol.
not yet generally available
got a technical question, if you pass a task to async and then pass it back to sync, and use timings to try to check performance, usually timings can't measure async performance but what I really want to know is how the overhead of passing it into async and out of async works, how does the performance overhead for that show up?
I come from Python/C#/Web Dev
Because then you can construct those components super easily
because java string processors can produce any type as output, not just strings
Oh lol damn
so ```java
Component c = MM."<red>Hi there <gold>$player"
is valid
if that is the syntax
if I'm creating 1000000 async tasks every tick and getting them back the next tick, does that show up as minecraft overhead or the plugin's overhead? I seem to recall it was minecraft, right?
PineappleChat >>> MiniMessage /j

Java has always been weird to me, I think I might stick to Krita then lol
Drawing my spigot plugin 
Remember the paint ide
iiimmmaagggiiinnaatttiiiooonn
remember visual bukkit 
you never know about the future lol
As if that isn’t still around
i like to draw my mods
oh shit yea, last commit yesterday
There’s also McCreator
Your plugin must be compiled against Java 8 at minimum
Unless you're compiling against Paper API in which case your plugins require 17
(but if you're writing a plugin for 1.18+, you might as well compile with 17 anyways)
where are you changing it
and how are you building it
?paste ur pom
If you're using Maven then you have to be sure you're actually compiling with Maven, not exporting an artifact via your IDE
im guessing your compiling with ur ide not maven because mavens set to use j11
I mean, you can compile via the maven "package" goal. You can either do that by finding the maven tab in intellij and finding the package goal
or you open a terminal in the root of your plugin and run mvn package
or via CLI like an absolute chad

output will be located in the target folder
I mean, could try to smack the release option in there
<maven.compiler.release>11</maven.compiler.release>
I guess
won't work when compiling with anything below java 9 tho
and then do a clean package I guess
Building Maven in your IDE is totally fine lol. Mostly teasing with the CLI comment, but it is totally a valid way to build it
yea I guess
has been a while since I had to do maven 😅 mostly just going off of google rn
that's forge :(
gradle on top
technically you can
you just like have to spend 12 years making it a maven plugin
running gradle on this project was the most pain I have ever experienced while trying to run any of my code
maven ftw
did that pom.xml not work 😅
mavennnnnn ❤️
@atomic niche you are great
(I am in the minority here to be fair)
A lot of people now love IJ, kotlin, and gradle... I'm one of the few holdouts.
imma holdout on gradle and kotlin
I switched to IJ like 2-3 months ago
😔
early it was complete garbage imo
because the standard theme just looks ugly as fuck imo
now I just made my own theme
Completely unrelated, but hypothetically, for the following extremely stupid task, what would be a good algorithm:
Given n random plugins and their dependencies, find the combination thereof with the fewest plugin conflicts.
yea probably smack the output of mvn clean package and the error log into a paste
I could test compatibility of every potential pair of plugins, but for high values of n, that would take ages.
dw I have a render-farm with 1000 RTX 4090s and 1000 ryzen 9 7950x3ds in my basement
I probably need to have it group the plugins into buckets known not to be incompatible with each other
then compare the buckets against each other
would still be a problem with a high enough value of n
I know
Although, probably not a practical concern in this case
I mean, that just smells like you a) did maybe not run the clean goal yet and/or b) did not update the jar ?
The goal here is basically to get as many possible plugins running on stupidly overkill hardware for a few hours as a joke for a temporary event
given you are using java 11 it is rather impossible to end up with class version 64 (java 20)
bro give me ideas I can code for my SMP (util) plugin
plis
I don't think a server with (likely) 500+ plugins would count as a SMP... just a mess, although hopefully a hilarious one

