#help-development
1 messages · Page 153 of 1
also is it like a new trend or something to use custom entity models
idk i see a few servers doing it now
i have no experience in graphic design nor 3d modelling so i cannot create models
and if that's what people are expecting from servers then idk what to do
start
Wut
whatchu think of mine fam
random bullshit
pov: you paid attention in art class
what
basically several systems
ima kms
What is this, no man’s sky
should I have an AFK kick system in my server?
and also is TCPShield good DDoS protection?
yes
when you come close to the planet you get teleported to another bungeecord server
which contains several worlds for some of the planets
so there are servers for space(systems) only and for planets only
Moving is made with movecraft or how is this thing called
i just coded bungee sync
k y s = know your stuff
and actual maths of planets
don't worry
?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!
?jd
L
?paste
?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!
yes
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
mommy says i'm always first
?mydata
Syntax: ?mydata
More information can be found in the End User Data Documentation.
3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.
?whatdata
?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.
?getmydata
?jd Player
bruh
?mydata whatdata
This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.
Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.
cap
?mydata joel
Syntax: ?mydata
More information can be found in the End User Data Documentation.
3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.
?mydata
Syntax: ?mydata
More information can be found in the End User Data Documentation.
3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.
?mydata whatdata
This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.
Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.
:D
probs choco
i'm catching up to md
it's my goal to beat him in messages
13k from me wtf
Holy shit
I don't even speak that much
ye bro
OOF
only 2K L
just joined this month
bandit
L
so are you so stfu
thats what happens when you split up every message into 100
fairs shreb
he is literally me
I try my best to keep the things I wanna say together so that people who just joined the convo can get an easy view of my mental deterioration
of your mental destruction
whats the difference, really
idk
alex is one of if not the best person who could help you here, always active and pretty much always correct XD
Im dating alex btw
I thinnk
if not ima call defamation
I half expected "A bot" as an answer
there my bio 
lol I remember when I said this 😭
@floral drum
see @crimson terrace
I actually remember that message when it was sent XD
are you male?
then its normal
carry on, soldier
alex can pound me 😭
just make sure you dont randomize the walls
going right for the feels, huh
the algo for that was made by me, i meant to make it like an open area, I am now instantly switching to WFC
development and sleeping
development, sleeping and playing ark or barotrauma
tf is MDMA
at this point I don't even play that much on my own
I just play if asked
you only realize what you had when you lose it. serotonin included
but if you get off that it should go back to normal within some time, right
I am bad at biology, what is serotonin
happy chem
sarcastic
https://web.roblox.com/games/6407649031/NO-SCOPE-ARCADE this is the only game I play tbf
I like killing children
I think its more of a "I take this and get used to high af levels of serotonin"
me when someone tells me to man up
Imagine going to parties
what does your physique have to do with EDM
"big" :3
damn I forgor the /s
ik
how do I make an entity walk smoothly to a block?
you need nms
I've been trying that but it's been weird
do i just have to set the navigator's target and it does it on its own?
I think the method for entities to walk somewhere only works for a certain range
Zombie z = (Zombie) block.getWorld().spawn(block.getLocation().add(0,1,0), EntityType.ZOMBIE.getEntityClass());
((CraftMob)z).getHandle().getNavigation().createPath(((CraftPlayer)p).getHandle(), 1);
this is what i've been doing but the mob does nothing
¯_(ツ)_/¯
any idea why its not working?
I've found a way to use A* pathfinding to get an array of locations
but I don't know how to make the entity move
doubt it would work
the player's an entity anyways
i tried with x,y,z values didnt work either
navigation target or regular target?
this happens though
Villager v = (Villager) block.getWorld().spawn(block.getLocation().add(5,1,0), EntityType.VILLAGER.getEntityClass());
v.setCollidable(false);
v.setInvulnerable(true);
z.setTarget(v);
this is my code
they do pathfind to it
Hello, I'm facing something weird, why is my NMS classes like that:
import net.minecraft.network.chat.ChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketListenerPlayOut;
import net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.level.WorldServer;
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.ScoreboardTeam;
import net.minecraft.world.scores.ScoreboardTeamBase;```
Shouldn't they be coming from `net.minecraft.server.v1_17_R1` since it's my version?
```java
import org.bukkit.craftbukkit.v1_17_R1.CraftServer;
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard;
import org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboardManager;```
Those are the only ones that contain `v1_17_R1` for me
1st load of mc mappings
2nd load look like spigot or bukkit mappings
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>``` do I like have to add something here?
NMS = Mojang. CraftBukkit = Spigot. Two different imports
For my build tools I ran: java -jar BuildTools.jar --rev 1.17.1 then I ran java -jar BuildTools.jar --rev 1.17.1 --remapped
Do I have to make it like this:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```?
for what?
For nms
You don;t see to understand what is NMS
NMS = all imports which start net.minecraft.server
Yes I know but shouldn't
import net.minecraft.network.chat.ChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketListenerPlayOut;
import net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.level.WorldServer;
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.ScoreboardTeam;
import net.minecraft.world.scores.ScoreboardTeamBase;
``` start with `net.minecraft.server` for me?
Spigot API/Bukkit = all imports which are org.bukkit, but non API (implementation are org.bukkit.craftbukkit
not everything..?
NMS is ONLY those starting net.minecraft.server
well anythign net.minecraft really
So those imports aren't NMS?
they are
Then why does they not start with net.minecraft.server
anything net.minecraft
And they don't have v1_17_R1
NMS is a misnomer
Oh
Ok but shouldn't they contain the version? 1_17_R1?
v1_17_R1 is CraftBukkit
You prolly have the mojang remappings
I never did
I imagine it would be fun but i cant bother
Responding to an hour old message
discord put me there for some reason
Sounds like sarcasm
yeah
most of migration ways are blocked
you can escape getting to Ukraine if you change sex xD
or if you have billion usd dollas
Or you're super out of shape.
They are drafting deaf 60 year olds with diabetes. Dont think being out of shape does anything for you.
I'm glad to live in Canada.
72h operation for sure 🙏 (tho I guess more of a #general discussion lol)
no we arent
but still
it's kinda scary
Don't get drafted
government stated that students are not touched
Lots of noobs need java lessons
from state universities
from commercial nobody gives a fuck
commerical students get drafted first
yeah i know
who cares
🙂
I presume the commercial uni students 🤔
Everyone who suffers under this extended war. So pretty much the whole world.
This looks like ww2 propaganda signs XD. What does it say?
it probably is from that time period tbh
proletarians of all countries, unite
and
in our friendship we gain our power
300 years of ukr+rus reunion
#general wen 
it's after ww2
like 1960s
The statistical probability of a communist country failing is dangerously close to 100%
mostly cuz humans arent as dumb as peope believe them to be
its psychology
you get the same as everyone else
so working more gets punsied and working less gets rewarded
and it quickly collapses
not true
There are real proofs. Countless. Read a history book from the last century.
#general
yeah i probably know better cuz live in post-soviet country
and i know own history more than any other country
Forgot to add the command to your plugin.yml
no
The line:
NPCManager npcManager = new NPCManager();
this was happening to me too
nms can't be found
are you using mojang mappings?
you need to remap it
its called like specialsource or something
yea theres that 1 plugin
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
This is my pom
look up nms mappings spigot
Dependency
u should find a forum post by md_5
<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.19-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.19-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.19-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.19-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
change 1.19 to whatever version you have installed of buildtools
?paste exists yknow
Do I add that to my <plugins> in pom?
yes
yes
ceebs
Oh do I just replace all the 1.19 with 1.17?
what ur compiling to
Lemme try
just keep in mind
console errors will not show unobfuscated
it will show as the letters
IntelliJ constantly tells me to download shared indexes, anyone knows what thats about?
Do it. Decreases your initial loading time for projects at the cost of some disk space.
lright thanks
also
do you know how annoying it is to be unable to ask this in the intelliJ discord cuz i only have one phone and two discord accounts
I added event.getInventory().setRepairCost(1); and it did nothing
try one tick later (no idea what you are doing btw)
If that solves it ima be mad about that ping 😄 that is what the link i gave suggested too
I'm trying to make a projectile invisible. I know I need to use packets for this, but I don't know how to get the packet I require. I found that I need the PacketPlayOutEntityDestroy, but I don't know how to get it. I can't find the class path for it anywhere, anyone who knows?
or scheduling a task for the same tick is what it said exactly
can u spawn particles into world async
Shreb, would you please help me with this?
did you delay the setting of the repair cost
no
then I will not help you since you choose not to listen to me or smile
yes
just a quick hint tho
k thx
from the link I already sent you YTG
ok i delayed it and it works. i didn't see your message before
thx
you literally replied to the link
Hey! Might be a dumb question here but I'm trying to log bans, now obviously when someone who was online is banned that's easy. It's a kick and a ban check. But when someone is banned whilst offline it's a bit trickier.
Obviously most people would just do /ban Notch in chat, but I want to store UUIDs (for obvious reasons) so I can't just parse the arg straight up. In banned-players.json the UUID exists, but it doesn't seem to exist on the BanEntry interface, is there a way to get it easily or should I simply do an API call to mojang to get the UUID from the username that I parse from the command event?
you cant get something thats not there. if the server doesnt know the uuid either, you'll have to query it from mojang
I mean, technically the server knows it no? Otherwise how can it populate it in the JSON file 😛
But yea, querying it is 😄
log bans as in get all bans or get all new bans?
More as in detect when a new ban is placed and do something with it
oh, misread. yeah well either read the file directly or query it then
its sort of hard since plugins can also be used to ban... youre gonna have to check the delta of the file it saves the bans in yeah
Yea I'm hooking into litebans etc separately, this is more for servers that don't use such a plugin
So for all intents and purposes I assume the vanilla ban command specifically is used for this
But yea, seems like easiest is still to just parse input from the command events and do the querying myself to get a UUID and go from there
Was hoping to avoid that due to laziness ngl 😛
is
a:b: int
a:c: int
valid? ie, can i call config.getInt("a.b") and config.getInt("a.c") ?
Looks valid to me. But its really weird to have the same path twice. This might lead to problems.
Why dont you use
a:
b: int
c: int
cuz this looks better than that
particle:volume: int
particle:size: double
``````yml
particle:
volume: int
size: double
1st world problems i know i know
How do I start coding spigot plugins ?
I have 0 knowledge about it and any coding languages
Then start by learning java
Ok codeacademy is good?
?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.
Ok thanks matey
I shall also call smile matey from now on
And after that you can search for video tutorials or follow this page:
https://www.spigotmc.org/wiki/spigot-plugin-development/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Arr that be fair
id suggest w3 schools
Not sure what that means...
I assume it will take months for me to learn Java already innit
If you have time and dedication then maybe 2 weeks before you can jump into spigot.
A hour or two per day, thats the best I can do
I learned most of my experience in spigot actually
So if i put that time how much would I take
well
code is mostly just locic pressed into a specific form
example
teleportation has the 'logic' of:
take object to teleport
take location to teleport it to
change the location of the object to the target location
and code just translates that into something readable for machines
public static void teleport(Object o, Location target){
o.setLocation(target);
}
depending on how fast you grasp the basic concepts i guess
after that its not that difficult
Public static void etc I never understood what that mean
When i put a hour into java
Really depends on how good your technical understanding is.
Programming is very logic driven.
is there a way to open an shulker box itemStack's inventory withour placing it down?
'public' -> access modifier, other things can see and use this
'static' -> can be used immediately
'void' -> what the method returns
If you got a background in maths or physics then you should be able to learn a bit faster.
Hmmm then might take a moderate amount of time for me
so a 'private int' is a method that can only be used in the file its written, and it gives back an int
Yeah I am in physics maths and chemistry
Is it good practice/safe to use methods like this? public Object getFieldValue(String field, UUID uuid) { try { PreparedStatement preparedStatement = connection.prepareStatement("SELECT " + field + " FROM players_data WHERE uuid = ?;"); preparedStatement.setString(1, uuid.toString()); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet.next()) { Object object = resultSet.getObject(field); preparedStatement.close(); return object; } } catch (SQLException exception) { exception.printStackTrace(); } return "?"; }
(i am Walter white)
Yes. The ItemStacks meta is instance of BlockStateMeta. The javadocs should lead you to the right points.
Returning an Object is a pretty bad design choice.
uuids are natively supported by pretty much any sql database (excluding sqlite)
Btw you should return null instead of "?"
so should I use method like this or no
For what purpose?
getting values from database
I would add a type safety feature
how can i do that
public <T> T getPlayerValue(String fieldName, UUID uuid, Class<T> type) {
try {
PreparedStatement preparedStatement = connection.prepareStatement("SELECT " + fieldName + " FROM players_data WHERE uuid = ?;");
preparedStatement.setString(1, uuid.toString());
ResultSet resultSet = preparedStatement.executeQuery();
if (resultSet.next()) {
Object object = resultSet.getObject(fieldName);
preparedStatement.close();
if (type.isInstance(object)) {
return (T) object;
}
}
} catch (SQLException exception) {
exception.printStackTrace();
}
return null;
}
tysm
i can feel my sanity slipping. This removes duplicates from the list right?
if(displayTimes.size()>1) displayTimes = new ArrayList<>(new HashSet<>(displayTimes));
Btw you should not have a single connection and reuse it. For every query there should be a new connection.
A connection pool like HikariCP helps a lot with this.
someone help my game crashes whenever this runs https://paste.md-5.net/yiyeyuyehe.coffeescript
Yes
k thx
If i where the game i would also crash if someone forced me to run that
Any exceptions?
uhhhhhhhhh no
Here. I cleaned the method a bit
@EventHandler
public void onClick(PlayerInteractEvent event) {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
return;
}
ItemStack usedItem = event.getItem();
if (usedItem == null) {
return;
}
if (!ItemManager.isEffectToken(usedItem)) {
return;
}
Player player = event.getPlayer();
player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 1616);
Random random = ThreadLocalRandom.current();
int roll = random.nextInt(1, 12); // rolls from 1 to 11 (12 is excluded)
// This should be an array to be honest
PotionEffectType type = switch (roll) {
case 1 -> PotionEffectType.INCREASE_DAMAGE;
case 2 -> PotionEffectType.SPEED;
case 3 -> PotionEffectType.JUMP;
case 4 -> PotionEffectType.FAST_DIGGING;
case 5 -> PotionEffectType.FIRE_RESISTANCE;
case 6 -> PotionEffectType.WATER_BREATHING;
case 7 -> PotionEffectType.ABSORPTION;
case 8 -> PotionEffectType.CONDUIT_POWER;
case 9 -> PotionEffectType.HERO_OF_THE_VILLAGE;
case 10 -> PotionEffectType.DOLPHINS_GRACE;
default -> PotionEffectType.LUCK;
};
PotionEffect effect = new PotionEffect(type, 1_000_000, 1);
player.addPotionEffect(effect);
player.getInventory().removeItem(usedItem);
}
Hello, I am currently trying to change the world a person is sent to after defeating the Ender Dragon. I originally used the PlayerPortalEvent, but it is not called. Likewise, the PlayerTeleportEvent, for example, is not called. Is there another event than PlayerChangedWorldEvent, since I can not change the toWorld in this.
Code looks like this for people with less experience. Its fine.
I dont see any obvious ways if the PlayerTeleportEvent is not fired
what is meant by "isEffectToken"?
Thats bad
Its a method that checks if your ItemStack is an effect token. You need to implement it.
Btw comparing ItemMeta is very bad practice. You should use the pdc to check for custom items.
?pdc
What are you trying to achieve?
this looks big
I have a custom end dimension and would like to be sent to a custom overworld when teleporting back out of it.
having a static list of potion effects and getting a random element is bettwr
right?
With the Nether and the OW -> End, this also works well.
thats what she said
Yes. An array to be specific. Thats what the comment says.
Did you assume my gender before?
what does that mean
Well, at least one kind of solution thanks
Yeah but thats a bit hacky
also couldn't we use Integer.MAX_INT as the duration ?
uhhh how exactly do I implement the method
A million should be fine. Minecraft makes it permanent after way less even.
The method has very clear defined functionality.
- It takes an ItemStack
- It returns a boolean
The return value is true if the ItemStack is your custom item and false otherwise.
uhhhhhhhhhhhh
Hey, question rq, is there a way to make Git bash use a specific java version you choose?
Let's say you have 3 java versions, and you want to let Git bash use a specific one that u choose is it possible
Random random = ThreadLocalRandom.current();
->>
ThreadLocalRandom random = ThreadLocalRandom.current();
Hm, PlayerMoveEvent is not called :/ then i have to use the changedworld event.
Sure. Instead of calling
java -jar etc
You call
"C:\Program Files\Java\jdk8u312-b07\bin\java" -jar etc
So the full path to your bin\java
Ohh thanks so much
now it just completely doesn't work when I right click, perhaps maybe I implemented incorrectly, if thats the case, im new to coding ;-;
Add debug messages and find out whats wrong
ok
All good, I'll settle for the bypass :p
But do you have to put just java or java.exe at the end
.exe is redundant
the other one leaked my name ;-;
Ah alright, thanks
Looks good. Now run it.
I think I implemented the method incorrectly ;-;
What makes you think that?
because I think i messed up on this part, I think I misunderstood it. and I just did the closest thing that came to my mind
Then add debug messages and see where you messed up
._.
So this method simply says "Whatever you pass me, its my special effect token. Doesnt matter."
so uhhhhhhhh how do I not do that
Only return true if the passed ItemStack is your special effect token
so like if(ItemStack == effecttoken){
return true;
}
oke
For custom items you should always use pdc
But this is maybe too complex for you right now... So isSimilar should work for now
I did not copy because then there would be no fonts, and without fonts it is not beautiful ;-;
You need an /equals raw that sends it with the markup
What is the best way of recognizing inventories
I assume it's not using inventory holders
Yeah, maybe I'll do that
actually for that too
You mean for custom inventories?
Put them in a Set<Inventory> or use Map<Inventory, SomeHandlerForInv>
Hi all! Now I'm redoing the plugin for Stamina, and I have a question how to make a separate action bar like in the EXP action bar
Wdym a separate action bar?
There's only the single action bar in vanilla above their health, if you want to make a custom one then you need resource packs
Ah and how would you add new lines with a resourcepack?
You'd still use the regular actionbar, you'd just send things with different ascent values for the lines
Or negative space if you want to go to the left
it still doesnt work when I right click
Then they aren't similar
Send the code
if (usedItem.isSimilar(effecttoken)) {
return true;
}
return true;
}
}```
Add
else {
Return false;
}
ok
Or just make the 2nd one return false
Or even better just return usedItem.isSimilar(effecttoken); 😛
This is not spigot related, but is there any way to make a good UI with java? The normal GUI is just so ugly and extremely wack to use
Swing and JavaFX are the only official options I think
But they have LookAndFeel "themes" to make them look less shit 
javafx
It cant
I can almost guarantee that if you send a crash report, those two lines are not why it happened.
Hey, why does this not find the custom item tag?
Code: https://paste.md-5.net/ravazasipe.js
Just a heads-up, the tag namespace is from another plugin
Helloo,
I wanna ask about something that seems a bit weird.
Why when I run BuildTools on a version other than 1.17.1, such as 1.16.3 it just works how I want it to, it allows me to use all the NMS classes and they are just net.minecraft.server.v1_16_R2
But when I run BuildTools on 1.17.1, It's different the classes are like:
net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam So 1.16.3 is: net.minecraft.server.v1_16_R2.PacketPlayOutScoreboardTeam why is that happening in 1.17.1?
that is not on the server, but that shouldn't matter I think?
net.minecraft.server.v1_16_R2 does not exist
It does
Since 1.17 there are no spigot mappings anymore. If you want to use nms then read this page and scroll down to nms:
https://www.spigotmc.org/threads/spigot-bungeecord-1-17-1-17-1.510208/
v1_16_R2 is a CraftBukkit identifier and nothing to do with NMS
org.bukkit.craftbukkit.v1_16_R2exists. There is nonet.minecraft.server.v1_16_R2`
Ohh alright let me check that
Shouldn't this value.equals(DFValue.nullVar()) be negated? If it's the nullVar that means it wasn't found, if it's not then it was found.
So in your example, value isnt' the nullVar, so it prints false, but actually it should print true since it was found.
yeah wait that's an oopsie
Looks like the tag is found but the equality check returns false.
Did you properly implement the equals method of your DFValue?
Ah nullVar is the opposite of what you want to check? You should still overwrite equals
Doesn't IntelliJ intelligently generate equals() or am I on drugs
I think the real issue was that I put DFType.TXT instead of DFType.NUM in the 2nd constructor
I thought the tag was just not being found but oh well
yeah alright that fixed it
You can refactor and generate them
Right yeah
I knew you could manually do it but I couldn't remember if it just does it by default
This does the same
Hello, did you know where i can get theses imports into 1.19.2 ? I don't find...
https://paste.md-5.net/dewevehuka.css
Those are Spigot mappings which no longer exist.https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
hello
when i try sending message with a unicode it works fine but when i try getting a string from config that has unicode
it dosent work
is there something wrong i am doing
my config is formatted in UTF-8 and afaik it supports unicode
How are you reading from your config?
Yamlconfiguration#getString
Then your config file can;t be saved as UTF8
i opened it with a text editor and it says my config is UTF-8
is that the config on your test server or the one in the project before you build?
in test server
Then you'll need to show us your loading/reading code you use to access the filer
?paste
replace all that saving code with in your onEnablejava saveDefaultConfig();
That creates folders if it needs to and only saves the resource if it doesn;t exist
as for the rest, looks fine
args[0] is the first argument for a length == 1
default spawned mob's PersistentData will always be empty right?
alright thanks!!
umm what i see is it only saves config.yml but all i have multiple configs
?configuration
and it does the same the way how im saving
i can never get those right
so if the config does not exist you save it?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thats not problem is but my config dosent support Unicode character
...
try converterting the char to unicode value and save this int to your yml file. And for loading vice versa: load the int from the yml and convert from unicode value to character.
could work, there may be a better method but I dont know it
Config fully supports unicode
oh yeah Thanks for suggestion let me try it out
If its not working for you its in how you are saving/loading. Which is why I asked to see code.
ElgarL do you put yourself with * perm on GroupManager?
setting * perm is just a bad idea in the first place
Just read a post the other day where you answered someone and said you did, but you only played on your server or something so it didnt matter
No, I was included in the sample file as mod
oh nvm then
I recently removed all examples though. It got annoying when people didn't see the purpose of an example.
Inside InventoryMoveItemEvent when I try to just cancel the event and remove an item from the hopper, instead of one item being removed, the hole stack is removed. I have been stuck in that problem for hours now.
e.setCancelled(true);
ItemStack stack = e.getItem();
inv.removeItem(stack); //with amout of 1
does anyone know why?
how did I told it to remove a stack? The item stack has the amount of 1. I printed the value out
heehee
if there is only 1 in the stack then removing 1 IS the stack
no, for example if I have 32 items in the hopper, executing this code will remove all 32 items
(in the same stack)
do end crystals and tnt trigger the BlockExplodeEvent if a block explodes
It will try to remove 'as much as possible' from the types and amounts you give as arguments. ```
what should I use then?
setAmount
ok thanks
afaik not
probably not though
the only time i worked with inv api is when i made a hardcoded shop gui
Can anyone tell me why it won't let me call getDataConfiguration? Am i missing something?? I'm trying to recode an old plugin i had made for my server and can't work out why it won't let me call for it when i'm pretty sure I have everything there??
getter where
I'm trying to open a shulker box ItemStack's inventory and for some reason it does not work. it does'nt open the shulker box's inventory at all. any ideas?
if(item.getItemMeta() instanceof BlockStateMeta){
BlockStateMeta im = (BlockStateMeta)item.getItemMeta();
if(im.getBlockState() instanceof ShulkerBox){
ShulkerBox shulker = (ShulkerBox) im.getBlockState();
event.getPlayer().openInventory(shulker.getInventory());
}```
the item is the shulker i already checked
uhh idk i refuse to use lombok
I fixed it lol, i missed getter in my main class
and why?
Add debug messages and see how far it goes
it goes all the way to the end as it should
it opens the inventory of the shulker for like a tick and then closes it
Show what the "end" is
the end of the code that i sent
should i delay the line that opens the inventory?
Yes this one line
it still does the same as before
Show your new code pls
public void onRightClick(PlayerInteractEvent event){
if (event.getAction() == Action.RIGHT_CLICK_AIR && event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "Insee"), PersistentDataType.INTEGER) && event.getItem() != null){
ItemStack item = event.getItem();
System.out.println(1);
if(item.getItemMeta() instanceof BlockStateMeta){
System.out.println(2);
BlockStateMeta im = (BlockStateMeta)item.getItemMeta();
if(im.getBlockState() instanceof ShulkerBox){
System.out.println(3);
ShulkerBox shulker = (ShulkerBox) im.getBlockState();
Bukkit.getScheduler().runTaskLater(plugin, () -> {event.getPlayer().openInventory(shulker.getInventory());}, 1);
}
}
}
}```
Just tested your code. It works without a problem for me.
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
ItemStack usedItem = event.getItem();
if(usedItem == null) {
return;
}
ItemMeta meta = usedItem.getItemMeta();
if(!(meta instanceof BlockStateMeta stateMeta)) {
return;
}
BlockState blockState = stateMeta.getBlockState();
if(!(blockState instanceof ShulkerBox shulkerBox)) {
return;
}
event.getPlayer().openInventory(shulkerBox.getInventory());
}
yes
idk it opens only for a very short time and then closes
how is this working for you and not me
Then you have another listener interfering
I only have PrepareAnvilEvent and LootGenerateEvent
it couldn't have messed with it
Did you try out exactly this piece of code?
public void onRightClick(PlayerInteractEvent event){
if (event.getAction() == Action.RIGHT_CLICK_AIR && event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "Insee"), PersistentDataType.INTEGER)){
ItemStack usedItem = event.getItem();
if(usedItem == null) {
return;
}
ItemMeta meta = usedItem.getItemMeta();
if(!(meta instanceof BlockStateMeta stateMeta)) {
return;
}
BlockState blockState = stateMeta.getBlockState();
if(!(blockState instanceof ShulkerBox shulkerBox)) {
return;
}
event.getPlayer().openInventory(shulkerBox.getInventory());
}
}```
Try opening the inventory you get from getSnapshotInventory()
What version are you on?
1.19.2
Do you have any other plugins installed?
no
also, that did not help
Well ive tested this exact code on 1.17 1.18 and 1.19 without any problem. You broke something somewhere.
Try getting the inventory snapshot beforehand and open the inv 5 ticks later. idk
i will restart the server
Dont you dare telling me that you used /reload
i did
if reload is that bad, why does it exists actually?
There is a good reason that the reload command tells you that it practically destroys your server.
isnt /reload an mc command
Reload is not supported by spigot
isnt it here since 1.12 or something? cause reload is in spigot 1.8 as well
@lost matrix I restarted it and it still didn't change anything
Like... is this message not enough?
.
i understand that message, but then if it is not supported, why don't they remove it?
Because some people actually understand how to utilize this method
now, that tells everything
why doesn't it work 🥹
This is the same feeling when I code something and it doesn't works then I figure it out later haha
Create a replicatable bug or else we cant help you
i used the exact code that you sent me. you say it works for you but it doesn't work for me
Then create a sample which doesnt work for me
Create a clean plugin. Create a clean server. Only add this one listener to your plugin and then test it out in a clean environment.
I can screen share it
Create a clean plugin. Create a clean server. Only add this one listener to your plugin and then test it out in a clean environment.
the server has no plugins other than this one and i already told you that none of my listeners can even effect the problem
do it anyway
Ok here is the only help anyone can give you with this:
Create a clean plugin. Create a clean server. Only add this one listener to your plugin and then test it out in a clean environment.
It's saying error on the material id but im using 1.19???
This is correct for 1.19 no??
@lost matrix Ok idk what i did but it does open it now. the only problem is that it does not save the inventory after i close it which mean that i can take stuff out and it would still be in the shulker box. you have any ideas?
don't use legacy materials
There legacy
it's not java edition
what do i use instead?
GRAY_STAINED_GLASS_PANE
hmm im confused bcos i didnt type legacy
Yes. You need to listen for the InventoryCloseEvent and update the BlockStateMeta
idk how
im confused
why do you have switch if all the options are the same
ok, still. why are all the 4 things the same
Its a gui...
ok
Why is it making it legacy I don't understand
legacy materials = didn;t include an API version in your plugin.yml
Hi, I am working on a plugin that stores a lot of data, and I saw in the papermc changelogs that yaml files are default limited to 3mb because of an "upstream commit". I was wondering if that commit is from spigot (or if spigot shares the same upstream commit)
spigot does also have said limit
the original plan was to leave the option for YML as a legacy feature, but if the size limit also applies to spigot I would need to remove yml entirely in 1.19+
3mb? Paper changed the default to 64 because of YML misuse but I'm assuming spigot does not change it
if you have a 3MB yaml file, its time to use a database
especially if you are making the plugin now
My thoughts exactly but this plugin has been around since pre 1.12 so I'm just a maintainer
Was the limit introduced in 1.19 or has it been around for a while?
it was less that spigot introduced it and more that they bumped the version of a lib
as snakeyml had a vuln
Okay thank you guys
i feel like this is a recurring theme...
well
their 1.32 also had bugs 😂
paper's limit increase didn't even work
until like just now
not because of paper just snakeyml being dumb
Me and the other maintainer already wanted to phase out yml in favor of SQLite, and if there's a 3mb limit in 1.19 now seems like the opportune time to drop yml support entirely
If you guys don't know this answer that's fine, but is there a way to increase the size limit in code or is it hard set by the API?
time for spigot to bring back the plugin beans ORM database
It would be nice be able to do the migration in 1.19 instead of making the user downgrade their version to migrate the data
I mean, paper fixes it
so that should be most of your userbase I presume
but the value is sadly hardcoded
if spigot updates to 1.33 snakeyml you can fix it with reflection (or potential API)
Okay so I'll just put a really big warning on the download that says MIGRATE BEFORE YOU UOGRADE
fix and reflection don’t usually go together lol
you can watch this issue for spigot
I have a love hate relationship with reflection
Well, the issue suggests API or increase in the limit
I am certain one of the things will happen
as enough plugins use yaml like that sadly
so spigot should get a few reports here and there till its "fixed"
reminds me of that python thing the other day. they introduced a integer limit for the int() function
at least, i think it was limited to that
avrg python moment
Lol
Python moment
Well thanks for the info, I think we'll just drop yml support entirely for 1.19+
what is the plugin?
Signshop
Yeah some of the files are in excess of 50MB so a storage overhaul is well overdue
We're defaulting to SQLite going forward and I've always hated the YML implementation signshop uses it's really ugly
cough coreprotect 2.1GB cough
tbf it was a security vuln iirc
does anyone know what the client particle lifespan is?
looks like the minecraft demo world
wdym how?
Okay lets say I have 1000+ custom items, would it be better to always store them in a hashmap on memory or construct them from a file when needed?
I feel like while yes constructing them would take more power it wont waste as much memory
but idk how big an ItemStack is so I cant really say much
?
keep them in memory
unless you don't plan on all of them being used in the duration of the plugin
PreparedStatement.getResults() returning null
if then, then load the config into memory, and when needed load it then
at that time, keep it cached as an itemstack or whatever
i made a LazyValue<T> class which only loads stuff when needed
Well I mean I dont expect all 1000 items to be used at any given time
then load whatever file it is into memory (memory is cheap, i/o is not)
then parse once needed, keep cached
now the only time that doesn't hold true is if your file is literally gigabytes large
is it?
Uh I dont think so
then yes do what I suggested xd
Okay okay
so
instead of loading everything at the start
i'd just laod the items as theyre asked for
what's the context in which they're asked for
like how does that work
as in, what event prompts you to load the items
well
All custom items are already gotten from a method
so I can just add a check to see if that item with that id isnt loaded
load it and then give it back
that is not what I asked
an item being required..?
my only problem with loading them at the time they're requesting is the small amount of processing time it'll take to parse the content
whatever, just do as I said, I'm sure it's fine
but regardless, even 1,000 itemstacks in memory is likely quite handleable
I don't know what your plugin is and you don't seem to want to elaborate given your answers, so just choose either; they're both fine
loading them at load time would increase the time it takes for the server to start, loading them at "an item being required"-time is negligible given it's only 1 at a time and the file is already in memory
make sure your file is in either yml or json objects when loaded into memory, definitely do not parse it over and over again each time it's required
How can i fix this error:
org.bukkit.command.CommandException: Unhandled exception executing command 'malatiadicacca' in plugin Diarrea|
v1.0 |
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.2.jar:git-Paper-162|
0] |
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-P|
aper-1620] |
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2|
.jar:git-Paper-1620] |
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched|
_1.12.2.jar:git-Paper-1620] |
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:|
git-Paper-1620] |
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:gi|
t-Paper-1620] |
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git
-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtil```
s.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git
-Paper-1620]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git
-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git
-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:g
it-Paper-1620]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at me.gurwi.commands.DiarreaCommand.onCommand(DiarreaCommand.java:28) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-Paper-162
0]
... 15 more```
so 1st off format it properly or use ?paste
2nd ly it says right there
DiarreaCommand line 28
ur telling it to fetch a value it doesnt have
?whereami
Any help? Posted on a thread: https://discord.com/channels/690411863766466590/1024027755039440938
hey does anyone know why minecraft doesn't autocomplete with large data sets?
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if(args.length == 1) {
ArrayList<String> possibleArgs = new ArrayList<>();
possibleArgs.add("set");
possibleArgs.add("remove");
return possibleArgs;
} else if(args.length == 2 && args[0].equals("set")) {
ArrayList<String> stringParticles = new ArrayList<>();
for(Particle particle : Particle.values()) {
stringParticles.add("minecraft:" + particle.toString());
}
return stringParticles;
} else {
return new ArrayList<>();
}
}```
I'm returning all of the particles in the game but the game doesn't seem to autocomplete when I type stuff (It still shows all of the particles as arguments tho)
return Arrays.asList hehe
You have to use StringUtils.copyPartialMatches() for it to return the ones that match whatever you're typing
i love that method
Otherwise I think it just always suggests all of them no matter what you're typing
I'll try
works great thanks man
👌
is there anyway to have a string list in a pdc
no, not directly. you can use a byte array though
what most plugins do though is something along the lines of String.join("\n", List) though, and then #split on the way out. which may or may not work for what you want.
Do you guys have any fancy portfolio to take inspiration?
I just look at 7smile7's code until I feel sad
the best way to spend an evening
worst way to spend 5 minutes
That's the way I feel when I look at any of you people's code
Makes me feel like a dumbass 
yo illusion
could you give me an opinion about my portfolio design? maybe in dm
please
Hi how are you people?
Im again fucking up haha
I would like to learn if its possible to catch the netty instance from the spigot
could you elaborate on what you mean by "catch the netty instance from the spigot"? what are you trying to do and how would you define success?
Im looking a way to get the spigot netty instance
I ask it because im on holidays and i need to relax a bit
What for?
I will do some hacky things
Its for a self Project
I just need to know if posible or not?
Generally tho ServerConnectionListener
holds the channel futures and connections
I presume that is what you mean with "netty instance from spigot"
you can also use ChannelInitializeListener for a less hacky solution
Hmn
oh that is paper only though, sorry. won't work on spigot.
is it fine if i use a Location object as key for a hashmap?
How you are going to use it
What is the map for
a map of invisible armor stands, using its location as key
floating text basically
Why would you need to store them within a location ?
Why not the entity
Are you ever going to fetch then by there location ?
i want to be able to toggle setCustomNameVisible at will, and i can do that after i spawn the armor stand of course, and store it somehow
but then, after i restart the server, i need to get that entity object again somehow, right?
Spawn a new one
so i guess i will get those entities objects again on an entity load event or someting
i'd rather go for a List of entities or Armorstands
but i will need to delete the previous one
Exactly
Or just add a PDC to the entities to mark them as holograms
Thats why you shouldnt do holograms with entities
You can do the pdc thing and load them from world getentities or something
Packets
I'd rather work with packets in that case. No need to worry about the entity
mm and how do i do that
👍
store the UUID
No need
You have to send packets not listen
for what?
and how do i do that, i dont really know much about the spigot api
UUID gets you the entity everytime
entities have UUID's because it comes from NMS
i tried doing that, but then i read that its not reliable, idk why
spigot API isn't what gives entities UUID's
I was not replying to you
oh ok
It was to this
well, its for a specific location and a single use on my server, so i will just create entities
the only time a UUID isn't reliable is if the entity gets removed, they don't magically get new ones unless they die and get respawned
but then i need to fetch those entities again somehow on each server startup
Store the uuids
can i use World#getEntities for that?
Why not
you can store the location of the entity too
you need the location so you can load the chunk
use the UUID to fetch the entity there
because i read in the spigot forum that sometimes it doesnt return all the entities
maybe that was fixed long time ago
Yes cause chunks
not sure what you been reading o.O
I'm trying to prevent players from removing items from a GUI but cancelling InventoryClickEvent sometimes doesn't work and they can move the items out of the GUI. Any ideas?
Ghost items?
Nope they're real
Errors?
None
Inventories are scary... debug
so, i can just do World#getEntities and look for the one with the same uuid? or should i get the chunk first?
the best way to deal with these things is to have a task running while they have an inventory opened and then constantly checking both inventories have not changed
i mean, isnt it expensive to get all entities in a world?
it will only get entities of currently loaded chunks
well, then thats the problem
You will stop caring about these stuff as you learn more
but I told you to just store the location of the entity so you can load the chunk at will
there will be no chunks loaded when starting the server
Then load it
you can't interact with entities in unloaded chunks anyways
right, and just by getting the chunk it will be loaded?
Yeah ig
there is methods in the API where you can stick the location into it and it will load the chunk
and then instead of searching the chunk of entities, you just use the method to of getEntity() and stick its UUID in that
now you have your entity object
ok i will do that then, thanks
idk
Accidently sent it
Before I was finished
How can I Make spigot mc api load a Java class from something that isn’t related to Minecraft
Ohhh
but you only need a classloader if the classes weren't loaded before
Because I wanta run something that isn’t mc related
Aka doesn’t effect the mc server but loads with the plug-in folder
Ah, yeah you can just easily make your own classloader
just keep in mind, the spigot API will not be exposed to that thing
How would I make the class loader work with spigot mc though
so if you need that thing to access spigot API, your plugin will need to expose it to that thing
it will just load it given there is no errors
but I am just informing about the API thing, because your classloader will prevent it from accessing classes from the parent classloader due to how hierarchy works
creeperz, you still have to figure out how to actually get the prebot jar lol
what
ok
most likely, inside a jar
I’ll look at files
but wait.. what jar?
it's not supposed to be hosted on a personal computer
Still should be supported
let's move from here please
why
it is, i think the windows file works
intelliJ
