#help-development
1 messages · Page 948 of 1
What's it add
u dont know create?
Automation system based off rotational force
well last time I used unsafe it was to replace the bukkit unsafe, so not exactly something Mojang related
You unsafed the unsafe
Sounds unsafe
I wonder if there's anything spigot related I haven't injected into yet
I think I gotta do world manager next
injecting stuff... you should call yourself ImInfusion
💉
Given my way of naming stuff i'd prob just call it "WorldManager"
Boring
mf never taken a look at my big projects
It goes something like this
SkyblockCore
University
Tutorial
Zombies
Tycoon
MinigameDemo
I'm really lame when it comes to naming stuff
call me crackhead the way I be injecting
Tbf my stuff doesn’t really get fancy names either
My server core is called ServerCore
what holograms pl yall recommend?
incredible
And the first game I’m working on using it is called TowerDefense
question, how did you make it green when it was on the floor, is it just checking one block below all the minimum y coord blocks?
IllusionSkyblock
Probably
Check that the contents are all air and the below blocks are all solid
the masculine urge to forget everything I know and quit is starting to hit
I know you can use CustomModelData to make custom item textures and such is there any way to do that with mobs? Like if I want a few different textures for withers based off the name or something is that possible?
Hello, who knows how to create databases in vps for luckperms?
can't wait for some loser to emulate all kinds of animations with display entities
One I'm looking at is chest open
ATM MMCI only applies a model to the chest base, what if we could replicate the lid animation perfectly
Would this be something that would be in the texture pack or would it need to have a change on the optifine config itself
Texture pack
Ok that works I guess
Probably not too hard
Do a little subverting of expectations
Have the lid yeet into space
Offset betterer
yeyeye block corner whatever
my idea was to make this a little bit bigger and use like item displays or something to render a 3d model
I would just make a blockbench model and run those animations directly
well yeah but I want to do it with like 2 display entities
And?
I can't bother learning what a model is
Lol
I just need it to be simple
Lol
That’s correct
You may need to set the delay as well
Also you can’t do it the same tick it spawns
it’s quite basic
is the delay in ticks or ms?
oh cool it's opening mega slow
Ticks
surprisingly smooth
but why xD
I'm gon up the scale and apply a model
And then sync up the animation with the client
So the chest has a model
The one thing I don't like is that the real chest lid is slightly buried in the base
And so the rotation point is a bit different
And things overlap
Now send the lid to space
lmao
Shrink the lid by a tiny amount
cant that be fixed by making the lid a fraction bigger?
won't look great
It won’t even be visible
what will this be ?
You can have very fine scaling with display entities
Try a bit more
can't I fix this by just making the line on the overlapping part the same color
Idk, maybe
Ah Z-fighting, a programmer's arch nemesis
and looks noticeable
I doubt it would look ugly, doesn't it make sense for a box to be smaller than the lid
I think I need to shift it all a lil bit
to compensate
because one side looks good
Welp now I gotta try this with my model framework
Are you going to apply the normal chest texture back at the end?
I'll apply custom textures
This is so we can have like 20 different chest textures
Ah, cause if it's supposed to look like a normal chest I understand you don't want the lid to be bigger
Omg chests for each wood type confirmed
sumn like that
new minecraft update!
solid 95% chance I'll just use this in the minigame network and fuck off
the guys wanted models for each chest on the map
So you could see a purple chest and run for it
bro wanted an ender chest without the ender
ah that's cool
why is it z-fighting but only in this side
did u expand it on all sides?
yea
hm
wonky ass constants
dividing by 2 fixed it
interesting
It's only slightly noticeable if you look for it
looks good
smh didnt they teach u to always simplify ur fractions.. 7/8 instead of 14/16 😤
probably just some wonky math thing
this is really wonk
how noticitable is it now?
That is nigh unnoticable
Though I do wonder what happens with floating point inaccuracies
um
lmfao
How
something about that one face
maybe this?
How to support iridescent colors in the scoreboard using a mini message
protected void setLines(String @NotNull ... scoreLines) {
for (int i = 0; i < scoreLines.length; i++) {
final MiniMessage miniMessage = MiniMessage.miniMessage();
final String serialize = miniMessage.serialize(Component.text(scoreLines[i]));
this.objective.getScore(serialize).setScore(i);
}
}
protected void createScoreboard() {
super.setLines(
"&6Name: ",// No color!
"§6Rank: ", // Yes color
ChatColor.BLUE.toString(),
"<gold>Death: ", // No color!
"Kills: ",
ChatColor.RED.toString(),
"mc.ImFoxter.com"
);
}
No
Scorboard this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
you need to use deserialize to turn MiniMessage into components
and then turn that into legacy strings with the LegacyComponentSerializer
Interesting
It seems like this only happens around 0, 0
aka when crossing between negative and positive coordinates
nvm it's when crossing between chunks
okay wtf
how use ?
classic mojangk
create an instance of it
private LegacyComponentSerializer legacySerializer =
LegacyComponentSerializer
.builder()
.hexColors()
.useUnusualXRepeatedCharacterHexFormat()
.build();
```(or sth like that)
and then use it
```java
String legacyString = legacySerializer.serialize(MiniMessage.deserialize("<red>My MiniMessage text")); // The result is now a §cLegacyFormattedText
it's actually just when facing west not even chunks
Seems like the chest opening animation lasts 5 ticks
Now I just need to sync this up to an actual chest
and up the scale
this is starting to get messy
Needs more Matrix4f
matrix 1 came out today, 25 years ago
useUnusualXRepeatedCharacterHexFormat 😞
scoreboard is weird with no space for numbers
An interesting feature nonetheless
I wonder if you could put a dynamic texture on it?
The scoreboard or the chest?
Yeah it is
You can mess with that via shaders tho
Or just slap a large font texture over it
it is
Anyone know how to store persistent data types in NBTs?
oops I meant entities lmao
went brain dead when typing
what are https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java#44 and https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java#44?
why are you just rando casting
im guessing its always going to be translateable
Because it can be blindly casted
.............
I can do instaceof but it'll always be true
when would the description contents not be a component contens
datapacks can make custom ones, and they define whatever component they want
Then that violates the api contract and needs to be fixed make an issue on jira
You had plenty of time to review it before it was merged too. I'd reccomend doing that in the future 😉
It sat in queue for a week or two
lol wtf
I have to review PRs? thats what a whole community is for
now if the whole community could seeeeee the PRs it'd be better
but no, its impossible for that to happen
wow its almost as if bit bucket doesnt support that
cause they don't have an api that you can use to write custom actions to auto close PRs from people who havent signed the CLA
github doesn't natively support that either, doesn't stop people from making use of that kind of functionality
This isn't a me problem either way ypu found an issue report it it'll be fixed
Gap in my knowledge let something slip through whatever shit happens. I'll fix it when I get a chance
PDC already stoee in entities
I try to hide the nametag of an entity its not visible when im not looking at it but it gets visible when I directly look at it: ```java
public class CustomZombie extends Zombie {
public CustomZombie(Location spawnLocation, int id) {
super(EntityType.ZOMBIE, ((CraftWorld) Bukkit.getWorld("roguelike")).getHandle());
Level level = ((CraftWorld) Bukkit.getWorld("roguelike")).getHandle();
this.setPos(spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ());
this.setId(id);
this.setCustomName(Component.nullToEmpty("NORMAL_ZOMBIE"));
this.setCustomNameVisible(false);
level.addFreshEntity(this);
}
}```
That's how CustomNameVisible is meant to work
^
Why don't you use pdc instead?
You can hide it by giving the entity a passenger tho
But yeah don’t use the name to identify things
hmm okay, do you have an example for a pdc for an entity?
?pdc
hmm thx! so I add the meta data after creating the entity?
Ah ㅜㅜ
Just access the internal container directly
is the container this.entityData?
idk, use the API?
the api has no function to edit the meta data
you sure?
Is there no way to get a map from a configuation section?
There is Config.getMapList but no Config.getMap
A configuration section is just a glorified map wrapper
What you can do is get a section and call getValues
Would that work for something like this?
Is that valid yml
Yea
How would you store a Map with an input material check and an output material
Remove the second "-"
You know you can just get rid of the -'s and parse it as a section right
I guess
Thats actually a good idea
Ill try to get it to work
kinda, at least I cant find anything online
Ok, so you are trying to hide the nametag on an entity and only show it when a player directly looks at the hitbox of this entity, right?
that's exactly how customnamevisible set to false works lol
Im just wondering what all those "use a pdc" and "cant change the metadata" talking was about...
I dont get how i cannot turn off pvp in towny, i have tried to turn off pvp on all plugins even the server, and when i do /t toggle pvp and it says NO pvp its still pvp and we can attack eachother
Hmm. Doesnt sound like a problem for the development channel. 
tried /tw toggle ?
by default towny has pvp disabled
oh look at that, the local towny expert is here
I am sure ElgarL can help with the towny XD
No clue 😛
I doubt that. He has probably never heard of that plugin.
but didn't you maintain towny at one point?
i mean, i want it to be pvp outside your town in towny
yes 🙂
But tw toggle is disabling it globally
no
that is what i want but they should not be able to pvp in their town
I want it to be a safe place
then have it enable for world, but disabled for town
is it possible to use conditions for tab completion in the plugin.yml?
You mean for suggesting the command itself?
you /tw toggle pvp
then /t toggle pvp
one is world, other is town
you can set teh default for new towns in the config
suggesting params
based on say permission nodes
or options
This is done in the tab completer implementation for your command.
In what category? @eternal oxide
which means i need to inherit BukkitCommand and override it and then inject it into the command map with reflection?
in which case i dont have to use the plugin.yml at all?
No you can just create a class, let it implement TabCompleter and then register it on your command as usual.
huh
global town settings
so i declare the command in the plugin.yml and implement everything else but the command name programatically?
aliases etc
incl tab complete
i just realised that this system is basically using lambdas
hmm
I wonder if TabCompleter and CommandExecutor have the FunctionalInterface annotation
I do find alot of pvp stuff but im not sure which one it is xd @eternal oxide
Ah yes. Always wanted to define my commands as
command.setExecutor((sender, command, label, args) -> {
});
Because that surely sounds clean /s
But yes, you could
well, that does look pretty good, I know a few people who prefer having one class for defining all the shit instead of seperating it into several classes ¯_(ツ)_/¯

I prefer separate classes because it makes it easier to find the command you are looking for
I agree
I prefer putting all my commands into 1 on command method using an amalgamation of if statements to know what command it is
I prefer using a random number generator and hoping it works
sometimes i just return and hope the solar flares will flip enough bits to make it work
bogo commandExecutor
Hey, I am making a plugin that has a afk system, like if you don't move in 2 minutes you will get a message like "You are AFK!" or so. Also the online_time and the afk_time should be saved in a mySql db. How would I do this?
When a player joins:
- Load everything into a Manager (in memory)
While the player is online: - Use a Manager and leave everything in memory
When a player quits: - Save everything back to your DB
Optional:
- Periodically backup your manager. Every 15mins should be ok.
alright, I'll try that!
when will the api feature persistent pathfindergoals
isnt the ```java
PlayerMoveEvent
i feel like whenever i use it even for small operations its causing massive load
yea
so u need to be carefull what u do inside it
even that is overhead in itself
and i get lag even when i just prevent players from moving
by cancelling it
like if u rlly need to use for for player movement u should check if the player actually moved
cuz its also spammed by mouse movement
unless u want to prevent rotation
well it used to be quite the event back when reflection invocations were considered costly
What should I put into the db? System.currentTimeMillis() - LastTimeFromDb?
how change my nick in spigotMc
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
what the stuped rule..
Kek
Mans gotta make money somehow
yup
Hi, I am trying to create a plugin where every time a player joins a "PlayerCount" plugin message is sent through BungeeCord for each server, and is listened to, where the player count is updated in a hashmap. This is my code:
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("PlayerCount");
out.writeUTF(server);
p.sendPluginMessage(MythofyHubMisc.INSTANCE, "BungeeCord", out.toByteArray());
@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if (!channel.equals("BungeeCord")) {
return;
}
ByteArrayDataInput in = ByteStreams.newDataInput(message);
String subchannel = in.readUTF();
if (subchannel.equals("PlayerCount")) {
String server = in.readUTF();
int count = in.readInt();
serverPlayerCount.put(server, count);
Bukkit.broadcastMessage(server + count);
}
}
I am registering the plugin channels like this in onEnable.
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
Unfortunately, the message that is supposed to be broadcast in the plugin message recieved function is not being broadcast. Any help would be appreciated
I have made a scoreboard system but it only shows it to one person its not global (well the prefixes for tab arent)
Why is RGB color not supported in my scoreboard?
https://imgur.com/a/wpbZW3U
protected void setLines(String @NotNull ... scoreLines) {
for (int i = 0; i < scoreLines.length; i++) {
final String serialize = LegacyComponentSerializer.builder().hexColors()
.useUnusualXRepeatedCharacterHexFormat().build().serialize(Utils.parseColor(scoreLines[i]));
this.objective.getScore(serialize).setScore(i);
}
}
I can't attach a screenshot here why
because you're not verified
?image
theres a command i forgot it
just use a website like imgur
I passed the verification, it said that it was passed, but I have no role and no opportunities
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
lol
it takes some time
Ok
Who knows what the problem is?
isnt the Test Scoreboard! text in rgb?
Yes, but for some reason he is not as he should be, but terrible
Is it possible to create a plugin loading system? There is an API that stores all the manager classes and I need 1 plugin to create them and everyone who uses it will get it after creating that class (no IDs or anything like that).
api -> creator -> users
just need to implement your own class loader
however you will need to expose api you want the plugins under yours to see
Does ItemSpawnEvent fire when other plugins spawn an item?
that is, do i need to create your own Loader system?
and api shold sort it right?
I'll try again
There is
- plugin api
- plugin that depends on the api and works with it
- a plugin that depends on the API but only performs some functions
we need to make sure that 3 does not depend on 2
That's why I wanted to create a plugin loading system
anyone know how to fix (i want the scoreboard to be player only but prefixes global)
and this all shold sorted like i write nums
why am i getting this error?
Not a JSON Object: null
Who knows what the problem is?
basically i made a nick plugin but when a bedrock player with a "." in their name joins i get that error, this is my code:
what version of Minecraft are you on?
ok, here's a clearer question: PlaceholderAPi has its own plugin loader, right?
i mean how plugins can use placeholders from another plugin without sort load system
Other plugins hook in to PlaceholderAPI
PlaceholderAPI is loaded first
but yes they do have an extension system too
Is it possible to save inside the api those objects that are not in the api but are available to those who use it?
Hey, If I'm trying to register tab complete can I still do it using refelection so I don't need to put into the plugin.yml can just use commandmap instead?
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args)
return false;
}```
what is the s variable?
i have never seen anyone use it
label
it's the alias that has been used to call the command iirc
that would the label if your command is called test you can do if(s.equalsIgnorecase("test") { test }
I still don't see anyone using it, people often use Command.getName().equalsIgnoreCase(String)
if i add permission: java.jshell.access to my command, do i still need to check if player has that permission or is it done automatically
its done automatically
opkay
How can I register tab complete command with command map
i have a linking.yml file, and when i add a value to it with a command it works and sends the value if i send it, but if i reload the file it doesn't delete it from linking.yml but it returns null when i send it
code: https://paste.md-5.net/figopejafu.java
error: https://paste.md-5.net/xoxoruceho.bash
what does your reload command look like?
essentially when a reload happens, you need to clear everything in memory and reload
it happens when i restart too
ok, then you are not doing something in onDisable()
but for reloading i just reload the config from main class instance
what should i add to it?
well you should be saving what you have in memory
and then in onEnable() loading everything
reloading is unique because not everything in the server nulls out
so you have to pretend some things did and just clear what you are holding and re-load it up as if onEnable() was invoked
what should i have to save it
just invoke the save for your yml file and then null out your class object for the handling
then re-initialized it
yeah, so you are holding LinkingManager somewhere right?
how should i null it if its not in that class
yea but it has its own instance
yeah, get rid of the instance
so if its a list
remove it from the list
then you just call new LinkingManager() and put that new instance in there instead
private static LinkingManager linkingManager;
... onEnable() {
linkingManager = new LinkingManager();
}
public static LinkingManager getLinkingManager() {
return linkingManager;
}```?
and in the disable i do linkingManager = null?
don't use static
well in onDisable() shouldn't need to do that since if that method is called your plugin is being disabled lol
should i remove that and call the getLinkingManager() using main class instance?
yeah you should be using DI for it
ight so what about the re-initizlizing? :)
check that your list for the object or however you are storing it is cleared out, if it is, use new LinkingManager()
and add that into the list
and you should be good to go
also, its never wise to use server reload, but it doesn't hurt to make your plugin compatible for it in case people use it
a bit of a nuisance when plugins don't and then need to restart because the plugin decided to go all crazy
uhm well sorry for being dumb im brain dead today and didn't really get the intizling part, sorry
well it will be no different then when your plugin starts
I guess you using static is the reason you were having issues
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
should probably learn a bit in how to hold instances of objects
your main class will never go away, so its a good base class to use to hold object instances that you don't want going away
such as your LinkingManager
either use a hashmap or a list to hold the instance
alright, but for the linkingManager = new LinkingManager() it required to make LinkingManager constructer public, would that cause any problems?
yeah, make the constructor public
for (Team team : Team.getTeams()) {
team.setPoints(0);
for (int i = 0; i < team.getKills() + 1; i++)
for (int j = 0; j < Main.getInstance().getConfiguration().getInt("team.points.kill") + 1; j++)
team.setPoints(team.getPoints() + 1);
for (int i = 0; i < team.getDeaths() + 1; i++)
for (int j = 0; j < Main.getInstance().getConfiguration().getInt("team.points.death") + 1; j++)
team.setPoints(team.getPoints() - 1);
if(team.getPoints() < 0)
team.setPoints(0);
}
How i can get the kills by point and death. and death by point and kills?
i dont know i to do it
How to configure simplevoicechat, no matter how I configure it, it doesn’t work
The time complexity of this isn't the best btw if you're using it a for a big server or a plugin for ppl to download. And I'm not really sure why you're using so many loops?
is for the recalculate the points if an admin want to restore it
so i have my plugin 1.20.1 "Spigot" im using a 1.20.1 paper server and im getting this error
org.bukkit.plugin.InvalidPluginExeption: Unsupported Api Version 1.20.1
yea but you're looping twice with i and j, but never use those values i.e. loop seems kind of pointless
is there any way to prevent Minecraft (or spigot not sure what is causing it) from grouping up arrows when they are further away from the player? it doesn't happen when another player is close to the turret.
example: https://youtu.be/RbY8vXTwyuo
how it should look like: https://youtu.be/-hqL6pR1xE8
ok
code?
the second video isn't unlisted or public
the grouping likely has to do with some server optimization
I highly doubt it has anything that you can do to prevent it
in the first video the server is lagging
pretty sure its not
in the first video you are lunch at row, not lile
it seems to me
does it work now?
yes
no lol
i can see it
idk what you did in that video
just showing how it should look like arrows flying by every tick
do an async while
what would change with that
the projectil lunch not every tick but like every 5 millisencod
pretty sure minecraft can only spawn projectiles every tick
you can't spawn entities asynchronously
true
asynchronous doesn't fix anything here
the grouping likely occurs because of a server optimization as I said earlier
so this is unavoidable
try it but not async and then see how optimize
asynchronous != optimization 100% of the time
asynchronous processing here is useless
org.bukkit.plugin.InvalidPluginExeption: Cannot find main class 'My.Plugin'
Can anyone help with this?
is there a way to "pretend" a player is close to it?
you need to learn java that isn't your class path
_ no clue
@supple topaz how you have do the second video
put a player close to the turret
that was a example
org.bukkit.plugin.InvalidPluginExeption: Cannot find main class 'main.java.Speed.SpeedKillPlugin'
give the actual problem then?
aaaa
Increases the entity's range
this classpath doesn't mkae sense first off you're breaking naming conventions with the package name Speed main.java is not a package its where your source lives in a project and is completely detached from java classpath
@supple topaz
so like
.
so like you need to learn what packages are
tf do i do
and do the package path to your main class
so?
gimme 5 mins
why would it be my simulation distance?
You just said earlier that it doesn't work well because you're further away, right?
just set my simulation distance to 20 and it still doesnt work
so if you go distant, it dont work
?
you're pointing out a bunch of non issues VedCodee.
- There is really only so much you can do without code
- If it is a server optimization there is nothing you can do
- I can't really see the "working" video so I myself am missing context
ill dm u
I don't accept Dms
ill try to reupload
He said all the things I need to understand.
I don't need the code
so my mainclass is in main\java\Speed\SpeedKillPlugin wouldn't it be main.java.speed.speedkillplugin
did you not read what I said before about main.java not being a package
that's where your source lives
has nothing to do with user packages
ohhh
can i just send u a friend request and remove u afterwards
Speed.SpeedKillPlugin it would be this?
sure but you're breaking naming conventions with your package name
what do i rename it
?conventions
if you don't have a domain something common is me.yourusernameinlowercasenonumbers
in your case me.hqgamingxd.myplugin or me.hqgamingxd
if you have a domain like i do you can do com.hqgamingxd only do this if you have a registered domain though me.myusername or com.github.myusername is the default otherwise
How can I make specific players break specific blocks faster?
That makes them break ALL blocks faster :(
true, true
Re-implement the mining system server side
ugh
(A lot easier once 1.20.5 comes out)
is something like that even possible
u would probbably have to do packet intercepting i guess?
Can you maybe give the tool a player is holding a better mining speed? (as long as its in his hand/inv)
yea cant u just change the mine speed anyway in 1.20.5 @young knoll ?
all my homies are hype for 1.20.5
pretty sure u can there
yaes
Yeah it's an attribute
but then i still can only change it in general and not for specific blocks :(
so its just haste 2.0
oh theres one for start? alr, yea then maybe that could be used
ah, then ill give him haste after that is triggered, that solves my question
can i give haste without it showing up?
i have this somehwere as well and thats how i do it as well Flo
i give haste when they begin breaking a block that has the speedup
ah ok
?paste
:d
then maybe giving the tool a higher mining speed would be better, as thats not instantly visible
just need to make sure he doesnt drop it .-. xD
™️
oh its not? wasn't such a feature introduced in the adventure update in like 2012 ?
oh nah maybe that was just for which blocks you can break with a tool.. oh
ok yeah, then haste it is
ah and armor/tools can give you invisible effects, thats a thing too
?
name: SpeedSMP
version: 1.0.0
main: Speed.SpeedKillPlugin
author: Hqgaming
description: A plugin that adds speed and slowness effects on kills and deaths, a death ban system, and a revive GUI.
api-version: 1.20
depend: [Vault]
this is my plugin.yml
nvm
was actually able to fix it by increasing entity-activation-range in spigot.yml lmao
fixed :D
W
options people should I make /warp set <name> with all commands starting with /warp or make seperate commands like /warp <name> /setwarp <name>?
Better to have one command with subcommands
Easier to use
You can add tab completion to your /warp command so that the users always know everything they can do
If you split it into multiple commands, you won't be able to do so
What
Il make it 1 command with sub commands then
Yes
Alright thank you, just wanted some opionions lol
how can i generate a strucutre? I cant find any information about that
like Structure.place(x, y) or something.
What structure
org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.lllegalPluginAccessException: Plugin attempted to register Speed.ReviveGUI@578f208b while not enabled
like a stronghold or a fortress
how do i fix this
your plugin is not enabled
and try to do something
Well, the file based structures can be spawned with https://hub.spigotmc.org/javadocs/spigot/org/bukkit/structure/Structure.html
But I don't think there is api to spawn the other ones
Hello everyone !
Is there any way to get this list of tags associated to a block ?
(Obtained with f3+h)
You can check if a specific material has a certain tag
Idk if you can get all tags from a material
Ah yes ? I didnt see a method for that in the javadoc
Tag.X.isTagged
Ty, I I think it's not the same type of "Tag"
?
I want to make a system that would spawn weapons with random statistic spread, would using PDC with key of statistic and value of its value (such us magic_damage:5) be a good idea?
Sure
Or is entity/weapon having up to 10 PDCs too much?
I take back what I said, thanks for the info.
Your server will tell you when it is too much
You would need a ton of data for that
Just the data in a single shulkerbox is already gonna be way more than a few stats
Yeah that's still nothing
unless you are storing like 3 maps of maps of itemstacks, should be fine lol
Not necessarily
data is pretty efficient nowadays
Intermediate project ideas anyone?
Minigames!
You call minigames intermediate D:
Depends on the game
I had tried with a sumo game before and ended up writing the whole thing backwards lol
Reverse engineering was not the goal for that project and I ended up just getting frustrated and scrapped it D:
Try following a tutorial to get the groundwork up and running. It’ll be challenging but improve the way you think about programming a lot 🙂
If you want something more straightforward, you could try some sort of custom enchantment plugin
Hmm I'm pretty confident with ce's, minigames not so much and I'm not sure I want to delve into that again, perhaps something to enhance quality of life... I just don't know what genre of server I'd want to cater to
Part of a minigame could even be a project in its own. Hypixel has that tnt run game, so you could try making command or an item you right click that makes entire world tnt run or something
Lol the whole world
You could make a way to save pets in case they ever get killed or lost so they can be recovered
For example, couple months ago had made a towny addon that prevents all types of townhopping while being configurable for certain events, messages, etc... I like the thought of this process... quality of life updates to other plugins or just the vanilla game I supppse
So when someone tames a pet or make changes to it, you save it in a database
Then have a command or GUI to spawn it back in
You just need some sort of offline storage
I'd assume ymal is fine? I have zip experience with sql
Yep that would also work
The only data I really need to save is just "type of pet" / "owner of said pet" right?
What if their pet has a custom name? You’ll need to figure out all the info that goes along with each pet, how to store that in persistent memory, retrieve it, and rebuild the mob from it. It’s probably all in the documentation though
But you could make a phase one that just does simple stuff like an owner and type to start
Custom name I'd rather assume is just vanilla nametag haha but yes that's something I'd have to include in the serialization
And version two gets more customized
I have no idea what the context is of entities you’re using, but make sure to logically include entities you can ride + log off with
If that’s needed
Sorry if that’s useless
Might be for phase 1 but def not further down the line
Do you think this would require a different serialization method?
Any chance I could have context on the project
It's hypothetical currently lol
This is the base idea
Save pets? As in spawn in a new entity?
Something like that, I guess you could say it's similar to a pokemon egg in the sense of "saving"
You’ll need to be careful of edge cases, do research on how entities can be saved, consider a user friendly UI—it’s got good components of an intermediate project
Work with persistent storage
Persistent storage is something I need practice with, not such as though a hard project, just practice ya know
Not really important but version?
I always just run latest
Depends on flexibility & usage, if it’s high volatility semi difficult
For the base, it's just going to include a method of "saving" eg: serialization, command/egg or wtv, and a way to get the saved mob from the serialized state
If this is a closed project, yaml. If this is a released project for your server, you want to learn sql. Not just for this project, but overall in general learning sql knowledge is very important to understand how data is really saved on a live server
Wym high volatility?
Lots of players
Number of players has no impact on complexity here
Nah not at all, but it’s good practice to involve the mindset a database is better than clear text
You’re completely right though
sql is something I want to learn, just get so busy irl... my father is actually really good with sql so if anything he can show me the basics... odd that I had never thought to learn some from him but I suppose I have a hard time trying to learn things I dont want to lol. I know sql is something I probably shouldn't put off especially since it's highly used when it comes to almost any worthwhile project
I think getting the project off ground comes first, and a phase two can always incorporate a database if it means getting phase one to the finish line 🙂
Honestly it’s all about what you are looking for. at the end of the day we can only give you our experiences and what we have learned
Truly, learn what you can and go off of your experiences
That’s what coooooding is all about
I'm looking for practice lol, the functionality of the project isn't really what I'm trying to develop rather my own experience
Great! This sounds like an interesting practice problem I love it
Hmm, if you’re having trouble with one aspect or module with a practice problem, back up and think how to properly digest the new information you’re attempting to run
Learn the car first before racing with it. Basically wtf I’m yapping about is, don’t just hop in a new car and go 100. Learn how it works before you go 100% and implement it everywhere
@Override
public Map<String, Object> serialize() {
Map<String, Object> serializedKit = new HashMap<>();
serializedKit.put("name", kitName);
serializedKit.put("cooldown", kitCooldown);
serializedKit.put("cost", kitCost);
serializedKit.put("permission", kitPermission);
List<Map<String, Object>> contentsSerialized = kitContents.stream()
.map(ItemStack::serialize)
.collect(Collectors.toList());
serializedKit.put("contents", contentsSerialized);
List<Map<String, Object>> effectsSerialized = kitEffects.stream()
.map(effect -> {
Map<String, Object> effectMap = new HashMap<>();
effectMap.put("type", effect.getType().getName());
effectMap.put("duration", effect.getDuration());
effectMap.put("amplifier", effect.getAmplifier());
return effectMap;
})
.collect(Collectors.toList());
serializedKit.put("effects", effectsSerialized);
return serializedKit;
}```
This is a serialization method I had made for a kits project, so I mean I have enough knowledge to persist data I want, just need some tips and tricks I suppose
That’s a big issue I created, and now my programming experience is mostly learning new methods and rewriting everything because I thought going fast was it
@fallow dragon ^^ look what he posted
That's just yaml serialization as well, so I mean it works it could just be better... possibly through sql or wtv else
Honestly I see no issues with your serialization
That's good to hear
Nice, seems like you have an idea of how you plan to store your pets. So now figure out how you can spawn a pet with that information 🙂
Basically, deserialize time
How do i check an OfflinePlayers permissions?
I know I've got that method somewhere in the kits project...
Anyone know how to disable entity collision for players? #setCollidable seems to work for animals but not players.
World world = nl.getLoad_location().getWorld();
Slime s = (Slime) world.spawnEntity(nl.getLoad_location(), EntityType.SLIME);
s.setInvulnerable(true);
s.setCollidable(false);
s.setAI(false);
s.setGravity(false);
s.setRemoveWhenFarAway(false);
s.setSize(5);
Use scoreboard teams
Also I'd like to give you both props @fallow dragon @lament tree, you two are probably the nicest I've ran into / seen on spigot for a while
That's not to say no one else is kind/helpful, it's just a nice change of pace to see once in a while... especially here in spigot
.
Last time I used this it was a collision rule
Player.SetCollisionRule?
Use a permission API, the spigot api doesn't offer this
LP I'm pretty sure has this
any keywords i could google to get to know apis like this?
LuckPerms
okay
Vault is a general one
Pex
LuckPerms if you are using luckperms
im using vault and lp, whats the easier one?
I'd argue lp
they have good dev support and a cookbook so you can p much just copy code
bro half my projects done by bard xD
Remember the days of pex
I remember the days of pex as an operator kek
The fact that pex sucks compared to almost any other permissions plugin
Devs prob quit early
Tends to happen to me a lot
Yk I hate the fact I can't get a paper application at any job no more
Well after 2019 everyone became less adamant about going online
So I think phase 1: Is going to include a "capture egg" (for now 100% success rate), method of serialization when the pet is egged, when the egg is rethrown de-serialize and spawn the pet again
Phase 2: Optimization / extra implementation
Why not test out nbt data if it’s an egg in your item
Never touched nbt... don't laugh... how would I go about that?
?pdc
Oh nbt is apart of pdc
Oh the tags
yes
So I actually never went through pdc lol, I still need a serialization method? Or pdc handles all persistence needed?
I need to stop smoking before I write D:
Nah once you smoke some more (seriously pack the bowl buddy) you’ll get creative while you read up
@worthy yarrow ^^
I wish I could, but the purple stuff has ran out... we're down to the texas legal pens atm D:
Also when it comes to my capture egg and pdc,
ItemStack itemStack = ...;
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.getCustomTagContainer().setCustomTag(key, ItemTagType.DOUBLE, Math.PI);
itemStack.setItemMeta(itemMeta);
...
ItemStack itemStack = ...;
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
ItemMeta itemMeta = itemStack.getItemMeta();
CustomItemTagContainer tagContainer = itemMeta.getCustomTagContainer();
if(tagContainer.hasCustomTag(key , ItemTagType.DOUBLE)) {
double foundValue = tagContainer.getCustomTag(key, ItemTagType.DOUBLE);
}
So everytime I need to access my egg, I need a new itemstack and just check for the key?
Crazy
Yea you could do that
it's not my code lol, the snippets from the link... is there a better way? Perhaps just a static constant of my egg?
Yea it depends on the usage, but you could also just add a CustomModelId for that
this.itemMeta.setCustomModelData(customModelData);
Well the base egg has one usage: capture mobs, it doesn't require any additional data until a mob is captured
Should do the job as well
“Every time you want to access or modify this data, you'll need to retrieve the item stack, get its item meta, and then access the custom tag container” found this in the docs
If you wanna store the mob type after you should use a custom tag container
I'm trying to find a better way though cuz that is buns
Just do then getItemMeta().setCustomModelData(int)
Alright
I'm trying to import nms but this error happened when compiling with buildtools:
If this not resolve your issue please pastebinthe entire BuildTools.log.txt file when seeking support
I think it is the java version 1s
Lol
Did you correctly login to spigot when downloading
you dont have to login for buildtools
?
oh wait, buildtools was using java 8
1.12.2 doesnt support java 16
Is there any way to do it without disabling player player collision?
highest it supports is 11
does tilestate PDC get deleted when the block is removed?
iirc yeah
run buildtools in a clean folder with nothing else in
doing that
didn't work
arent you supposed to use git bash instead of cmd?
Old versions don't like default gpg signing enabled
Edit your git config or upgrade to a supported version
Or just fix your gpg config
hello! I have question - what is the best option to check if some player has item in his inventory - if yes then add him potions effect, when he drop it or left it in the chest all effects clear, I mean something like talisman. The only question that I have is to do a task, but what would be the best option, please give me some advice guys 😄
Depends. Does it have to be in a specific slot?
"drop it or left it" i think it's in a specific slot
why do you need to know the best option? This implies you already know a way of doing this
yes, second hand
In that case i would definitely just check the slot every 20 ticks and apply an effect lasting for 21 ticks.
okay, thanks!
Btw i would schedule this in buckets.
So dont check every player in the same tick, but create N buckets, evenly distribute the players into buckets, and then tick one bucket every tick.
what is buckets?
If its 20 ticks then 20 buckets make sense.
a little flaw with this
for a small server probably fine though
maybe we should see if they spot it at some point
not like its difficult to correct anyways
and the second question, what would be better? create one task that loop every players in hashmap, and remove them when they drop this item or just create new task dedicated only for one player?
One task which ticks all players
I never randomly start repeating tasks on runtime.
Always start them when the server starts.
okay, thanks
probably could just start it when there is players
makes no sense to have a task running that is for players when players don't exist XD
But trying to optimize performance for the case no player is on the server makes sense? 🤨
be like minehut, turn your server off 5 minutes after theres no players online
I would just turn off the server instantly if only 1 player is on the server.
You need at least players queued up to even start it.
Man my brain is smooth
If a player transfers from server A to server B, how do I ensure the database write from A runs before B tries to read it
you can try to create a lock so the server b waits until server a had finished writing on server a
CAS, always do CAS
when player connects to server a it toggles a boolean, then when he leaves it turns it to false
then server b if he finds the toggle to be true he waits for the data to finish then starts loading
i'm sure there are better ways to do this
This is a problem i have faced quite a bit and there are different solutions i came up with.
The problem with Freestylers suggestion is:
The AsyncPlayerPreLoginEvent is fired even before the player disconnects from server A.
So locking in there simply prevents the player from being transferred iirc.
assuming you do the transfer on playerjoinevent it should be fine
but i think people have figured better way to ensure continuity
like allowing server b to use old data, but then correct the data when server a finishes unloading
or have a service separated from the server that handles all the data, and the servers are just clients to reading/changing the data
The new protocol in allows for fully synced server transfers
the minecraft protocol?
it would be so cool if you can embed information with the player as he transfers to a different server
you can
I havent really coded plugins for a long long time and came with an idea, but Im not sure if it would work the way Im intending to do it and want to ask just to be sure, so if I were to make a command that could spawn an item with X PDCs, I could just pass an argument as a dictionary?
it's called cookies
well, a dictionary as in Map<String, String>
There is no method in PDC which would allow that
couldnt you iterate over dictionary and add PDCs with said keys and values?
it would always be an integer that Im interested in
Im wondering how I can make the command structure
Could something like that work?
/giveitem <item> <name> <key1:value1>,<key2:value2>...
I'm initially thinking of using two different delimiters so that I could extract information with some string related commands
Sure
okay thats good information
But that’s sync
Plus you can’t stop the client from disconnecting
Object oriented
Transfer the data and notify the server when its done.
Only transfer the player afterwards.
This has the drawback that everything the player achieves in those few ticks during transfer simply gets discarded.
That works if I am controlling the transfer
But it’s theoretically possible the player can dc and then rejoin before the save can be completed
Block him in the async event while his data is transferred
True
Just gotta mark somewhere that the data is being transferred
How do the bigger networks handle this, they’ve got players changing servers all the time
Before they send the player to the target server they send the player's data so the target server can cache it
What about handling really fast rejoins
limbo
https://paste.md-5.net/xeherivosu.rb
For creating a custom PersistentDataType does this all look correct? I have been debugging this for awhile. I am trying to create ItemHandlers where the events for a specific item are being stored in the items PDC, and when the player right/left clicks it looks into the items PDC to figure out what to do.
I've narrowed it down to this, these 2 events do get triggered they do work, but when it goes to handle the event from the PDC it just does nothing and I don't get any errors.
The events from the PDC of the item just send messages to the player.
PlayerLeft(Right)ClickEvent are custom events, and they do get invoked correctly as well.
private fun handleItemEvent(item: ItemStack, event: Event) {
val handler = getItemHandler(item) ?: return
if (event is PlayerLeftClickEvent) {
handler.onPlayerLeftClick(event)
} else if (event is PlayerRightClickEvent) {
handler.onPlayerRightClick(event)
}
}
@EventHandler
fun onPlayerLeftClick(event: PlayerLeftClickEvent) {
val item = event.getPlayer().inventory.itemInMainHand
if (item.type != Material.AIR) handleItemEvent(item, event)
}
@EventHandler
fun onPlayerRightClick(event: PlayerRightClickEvent) {
val item = event.getPlayer().inventory.itemInMainHand
if (item.type != Material.AIR) handleItemEvent(item, event)
}
what is the average chunk generation speed per chunk?
yes but on an average well hardware
There's too many parameters to give you a general average
Depends on minecraft version, CPU speed, worker thread count, storage speed, etc
Also on OS, type of chunk (empty end chunks are faster than full overworld chunks obviously), load on the CPU from other applications (especially on VServers), load on the disk etc.
are 60-150ms rather slow or in the range of average?
with 4gb available ram, 6 core 3.6GHz under 30% load
Different core generations do different things
I can grab a 6 core cpu from 10 years ago and a 6 core today
IPC is different
ryzen 5 5500
is there a place i can find a specific spigot build
i am looking for a specific build
build 1656
I think you can try to use the --pull-request flag.
Build CraftBukkit or Spigot using Pull Requests.
The format is the repository (bukkit, craftbukkit, spigot) followed by a : followed by the pull request id. (Ex: --pull-request spigot:111)
Why do you need an exact build?
it is the version that has the protocol hack inside
Hey guys I am having an issue where I can type /help Citizens in MC and the log said: Below is a list of all Citizens commands - but there are no commands listed. I cannot use any command. Is this a known issue?
Do players still use 1.7 lmao?
yes
Mostly related to the plugin itself. You should seek for help in #help-server but most likely directly to the developers of the plugin.
Hey there @agile anvil !
if i want to be a backwards-compatible plugin, do i need to specify an older api version, or should i use the latest api version?
Hey how are you doing?
Normally you can just specify the newer api version. However in some case you need to specify an older one
Not bad just running around on a quest to find practice projects
How are you doing?
what would be considered "some cases"?
tbf anything pre 1.14 imo but there are still more cases
also rn im using org.spigotmc:spigot-api:1.12-R0.1-SNAPSHOT and intellij is telling me there are 3 cve's
For instance I recently had to reduce the api version because the RegionAccessor#spawn method changed the consumer in 1.20.2
It'd be incredibly niche to need previous api
Just use the latest one!
97% of the api is pretty much the same back to 1.8
Ahah that's nice 🙂 Any idea on what to try next?
(and I'm fine as always)
if i do that, am i gonna have to make sure that all of the methods im using exist in the older versions?
Kinda, but as mentionned by NuclearKat it's a really tiny niche
Something to do with more persistence practice, such as pdc, data to a flat file, etc
But if you prefer just stick to 1.12 API
Like i said, the api is pretty much the same
can i ignore the security vulnerabilities it's telling me about?
or will they exist in the plugin im creating?
found the build and modified the pom to remove overmapped plugin (the bs from wolverness) and the build is working, if you need it let me know
Yes because you are not compiling the actual code into your plugin. You are just using the interface.
However running the 1.12 server could bring those vulnerabilities
ah alr thank you
You have plenty of choice to practice that. So many choices that I can't even recommend something interesting to explore.
Didn't you make some kind of minigame or system like that? Maybe there is a way to improve a game by spawning entities that need pdc, or some kits that spawns entities/items
Tbf that project got scrapped when I got several comments saying I basically designed it backwards... I myself was having a really hard time navigating it and just ended the frustration lol, now I'm more leaning towards a dynamic / interactive kits plugin
Ahah it makes sense, but next time you will have to do that will seem way easier and you'll design it well Im sure
I love doing kits that's really pleasing to try many things and exploit the most feature you can!
- the latest versions offer so much more possibilities
I want to have some fun with custom models and correlate that into pdc as well
I need to get some good practice in with pdc tbf, I never really touched it until I knew about it like in january haha
You won't struggle long, it's pretty straightforward
?pdc
ItemStack itemStack = ...;
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
itemStack.setItemMeta(itemMeta);
In this example we stored the value of PI in the container instance, and by feeding the ItemMeta back into the ItemStack, we stored it even over a restart.
To now retrieve the stored value again we can use:
Code (Java):
ItemStack itemStack = ...;
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
ItemMeta itemMeta = itemStack.getItemMeta();
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
if(container.has(key , PersistentDataType.DOUBLE)) {
double foundValue = container.get(key, PersistentDataType.DOUBLE);
}
This was the goofy thing I saw on the thread, there must be better ways to get access to my custom wtv
Instead of needing a new itemStack every time
I was thinking of just some sort of static constant but I'm not sure
What do you mean about "new ItemStack" ?
Am I just dumb?
maybe
In the second bit where theres an itemstack is that a new itemstack would it be the one from the previous example
ie: the only change is the fact we declare a new data container
I don't think you're getting the idea
Yes of course. A new ItemStack won't have your pdc value
I don't think I am
Let's start by rephrasing the guide
And define a couple starting points
- ItemStacks, entities, tile entities, chunks etc can have persistent data containers
Yep got that bit
My issue is the application of said methods
Now, you can get the persistent data container for any of those types
And with a persistent data container you can get and modify values
Which are identified by a namespaced key
Have a type
And then a value of the given type
ie: persistentDataType.X
Correct
Yup got that as well
The intent is to set a value on a given persistent data container
For let's say, an item
Which associates that data with that given item
If you want to check if an item contains that given data (is special / whatever) you get that item's persistent data container and get your special value
If it's present, great
If it's not, then it doesn't match and we can just skip it
As it isn't "special"
The idea isn't to have the same itemstack instance all around, but rather to see if the item you marked initially is the item you're looking at
So persistence of data on said itemstack is initialized on plugin startup the first time it's ever loaded up? Then given the plugin is continuously present throughout restarts, that itemstack will maintain its data considering we have applied pdc principals to it?
The persistence of data on said itemstack is applied.. when you apply it
It's held by the server then not my plugin
It will persist across restarts as that's the design of it
Correct
Gotcha
All your plugin does is add an ID to it saying "Field 123 is of type String and contains the value "gangsta" "
And the server just goes "Right.."
hmmm
And if you grab an itemstack and ask "What's the value of field 123?" and it happens to be marked it'll say "gangsta"
ItemStack captureEgg = new ItemStack(Material.EGG);
NamespacedKey captureEggKey = new NamespacedKey(animalHouse, "capture_egg_key");
ItemMeta captureEggMeta = captureEgg.getItemMeta();
String captureEggName = animalHouse.getConfig().getString("c.nameofegg");
captureEggMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', captureEggName));
captureEggMeta.getPersistentDataContainer().set(captureEggKey, PersistentDataType.STRING, "CaptureEgg");
captureEgg.setItemMeta(captureEggMeta);```
Ok so I have applied pdc to this egg... correctly I hope
Sure
Projectile captureEgg = event.getEntity();
NamespacedKey captureEggKey = new NamespacedKey(animalHouse, "capture_egg_key");
PersistentDataContainer container = captureEgg.getPersistentDataContainer();
if (container.has(captureEggKey, PersistentDataType.STRING)){
String foundString = container.get(captureEggKey, PersistentDataType.STRING);
}
This was based on the example from the post, however I'm not sure how it's applied considering that I'm checking pdc from a projectile rather than an itemstack
Looks good
Well yeah that's the problem
You applied the key to the item not to the entity
You can try to see if the projectile is an egg and then getting the egg's item
let me have a look
Not sure about eggs but the PDC stays on thrown ender pearls when it was applied to the item stack before using it
@EventHandler(priority = EventPriority.HIGHEST)
public void onEggHit(ProjectileHitEvent event){
if (event.getHitEntity() == null){
Bukkit.getLogger().log(Level.WARNING, "Hit Entity Is Null!");
return;
}
Projectile captureEgg = event.getEntity();
if (!(captureEgg.getType() == (EntityType.EGG))){
return;
}
NamespacedKey captureEggKey = new NamespacedKey(animalHouse, "capture_egg_key");
PersistentDataContainer container = captureEgg.getPersistentDataContainer();
if (container.has(captureEggKey, PersistentDataType.STRING)){
String foundString = container.get(captureEggKey, PersistentDataType.STRING);
}
if (event.getHitEntity().getType() == (EntityType.SPIDER)){
event.setCancelled(true);
event.getHitEntity().remove();
Player player = (Player) event.getEntity().getShooter();
player.sendMessage(ChatColor.RED + "You have just captured a spider!");
}
}
Does this work?
The first clause is just uh previous testing ik that will spam a lot lol
You need to get the egg
