#help-development
1 messages · Page 1373 of 1
I might be misreading then lol. What version is your server?
1.7
You can't have glow then
yes u can
yes u can
how did hypixel do it
Hypixel is 1.8.8
yes hwatst he differnce
from 1.7 to 1.8? Alot lol
I assume they also use some packet tricks
no its not, its actually 1.7 running some 1.8 different thing
If you intend to run old versions, you are expected to support them yourself
Because 1.7.10 is https://howoldisminecraft1710.today/
spectator mode was added in 1.8 which was when the glowing effect was added right?
1.9
hm
how can i wget plugins from spigotmc.org?
why run 1.7 in the first place, I understand older versions for pvp but why not run 1.8 its the same thing in every way and is 100x better for development
wait nvm
people who say 1.7 & 1.8 is old: hoW OLD IS 1.7 LOOK HERE OMG
Okay
spectator has glowing its a packet
also, recommended way to hide ores?
1.7 oLD STfU LITTlE KId literally the whole pvp community uses it
Spectators are translucent
Cool, you still have to work things out yourself
no they dont :/ literally been in the com for years, I just told u 1.8 jar with support for 1.7 as its alot better for development and performance
you have no clue what you are talking about
fine ill get the 1.8 jar now how tf do i fix it
A lot of big servers run 1.8, but that does not mean it's anywhere near the most used version
Also those big servers can fix issues themselves
go get 1.16.5 and NoAttackCooldown
https://www.spigotmc.org/resources/no-attack-cooldown.19600/
not sure if it works on 1.16 tho, works on 1.9
no 1. noone uses 1.16.5 because of their weird animations
yes and no, for any pvp gamemode you wont catch ANYONE using a newer version then 1.8 but for minigames, smp, survival ect then yes
- its retarded and its a cpu shitter
i use 1.16 for pvp
what gm?
also "weird animations"?
ew people who use bstats DISGUSTING
im using spigot
like practice and stuff
o
idk i just have a survival server
yeah makes sens
im talking kitpvp, ffa, soup, practice, uhc ect
any smartasses who can help fix this on 1.8 and people who dont skid code
Doubt it
no, update to 1.16
I assume the process is the same as modifying the newer source
add a plugin for backwards support
So you want to be able to add glowing in 1.7 and 1.8?
ProtocolSupport is pretty good
@untold onyx I rarely tell people to use 1.16 unless its survival and stuff but its the only way to do it, from there you can just apply the effect and the game will do the rest
otherwise if ur doing practice or smth just use 1.8 and dont hhave it
People seem to think because most big servers run it that everyone runs it
I wouldn't go based off usage
Which just isn't how it works
apparently people still run bukkit
from my years if experience with practice and pvp servers all of them run 1.8
1.16 is perfect for survival and stuff
There isn't anything wrong with running it, you just need to be aware it contains issues and exploits fixed in newer versions
spigot is a fork of bukkit so you still are
but for pvp servers
And that you are very likely to not receive support from the spigot/paper/whatever devs
alot of people have custom forks
🤷
Some people are strange I guess
maybe they're doing testing
can any1 help me out? i have this error "could not pass event InventoryClickEvent" i cant use some guis. any fixes?
can we see your code
//Clear Chat
if(Conditions.cheatEntered("clearChat")){
Actions.displayChatMessageToAll(" ");
Actions.displayChatMessageToAll(" ");
Actions.displayChatMessageToAll(" ");
Actions.displayChatMessageToAll(" ");
Actions.displayChatMessageToAll(" ");
some nice old cold I found
that goes on for like 200 lines btw
@drowsy helm i saved it in that link how do i show u
paste the link in this chat
Loops aren’t real anyway
No i installed it
oh why post in this channel then lol
this is for fcoding
you'll have to message the plugin developer
you're fine lol
how do I get the inventory name when using InventoryClickEvent?
event.getView.getTitle
You should use the inventory view returned by openInventory
What's the best way to update a boss bar relatively quickly? As in every few ticks.
What I want is a boss bar that counts down when certain players are within a certain area, and gets removed when it gets to zero (and runs some code). Is this just done with a scheduler and state variables?
Bukkit.getOnlinePlayers().forEach(p -> p.getWorld().dropItem(p.getLocation(), new ItemStack(Material.ACACIA_BOAT, 1))); Doesn't work 😦
java.lang.IllegalStateException: Asynchronous entity add!
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.WorldServer.addEntity0(WorldServer.java:1238) ~[patched_1.15.2.jar:git-Paper-391]
at net.minecraft.server.v1_15_R1.WorldServer.addEntity(WorldServer.java:1175) ~[patched_1.15.2.jar:git-Paper-391]
at org.bukkit.craftbukkit.v1_15_R1.CraftWorld.dropItem(CraftWorld.java:735) ~[patched_1.15.2.jar:git-Paper-391]
at me.toto.main.utils.SpawnResources$1.lambda$run$0(SpawnResources.java:27) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) ~[?:?]
at me.toto.main.utils.SpawnResources$1.run(SpawnResources.java:27) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.15.2.jar:git-Paper-391]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-391]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-391]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]```
idk reallly what is problem
You are trying to drop items from an Async thread.
You can;t make changes to the world Async
how would i check if a livingentity was spawned by a mob spawner
You need to detect them on CreatureSpawnEvent ig.
Would anyone know why I can't import my Events class to register them into my main method? It was working fine 3 days ago when I was building everything however after I exported it and went back into the files it showed that I couldn't import them.
@ me in response please.
Bukkit.getPluginMamager().registerEvents(new ClassFile(), this);
Also try
Bukkit.getPluginMamager().registerEvents(new ClassFile(this), this);
Mamager
don't use new ClassFile(this) unless you have dependency injection, which I highly suggest you implement
I write it on phone
👀
Anime pfp, also was doing
getServer().getPluginManager().registerEvents(new ClassFile , this);
You don't register events like that, it has to be new ClassFile() not new ClassFile
May be without New
hello, sorry if this question is asked alot but where can i download the Spigot .jar/API for coding my own plugins?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?bt
You have to compile it yourself, since the DMCA it is no longer legal to redistribute spigot jars
Its default server core .jar
What
ah makes sense. Thank you @dusty herald
Althought, with Maven you can use the spigot's repository
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
You can use the API with maven or gradle, but for NMS you need to run buildtools
^
And for the jar itself, of course
this is the gradle I use for my project
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
}
group = 'io.github.jochyoua'
version = '1.0'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}```
dont judge
thats pretty small
i dont have that either
it adds my plugin.yml and does the maven so im ok
dont need anything else
The maven
Sounds like a bad 80s dance move
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'java'
}
apply plugin: 'java'
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven {
url "https://jitpack.io"
}
maven {
url "https://repo.codemc.io/repository/maven-public/"
}
maven {
url "https://papermc.io/repo/repository/maven-public/"
}
maven {
url "https://www.basinmc.org/nexus/repository/maven-releases/"
}
}
group = "net.thearcanebrony.essentialtools"
version = project.property("version")
sourceCompatibility = 1.14
sourceSets {
main {
java {
srcDirs = ["src/"]
}
resources {
srcDirs = ["src/"]
}
}
}
dependencies {
//compileOnly "org.yatopiamc:yatopia-api:1.16.5-R0.1-SNAPSHOT"
compileOnly "org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT"
compileOnly "com.github.MilkBowl:VaultAPI:1.7"
}
task copyToTestServer(type: Copy){
from 'build/libs/essentialtools-master.jar'
into 'D:/spigot test/plugins/'
}
task makeBukkitJar (type: Jar){
from 'build/classes/java/main/'
if(file('/.arcane').exists()){
logger.info("Copying to test server!")
dependsOn copyToTestServer
}
}
jar {
shouldRunAfter(build)
archivesBaseName = "EssentialTools"
dependsOn makeBukkitJar
}```
this is mine

@dusty herald
not like im including it as a dependency
im being sarcastic
just a leftover from when i was building against Yatopia lol
so it copies the plugin to a test server and runs it? 🤔
weird i usually just build to a file and run it manually
like set the target dest to a server
Having it copy to my server would be nice
I use maven but I could send you the config
But then I’d have to modify the build file when I upload it to git
well thats why im using a conditional task
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<outputFile>./server/plugins/${project.artifactId}.jar</outputFile>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>```
But then it will have no build file on git
Why can’t gradle extract the server location from my brain

my POM is a mess
Got enough dependencies?
no
thats nothign to do with paper
if i remove the paper repo it throws that
then you are not including the spigot repo
which one is that?
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
You don’t need to depend on bukkit
Yaah. Well paper repo should have it anyway
it does
anyways i replaced the paper repo with spigot
can anyone help me fix an xp duplication bug in my code?
?paste
gimme oen sec
i was gonna link on gitlab
current behavior: barely does mending items, somehow i still gain xp?
you are only picking up orbs in a single block
also its going to give you xp every time it finds an item that doesn;t need mending
Line 61 of your getLowest method is never going to be lower than the starting zero.
it shoudl be dl > du
currently its not doing mending at all. Not in your code.
huh
oh right, because damageable
oh yeah its working properly now
thanks
tho it seems to duplicate the xp?
increase teh range. you are probably picking up orbs in between your task running
or set the orb exp to zero before you remove, as the remove may not be instant.
Hello, i'm trying to put a custom model data to a gun in crackshot, but there is no field for that in the configs.. Do i need to use its api?
lets try that
I don't depend on bukkit 👀
didnt work
increase your pickup range
how to add a block with a Location var
i set the range to 1 block, didnt work
Location.setBlock ?
I can;t see it duplicating
I mean
like this
Location blockBreakd = e.getBlock().getLocation();
how can I place a block with this
you are setting the exp to zero, you are removing the orb and you only assign exp when there is nothing left to mend.
oh
blockBreakd.getBlock().setType(..)
getRepairAmount
public int getRepairAmount()
Get the amount the item is to be repaired. The default value is twice the value of the consumed experience orb or the remaining damage left on the item, whichever is smaller.
Returns:
how much damage will be repaired by the experience orb```
it seems it repairs 2 durability per exp
your code isn;t
you repair once, then you look for the most damage item again
if yoru item is still teh most damaged it repairs again
no?
depends how many orbs you pick up I guess
how to plant a carrot
im testing with an xp orb with value 1
add some debug and sysout when it performs a repair.
if youre setting it in the break event you probably want to cancel the event so it isnt just broken immediately
@EventHandler()
public void onBlockBreak(BlockBreakEvent e)
{
if (e.getBlock().getType().equals(Material.CARROTS))
{
Location blockBreakd = e.getBlock().getLocation();
System.out.println("trig");
int carrotsAmount = ThreadLocalRandom.current().nextInt(1, 5 + 1);
e.setDropItems(false);
ItemStack carrot = new ItemStack(Material.CARROT, carrotsAmount);
Player auth = e.getPlayer();
auth.getInventory().addItem(carrot);
blockBreakd.getBlock().setType(Material.CARROTS);
return;
}
i tried that
yes
but i want it to break
then replace it
but if i cancel the event, the carrot is not going to be break
like i want to "replant" carrot
replace it after the event with a scheduler then
no, schedule it one tick later
well I dont get it because 'break then replace instantly' is the same as 'not break at all'
no
in which case just cancel the event and drop the items yourself
if i cancel the event, the carrot will be at max growth
like
if i replant it, the carrot will not be at max growth
well cancel the event and set it to 0 growth
isnt there an api to set growth?
how can I set growth
isn't what i did on my code?
because when I'm breaking a carrot, it doesn't replant it or anything
here's my code
if you don;t cancel the event the block will break
It doesn;t matter what you set teh block to at teh end if you don't cancel. It will be overwritten
well, now its always giving me xp
okay ty it's working
how can I get the growth of a carrot
like know if it's at 100% or 10%
isnt there like a subclass of Block?
idk, for crops?
oh, cast BlockData to Ageable
bump
no idea what crackshot is
i'm not sure, it's still development
now it doesnt work at all
seriously?
now its always giving me the xp without repairing my items
I herd biden was gonna take away guns
yeah
i'm italian so idc lol
So you don;t get teh repaired message? add more debug
either you are getting an item that has no damage or null
duh, you changed your du variable to 99999
that shoudl be zero
They don't have a discord server bruh
oh right coz we inverted the check
not everything has a discord server
thankfully
itd be useful, sure, but a pain for people like me who are at the server limit
but famous plugins should
tfw it still doesnt work
Same here
variable is 0 now, still wont work
show code again
Is teleporting player to an unloaded chunks can cause issues? Or the chunk will be loaded on teleport?
causes errors
earlier tonight 7smile7 posted some code to load the chunk and then teleport the player. Search his name
His code was quite cleaver where it used a runnable to handle the teleport after teh chunk was loaded
Is it the teleporting players back to the lobby?
Ah okay, but unfortunately the method isn't exist in 1.12.2. addPluginChunkTicket and removePluginChunkTicket.
is there a way i can extend JavaPlugin when i already have implements CommandExecutor in my public final class?
im trying to make an essential commands plugin
and im trying to take an int from my config.yml file
but the getConfig(). doesnt work without JavaPlugin
you need to follow a tutorial on how to make plugins, especially as you seem a beginner with Java https://www.spigotmc.org/wiki/spigot-plugin-development/
do NOT do new Main
yeah not that
Elgar, so what's my best option here? for 1.12.2 plugin.
make a constructor(i think it's called in this way)
new Main *visibly cringes*
Ah alright, thanks anyways.
no its fine, itll be loaded when they TP
It will? I've generally seen teh teleport never happens or I thought it threw an error
/tppos etc obviously work
Alright then, thanks for that.
You need to pass your main class instance or pass the config.
md_5 do you bother with takedowns of spigot on github? I got a notification yesterday when someone uploaded the full spigot
Main plugin;
public [Yourclassname](Main pl){
plugin = pl;
}
sth like that
I doubt md_5 would do that, mans doesn't have the time
obviously if you named the main class "Main"
why not
MainClass plugin;
public NotSoMainClass(MainClass plugin){
this.plugin = plugin;
}
same thing
no
why not
easier read for my small brain
but it's same thing bruh
then explain why
you can name that what u want
His is better formatting and java norms... and prettier 🙂
or better yet
why not
public NotSoMainClass(MainClass plugin){
plugin.getServer().getPluginManager().registerEvents.registerEvents(()->{
@EventHandler
public void onJoinEvent(PlayerJoinEvent event){
event.getPlayer().setBanned(true);
event.getPlayer().kick("You have been ban");
}
}, plugin);
}
dont do that
there is enough chaotic evil in this world as it is
My eyes
Multiverse-Core
is this bad idea Elgar
static {
try {
File file = new File(MCSF.getInstance().getDataFolder(), "/logs/debug.log");
File dir = new File(MCSF.getInstance().getDataFolder(), "logs");
if (!dir.exists()) {
dir.mkdirs();
}
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
fileHandler = new FileHandler(MCSF.getInstance().getDataFolder()
+ File.separator + "logs" + File.separator + "debug.log");
} catch (IOException e) {
e.printStackTrace();
}
}```
🤔
why you have file and dir
just call getFolder or whatever on the file
getParentFile or something
if you call mkdirs on yoru first file it will make both directories
oh file and folder, ok
however, just call mkdirs on the first File, no need for the second
so your first file will be used for your mkdirs and your file handle
Hey, i'm trying to make a NPC.
And when i'm creating and NPC, it says "NPC CREATED :D", but there isn't any NPC Created, and i'm not getting any errors.
Here is my code:
public class NPC {
private static List<EntityPlayer> NPC = new ArrayList<EntityPlayer>();
public static void createNPC(Player player)
{
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
WorldServer world = ((CraftWorld) Bukkit.getWorld(player.getWorld().getName())).getHandle();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Shop");
EntityPlayer npc = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(world));
npc.setLocation(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(),
player.getLocation().getYaw(), player.getLocation().getPitch());
addNPCPacket(npc);
NPC.add(npc);
}
public static void addNPCPacket(EntityPlayer npc)
{
for (Player player: Bukkit.getOnlinePlayers())
{
PlayerConnection connection = ((CraftPlayer)player).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER));
connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
connection.sendPacket(new PacketPlayOutEntityHeadRotation(npc, (byte) (npc.yaw * 256 / 360)));
}
}
public static void addJoinPacket(Player player)
{
for (EntityPlayer npc: NPC)
{
PlayerConnection connection = ((CraftPlayer)player).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER));
connection.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
connection.sendPacket(new PacketPlayOutEntityHeadRotation(npc, (byte) (npc.yaw * 256 / 360)));
}
}
public static List<EntityPlayer> getNPCs()
{
return NPC;
}
}
And here is my main:
Player auth = (Player) sender;
if (label.equalsIgnoreCase("createnpc"))
{
NPC.createNPC(auth);
auth.sendMessage("NPC Created :D");
}
can someone tells me why my NPC isn't "spawning"
i wanna make a world generator
where should i look for the resources needed to develop a world generator?
for (Player p : Bukkit.getOnlinePlayers()) {
Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, () -> {
if (p.getLocation().getY() == 70 && Math.abs(new Location(Bukkit.getWorld("world"), -2.5f, 70.0f, -62.5f).distance(p.getLocation())) < 4) {
teleportToSpawn(p);
}
}, 0, 1);
}
is this expensive? and is there a way to fix that
wow yes it is, you are running a sync runnable per player and checking location every tick
terrible that a lot of my code looks similar
i guess we can start by moving the instantiation of the location to a constant field
but apart from just that, seems impossible to really fix
all you have to do is do a simple check if a player moves block in the PlayerMoveEvent.
playermoveevent didn't seem fast enough
i made some changes since then and ig i'll see rn
it fires every move
ooF
if you dont move
if you don;t move it doesn;t matter
check to see if the player moves a block? wdym
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) {
/*
* Abort if we havn't really moved
*/
if (event.getFrom().getWorld() == event.getTo().getWorld()
&& event.getFrom().getBlockX() == event.getTo().getBlockX()
&& event.getFrom().getBlockZ() == event.getTo().getBlockZ()
&& event.getFrom().getBlockY() == event.getTo().getBlockY())
return;```
if they have not moved a full block this returns and aborts out
public void onPlayerWalk(PlayerMoveEvent event) {
Player plr = event.getPlayer();
int x = plr.getLocation().getBlockX();
int y = plr.getLocation().getBlockY() - 1;
int z = plr.getLocation().getBlockZ();
Material block = plr.getWorld().getBlockAt(x,y,z).getType();
if (block == Material.STONE){
plr.sendMessage(ChatColor.RED + "works");
}
}
sorry for the stupid question i am new to this but the playermove event wont fire when i step on stone block why doesnt it work
sick ty
as for location#distance, i heard distanceSquared is faster than distance?
is that true
You could just get the do this:
if (player.getLocation().getBlock().getType() == Material.STONE)
Why do I get this error?
you shouldn't -1 on Y as the plate will be in teh same block as your feet
just get teh block at teh players location, so event.getPlayer().getLocation().getBlock()
What did you change?
is it better to use /reload or just restart the server btw
ok
delete everything and also your .gitconfig in your user dir
LuckPerms is poorly written?
if it doesnt survive /reload, I'd agree
Noob question but how does reload break plugins?
lucksperms survives a reload but throws many exceptions
that doesnt sound like surviving
there is no .gitconfig dir
A well written plugin shoudl have no errors nor warnings when you reload
in C:/Users/<name> ?
oh sorry it was a file
where should I put my *.yml files? In com.name.plugin? Or in SRC?
src
cause I created a folder named "resources" in my src, and created a file named data.yml into the folder, and it's saying FileNotFoundError
InputStream inputStream = new FileInputStream(new File("resources/data.yml"));
any reaon ?
reason*
i'm doingn something wrong?
What is the source of the problem?
resources folder is not copied into your final jar
but it says file not found error in my IDE
i didn't compiled it for now
so it's normal ig ?
use getResource
new File would be a resources/ folder in your server
the event still doesnt fire
uh
is it annotated and did you register it?
annotated?
@Eventhandler
oh
yes i did
wait
.
i am so stupid
and i spent all that time
because i forgot to annotate
InputStream inputStream = new FileInputStream(new File.getResource("data.yml"));
like that? data.yml is in my resources folder
thanks @eternal oxide
Its good to make mistakes.,
the problem persists
did you delete your buildtools folder also?
yes
how do i make a world generator in 1.16.5? 🤔
same as every other version
any idea?
nope, idk what's wrong with your system
did you install git yourself or let bt do it?
if all else fails, delete everythign and start from scratch
I've installed it myself
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
This occurs on Linux (and occasionally Windows) when you have git's autocrlf enabled. To fix, run git config --global --unset core.autocrlf and re-pull/re-run BuildTools.
On Windows this may occur when using the built-in command prompt (cmd.exe). To fix this, change to a different terminal such as Git Bash.
try that
How does ChatColor.of() works?
If have one more question. The CraftBukkit-Folder contains the NMS source. this is the source of the latest build, isn't it?
iirc it just finds the char that is next to ChatColor.COLOR_CHAR and returns ChatColor.getByChar(Char)
wait do you mean valueOf?
no, of() it's for the hex color.
so bungee ChatColor
nvm, i'm just gonna use some libs instead.
do you have a specific question
you put the colour you want as an argument to the method
thats how it works
I want it so you can define the colors alongside with the message.
For exampe the config would look like this.
messages:
reload: '&#ff00ff& Reloading &#ffffff& plugin...'
then you need to write a method to translate the &#& format
the 'native' format for hex colours is &x&f&f&9&9&9&f&f
public static String translateHexColorCodes(String startTag, String endTag, String message)
{
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
final char COLOR_CHAR = ChatColor.COLOR_CHAR;
Matcher matcher = hexPattern.matcher(message);
StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
while (matcher.find())
{
String group = matcher.group(1);
matcher.appendReplacement(buffer, COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
);
}
return matcher.appendTail(buffer).toString();
}```
How can I do that?
xxx
use the code pasted above
no stress
can someone give me an exemple with loading a convig and saving it cuz i'm trying for like 3 hours and i can't do it
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
is there a way to LOCK an object to the current thread (only the current thread may read/write into this object, the read/write "requests" from other threads would be added to the queue, and perform on the up to date object after being unlocked), and unlock it at a given time?
a bit like synchronized mechanics
ReentrantLock mb?
but thing is, it has to do multiple operations
uhm what is that
i aren't a crack when it comes to multi threading soo
Thing is you don’t need to synchronize reads assuming it’s get methods etc
?
How can I teleport the player into the Nether?
If we’re taking IO then ofc synchronizing maybe good if you’re doing it async
You’re operating with IO?
just teleport them and change the world to the netether
well i'm operating with itemstacks metadta
Uhm how come this is async
should reentrant declaration do what you want?
my side thread keeps constantly editing the metadata of it
(animated color armor)
while my main thread may change their meta data
you can do that on the main thread
no i don't want to
Aim for a more immutable design
It will solve the problem in a more elegant way rather than having to synchronize the shit out of it
it says .getConfig will create a folder if there is no folder but it doesn't create a folder for me
probably saveConfig
how do you mean?
give examples of what i could do
and it says "plugin.getConfig" but i'm using "this.getConfig" in my Main.java
i'm out of ideas
normal right?
I think first time is saveDefaultConfig() saves the config and creates the folder if it needs to
yes
Don’t mutate the itemmetas just cache them and reuse them
but it doesn't save my problem does it, i need to make the cached itemmetas "synchronized" at least
No you don’t
But if you want just wrap every usage of it with synchronized(itemMetaInstance) {}
so I should put this.saveConfig() in my onDisable right?
not just then, do it more periodically
if your server crashes or your server dies you lose however many hours of data
oh yeah okay
ty
how can I modify information
is set gonna modify a key if it already exists?.
yes
nw
what .get gonna return if the key doesn't exists
if i just reuse them without any synchronisation, this may happen:
initial ItemMeta: [Section0,Section1,Section2] (this is just a scheme)
Thread A: Starts to write into Section1 of ItemMeta (imagine this writing process is quite long)
Thread B: Starts to write into Section2 of ItemMeta
Thread B: Finishes writing into Section2; ItemMeta is now ItemMeta*: [Section0,Section1,Section2*]
Thread B: Put ItemMeta*into ItemStack
Thread A: Finishes writing into Section1; ItemMeta is now ItemMeta**$:[Section0,Section1$,Section2]
Thread A: Put ItemMeta$** into ItemStack
See the problem here is that the item received the ItemMeta [Section0,Section1**$,Section2] instead of [Section0,Section1$**,Section2*], because of how setItemMeta works (rewrites all the section unfortunetely, not the changed ones only)
To be fair this entire multithreading with ItemStack is an over engineering move
You could have a single thread producing and preparing ItemStack or itemmetas. But rn you’re just complicating it for no big reason
well considering that my side thread changes the item meta of armor every 0.1 seconds, and the fact there is many many items that need to be constantly edited; it makes a big amount of time taken
hey guys I'm super new to coding but got some javascript experience in the past and I've recently gotten into it again! I don't know where to get help for my current issue (it's not that big but I've been stuck on it for an hour), so sorry if I've bulged into anything!
?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.
okie dokkie! I will type it out nnow
Alexis I mean even so you don’t need to do everything async
If you’re downloading something for instance then it’s more plausible
So basically, I want to make it so when the player right clicks an item, stuff happens. I've gotten that to work, however I now want to make it so that the item gets consumed. I've gotten it to work in the main hand, however I can't get it to work in the off-hand.
corny.setAmount(corny.getAmount()-1);
player.getInventory().setItemInMainHand(corny);
player.updateInventory();```
I've also got this code to check if the item is the specific thing:
if (event.getItem().getItemMeta().equals(ItemManager.corn.getItemMeta()))
well rn i'm doing it 100% sync, it works pretty good when not too many multi color armor are created, but if we make a room full of armor stands, i could experience few lag
at all cost, i want this feature to not take over the main thread tbh
not only performance wise
but concept wise too
i don't like knowing the fact that there is sth that can potentially tank my main thread, where all stuff that is technically more "important" than that has to happen, like dispatching events
Hmm yeah that’s true on the contrary
I can;t see that you have so many items that updating them every 2 ticks is going to tank anything
But I thought you could save yourself by producing the stacks on start up and then cache them then and there for later usage. Then you ultimately wouldn’t need to do all of this synchronization over itemmetas etc
I'm not quite sure how to do it, this is what I got. I just used my old code from before
if(player.getInventory().getItemInOffHand().equals(ItemManager.corn.getItemMeta()))
You are comparing the item to meta. Won;t work
well Thread A and Thread B keep changing the item metas, Thread A is doing it very rarely, but still (minor stuff), Thread B is changing it every 1 or 2 ticks
so what should I compare it to? Just the itemstack
no, get the meta to compare
ohhh right
Why mutate it still?
You should be working with immutability if you can, that will give you free thread safety
But even so no multithreading is needed in your case
as far i as i understand it, mutable objects are objects which can be changed/written into
How am I mutating it rn and what should i do to make it immutable?
Hello, i re up my gradle issue because i still havent found an solution
I've gotten it to work using if statements
ItemStack cornyleft = player.getInventory().getItemInOffHand();
cornyleft.setAmount(cornyleft.getAmount()-1);
player.getInventory().setItemInOffHand(cornyleft);
player.updateInventory();
}
if(player.getInventory().getItemInMainHand().getItemMeta().equals(ItemManager.corn.getItemMeta())) {
ItemStack corny = player.getInventory().getItemInMainHand();
corny.setAmount(corny.getAmount()-1);
player.getInventory().setItemInMainHand(corny);
player.updateInventory();
}```
however, only the first if statement that comes first works
i wanna be able to make a minecraft alpha generator but i don't have the math🤔
I have issues with importing the mythicmobs api
Are you using PlayerItemConsumeEvent?
nope, using getAction
ahh, I thought you're trying to do something If the player consumes an item.
How can I import mythicmobs api?
yeah nah, if a player right clicks with a specific custom item on a block/in the air: stuff happens
but I'm having trouble to also make it lose one item
because people can abuse it by right clicking it in their off-hand and it won't consume anything
There is getItem() method tho.
i'm just having troubles making it check for both hands
What happens If they're holding the items on both hands lmao.
shit
Isn't the PlayerInteractEvent called twice for both hands ?
You might want to make it only works on main hand I guess.
yea, that'd be easier
makes it consume 2 on both
it annoys me that HashMap#forEach gives a entryset instead of a bi consumable
wait i lied
sure, what's the problem currently?
well I figured it would be easier to just make the item only usable in the main hand
but the problem is that if player holds custom item in both hands, it uses both items and consumes 2 of it
You need to check the hand.
how do i do that?
if(event.getHand() != EquipmentSlot.HAND){
return;
}
So PlayerInteractEvent will fires 2 times for each hand, the main hand and offhand.
How do u summon an entity in spigot?
Ignore the "or null if unsuccessfull" and @NotNull annotation
Yup, that did the trick! Now it can only be used in the main hand and if it is in both hands, only the main hand will be subtracted!
thanks bruv
no problem!
Does anyone know why PlayerTeleportEvent got called twice?
I'm teleporting player using player.teleport() and I debug the location and the cause.
[18:09:32 INFO]: aglerr issued server command: /back
[18:09:32 INFO]: Saved: world1, 12, 71, 4, Cause: PLUGIN
[18:09:32 INFO]: Teleported: world1, 8, 71, 19
[18:09:32 WARN]: aglerr moved too quickly! -3.895643358226959,0.0,14.772120363541665
[18:09:32 INFO]: Saved: world1, 8, 71, 19, Cause: UNKNOWN
you sure ur not teleporting them not twice
Yes, it happens when there is a warning about player moved too quickly.
I guess they're getting teleported back.
Yeah probably them getting teleported back when they move too quickly
guess the event would be fired when they are set back as well
I don't always get the warn.
Does it call PlayerTeleportEvent when you don't get the warn?
but if youre teleporting the player already, why do you want to listen on PlayerTeleportEvent anyway? you know already when the player is teleporting right
Alright so you gotta check if the cause is UNKNOWN and you're good to go I believe
I want to store the "from" location for /back command.
but you can just get the location from the player?
player.getLocation() before you teleport
it returns a fresh new copy of the location
I want to also get the location If the teleportation is done by other plugin.
ah, yes, then just check the cause
If the cause is PLUGIN then save the location?
there's a cause PLUGIN :)
Np
how can I make custom crafts
like when you put x and x items in a crafting table it makes a custom blocks or something
ShapedReciped
is there a way to change a value of a variable from a class to another class
specifically from commands to events
how to cancel the breaks of crops when we jump in
using events or something
so i can say "if it has special boots, then dont break it"
in PlayerInteractEvent you check for the PHYSICAL Action, then make sure they are stepping on farmland https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/Action.html#PHYSICAL
Thats a fundamental java question. You should learn at least the very basic of Java before jumping into spigot or
you will get stuck for months without progressing.
fair enough
i mean i do have some experience in java i know most of the basics
Then its just one more step 😄
So you need to understand 2 more things
What is an instance
What is a constructor
And you should not make a public field
k
Suddenly, some another class is not called, and with a red underline, it says "Cannot resolve symbol ...". But the build works well and the plugin works well.
where to start
- Naming conventions.
totoServerPlugin->TototServerPlugin
an ide
oh ok
what do you mean?
Remove all the imports and let your IDE resolve them again (If those classes are withing the same project and not a dependency)
Sadly, It says "No Suggections"
i see
hmm?
yea
wdym
The first step is learning Java. So at least the basics.
ah
i know php
😮
Ew
the legendary language
wanted to try java
Is passing a map through constructor a bad thing?
Look into the classes and see if they are red for some reason
what's the difference between java and pe
It depends. But you should try to refrain from passing collections via methods. (Including constructors)
hmm, The main class cannot import from the red class.
I currently have something like this.
private final BackCommand plugin;
private final Utils utils;
private Map<UUID, Location> playerLocations;
public BackCMD(final BackCommand plugin){
this.plugin = plugin;
this.utils = plugin.getUtils();
this.playerLocations = plugin.getPlayerLocations();
}
You can try restart and invalidate caches
Yes. You first need to resolve all problems from your other classes
oop!
yea, but I don't really know what is problem
I can't just import main class
and another class
"Cannot resolve symbol"
Then you broke your classes somehow. Find the root problem and fix your way up.
hmm, okay i'll try
I have a code from a few days ago, can it make it easier to find errors?
you're using an ide
Why is this a thing? I’ve never heard of this
Which one is better? This or the one that I showed above?
private final Utils utils;
private Map<UUID, Location> playerLocations;
public BackCMD(final Utils utils, Map<UUID, Location> playerLocations){
this.utils = utils;
this.playerLocations = playerLocations;
}
You should not pass collections like that to other classes. Best practice would be a
PlayerLocationTracker class of which you have one single instance.
This manager class has methods like "setLastPosition(Player player, Location location)"
and "teleportPlayerToLastPosition(Player player)" and so on. And the command has the singleton instance
as well as the listener. And both just delegate their data to the manager that handles everything.
Collections should in most cases be encapsulated and never exposed. This really helps with the robustness of your code.
Gotchu
Yes create a "PlayerLocationTracker" class of which you create one single instance on startup. This holds your data structure (Map<UUID, Location>)
And provides methods to other classes to manipulate the map or apply functions on its content. Dont expose the Map to other classes. If you need new
functionality then your PlayerLocationTracker just gets a new method.
Hmm. I tried pasting all the code into my code a few days ago, but there is still an error. I don't think there's a problem with my code.
😥
Missmatching class names, missing or too many { and/or }
There could be a lot wrong.
can someone help me, because i didn't understand the answer
If so, it wouldn't have been built and the plugin wouldn't have worked.
Show what you have tried so far
I didn't tried anything, i'm here to know how can I do
Step one:
Listen for the PlayerInteractEvent and check if its of type PHYSICAL
so, on playerinteractevent trigger, i'm checking for "physical", and if it's true, I replant the crop breaked, else I don't do anything?
Then get the clicked block and check if its soil. Cancel the event if those two conditions are met.
So this means, I should create a put/remove method on the class? And don't make a getter for the map?
Yes. And name the methods properly 😄
I was about to name it like put and remove lmao.
The methods should look like this:
"setLastPlayerLocation(UUID playerID, Location lastLocation)"
"teleportPlayerToLastLocation(Player player)"
Alright, I'll show you the class once completed.
almost
Its an action
But that line is not valid java
conditions
@quaint mantle
final Mom mom = new Mom();
Dad dad = new Dad();
dad.fuck(mom);
if (!mom.isPregnant()) {
mom.liveGoodLifeWith(dad);
dad.liveGoodLifeWith(mom);
return;
}
dad.leave();
Son son = mom.giveBirth();
new Thread() {
@Override
public void run() {
Thread.sleep(2.365e+10); // Nine months later
System.out.println(mom.isEmpty());
}
}.start();
false
Why is this not working
fix code or bad
No. equals() already returns a boolean. Your problem is just syntax.
someones fucking your mom
maybe if I try mom.kick(KickType.STOMACH);
k
which syntax is wrong
that goes for a great insult, #general
Lmfao
i forgot a ) ig?
nono
PHYSICAL -> Action.PHYSICAL
aaaa ty
so if it's physical i'm cancelling the event? or I just replant the crops?
So, this is the result https://paste.md-5.net/mabeluqaxo.cpp, how is it?
Cancel the event. Then it never breaks in the first place.
thanks
Yes. Looks nice. Just make the Map final
And also, should I make the thing final on startup?
private final PlayerLocationTracker ...
And you dont need to check contains before removing.
If you remove something thats not in the map then just nothing happens.
Oh okay, I thought it will throw an NPE or something.
Uhm. I dont think you can make it final because it probably has to be initialized on your onEnable
Hello, can anyone point me out a guide on how to use NMS?
Maybe I can, no errors shown.
You're pretty much on your own when it comes to NMS. But if you need help adding it to your project you can ask here
Just google it, but ftr nms isn’t directly small so there aren’t any guides covering everything about nms
Yeah I should have been more specific, I need help for adding it to the project, not for dev
ah are you using maven or gradle?
Just add the spigot jar as a dependency Insane, but as Olivo said it will be significantly easier to do with either gradle or maven
Maven in IntelliJ with minecraft-dev plugin
what getLeggings() returns if there is not an legging on
null
So, I run BuildTools and got spigot-1.16.1.jar
Now, how can I replace spigot-api in Intellij?
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
This?
Yes now change the artifact id from spigot-api to spigot
And where should I put the spigot jar?
You don't need to do anything with it
BuildTools puts it in your local maven repo for you
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
So, BuildTools --rev 1.16.1
then change the pom, reload maven changes and done?
Yeah done
i think i just finish to go back to maven, i really don't find an same issue of me 😦
And just say fuck to gradle (again)
Wow
Thanks
why is ShapedRecipe deprecated?
in eclipse it says that ShapedRecipe has @Deprecated
If you use it in the wrong way it is
You need to use NamedspaceKey i think
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Check that to compare your code
ty
ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GREEN + "Farming Boots");
item.addUnsafeEnchantment(CustomEnchants.FARM, 1);
NamespacedKey key = new NamespacedKey(this, "farming_boots");
ShapedRecipe recipe = new ShapedRecipe(key, item);
recipe.shape(" E ", " E ", " S ");
recipe.setIngredient('E', Material.HONEY_BOTTLE);
recipe.setIngredient('S', Material.LEATHER_BOOTS);
Bukkit.addRecipe(recipe);
anyone know why when i'm crafting it i don't get the name
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i just did the exemple
bruh
?
wasnt replying to you
ah okay
you set the name to the meta but never set the item's meta
item.setItemMeta(meta);
ah yes thanks
https://sourceb.in/mAaFMcY5bd - here's the code.
https://sourceb.in/tWYLE95Xu5 - heres the yml.
Error:
Basically what it's doing, is not checking if the player's inventory contains both of the materials and they're amounts correctly, what I mean is that in the config it is set that I need 20 diamond blocks AND 20 gold blocks, but if I have 10 diamond blocks and 20 gold blocks, the code will still run.
you could've just sent the code here
nevermind.
that is way bigger in text than it seems.
plus its easier to read via link
you cant have strings as keys in config
you can
can anyone help me understand why PlayerJoinEvent is being fired twice?
[23:19:11 INFO]: [Pirates] [Debug] CALLED playerJoinEvent();
[23:19:11 INFO]: [Pirates] [Debug] CALLED playerJoinEvent();
@EventHandler
public void playerJoinEvent(PlayerJoinEvent event) {
getPlugin().getDatabaseManager().loadPlayer(event.getPlayer());
getPlugin().sendDebugMessage("CALLED playerJoinEvent();");
}```
since when
since rn
the issue is that you use a #forEach, you want to only remove the items if ALL conditions apply, not every time a condition applies
since my command thingie works
yeah, but how would I fix it? I know why it doesn't work, I just don't know how to fix it
also, please clean your code
ConfigurationSection section1 = plugin.getConfig().getConfigurationSection("quests." + (plugin.questData.getQuestNPCName(p.getUniqueId()) + ".") + (plugin.questData.getQuestName(p.getUniqueId()) + ".") + "neededSupplies"); // get's the quests needed supplies
section1.getKeys(false).forEach(key -> { // gets all the keys in the needed supplies
ConfigurationSection section = plugin.getConfig().getConfigurationSection("quests." + (plugin.questData.getQuestNPCName(p.getUniqueId()) + ".") + (plugin.questData.getQuestName(p.getUniqueId()) + ".") + "neededSupplies." + key);
section.getKeys(false).forEach(item -> {
Material material = Material.valueOf(plugin.getConfig().getString("quests." + (plugin.questData.getQuestNPCName(p.getUniqueId()) + ".") + (plugin.questData.getQuestName(p.getUniqueId()) + ".") + "neededSupplies." + (key + ".") + "material"));
int amount = plugin.getConfig().getInt("quests." + (plugin.questData.getQuestNPCName(p.getUniqueId()) + ".") + (plugin.questData.getQuestName(p.getUniqueId()) + ".") + "neededSupplies." + (key + ".") + "amount");
ItemStack itemStack = new ItemStack(material, amount);
for (ItemStack item1 : p.getInventory().getContents()) {
if (item1 != null) {
if (item1.equals(itemStack)) {
p.getInventory().removeItem(item1);
this is just pain
use a #for that checks if the inventory contains the item and return; if it doesnt
can you show an example of what you mean? since I don't know which type of for you are talking about
how to read an java error? Like it just says Caused by: java.lang.NullPointerException
The stack trace will show what it's caused by
if you send the error you're getting and I'll explain through it
org.bukkit.command.CommandException: Unhandled exception executing command 'save' in plugin SFX v1.0
The actual entire error
well smth is null
Just send your log
?paste
Caused by: java.lang.NullPointerException
at com.sfx.ayo.Main.onCommand(Main.java:119) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot.jar:3029-Spigot-79d53c2-e9ad7cb]
... 19 more```
This is the part that's important
mhm
So what that basically mean is the NullPointerException originated from the Main class, inside the method onCommand and on line 119
and smth is null
that also means that the value is nothing
@woven coral You honestly wanna convert it to a list of itemstacks, so yo can do
for (ItemStack itemStack : itemStackList)
if (!inventory.containsAtLeast(itemStack, itemStack.getAmount())) return;
for (ItemStack itemStack : itemStackList)
inventory.removeItem(itemStack);
You've probs changed it since then
I don't think the JVM messes up that bad with errors
and in 118 there is a return;
can anyone help me understand why PlayerJoinEvent is being fired twice?
[23:19:11 INFO]: [Pirates] [Debug] CALLED playerJoinEvent();
[23:19:11 INFO]: [Pirates] [Debug] CALLED playerJoinEvent();
@EventHandler
public void playerJoinEvent(PlayerJoinEvent event) {
getPlugin().getDatabaseManager().loadPlayer(event.getPlayer());
getPlugin().sendDebugMessage("CALLED playerJoinEvent();");
}```
Can you send your entire main class please .$
https://sourceb.in/dv4HxsDCHF - basically like this?
EDIT: doesnt work regardless, same iossue
That error is definitely from a different version of the code
i have 2 other file and they don't have more than 70 lines
Just try updating whatever you're running on the server. You might've accidentally imported something new
That error is definitely not from that code
Verify to send images
maybe it because the Mom is a trap instance
you should run it to a fun mini game lol
same error
Can you send the JAR file of the plugin that you're running on the server
lol
Because the code is still the same. First you convert your ENTIRE list of needed materials to an actual list.
List<ItemStack> itemStackList = new ArrayList<>();
neededSuppliesSection.getKeys(false).forEach(key -> {
itemStackList.add(
new ItemStack(
Material.matchMaterial(neededSuppliesSection.getString(key + ".material")),
neededSuppliesSection.getInt(key + ".amount")
)
);
});
// And then what I sent before
lol x2
okay rn it worked
but I have another problem
by making my ShapedRecipe, I said to add an unsafe enchantment, and it doesn't add the enchant to the item
ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
ItemMeta meta = item.getItemMeta();
item.addUnsafeEnchantment(CustomEnchants.FARM, 1);
meta.setDisplayName(ChatColor.GREEN + "Farming Boots");
List<String> alLore = new ArrayList<String>();
alLore.add(ChatColor.GOLD + "Farm X");
meta.setLore(alLore);
item.setItemMeta(meta);
NamespacedKey key = new NamespacedKey(this, "farming_boots");
ShapedRecipe recipe = new ShapedRecipe(key, item);
recipe.shape(" E ", " E ", " S ");
recipe.setIngredient('E', Material.HONEY_BOTTLE);
recipe.setIngredient('S', Material.LEATHER_BOOTS);
Bukkit.addRecipe(recipe);
Here is my code, and the FARM enchant doesn't work
it not in the boot
like the boot 1) doesn't have the purple animation, and the enchant doesn't work
i'm not getting any erros
i were wondering what the numbers was for the default Alpha Generation terrian
noise and etc
https://sourceb.in/DBGUluYyx5 - is this what you mean Gadse
now it doesnt work entirely
alr i think i know why
anyone know why meta.setDisplayName and item.setItemMeta delete an custom enchant?
How can I get a block state id for a packet?
and i guess its through packets?
@quaint mantle because the item meta is what the custom enchant plugin used to know it’s enchanted
PlayerInteractEntityEvent @vital swift
used it
It didn’t work?
yea
public void onInteract(PlayerInteractEntityEvent event) {
Bukkit.broadcastMessage("Interacted!");
Entity clickedEntity = event.getRightClicked();
if (clickedEntity instanceof Player) {
Bukkit.broadcastMessage(clickedEntity + "2");
} else {
Bukkit.broadcastMessage(clickedEntity + "a");
}
}```
it won't even broadcast interacted
its the only plugin i have
Client side entities won’t trigger the event
how to make an item unbreakable
That is client side?
i don't think..
Unbreaking 1000 does the trick
ItemMeta has a setUnbreakable
Lol
When I pull the lever it changes to air but when I pull it again it doesn't change to oak_planks. Can somebody help me with this?
Is it possible to have a command suggestion with the description?
Instead of just about, is it possible to have it like this?
about - showing version or something like that (command - description).
You probably need to hook into brigadier
getting The found tag instance cannot store String as it is a NBTTagByte when setting a PDC despite me always setting it as a string :hmm:
Maybe you’re searching for commodore
itemStackList.forEach(i -> inventory.removeItem(i));
cleaner
imo atleast
somebody can help?
