#development
1 messages · Page 113 of 1
its free but the beginner course is paid for
the free part is just enough for you to know
ive never touched java in my life but ill look for something i can do
Can’t agree more, I started facing many issues with it
Hi guys
I got a problem too
public void onPlayerToggleSneakEvent(PlayerToggleSneakEvent e) { Player player = e.getPlayer(); if(!player.getName().equals("Hot_Shack")) player.sendMessage("Snek"); }
I wanna print something when someone specific sneaks but it does it when anybody sneaks
Check your Boolean statement
Are you registering the event listener?
@Override public void onEnable() { // Plugin startup logic Bukkit.getPluginManager().registerEvents(new listener(),this); }
You mean this?
Yeah
Yeah i have it
Remove the ! as it's checking if they don't have that name then do the code
I tried it with and without ! and it always prints
(Also is there a way to do it with tags?
it's gonna be much simpler to use
Its printing again
I found a fix
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
RealScoreboard.jar//josegamerpt.realscoreboard.utils.Placeholders.time(Placeholders.java:54)
@viscid tulip
?
Don't post an error on all channels, stick to one.
yeah. we went thru this. lol. xD
I know this question was probably asked 100 trillion times already, but what happened to the patched_1.18.1.jar? Is there a way to get the final jar holding all bukkit/spigot/paper classes?
Hey Who can explain me how can i add tho this code a @eventhandler from another file ``` @SubCommand("open")
public void open (Player player){
openGui(player);
}
public InventoryView openGui(Player player) {
Inventory inv = Bukkit.createInventory(null, 27, "EXP Shop");
ItemStack stick = new ItemStack(Material.STICK);
inv.setItem(1,stick);
return player.openInventory(inv);
} ```
Hi
If i put
`` if (cmd.getName().equalsIgnoreCase("twitter")){
sender.sendMessage
(ChatColor.DARK_GRAY + "+---------------------------------------------------+");
sender.sendMessage(ChatColor.GRAY + "Nuestro Twitter Es: " + ChatColor.AQUA + "www.twitter.com/somostrufas");
sender.sendMessage
(ChatColor.DARK_GRAY + "+---------------------------------------------------+");
}``
The message will send when the player execute the command
/twittwer
The message will be like this
+---------------------------------------------------+
Nuestro Twitter Es: <the link>
+---------------------------------------------------+
¿?
Why when clicking a item in the inventory isn't it canceled?
@EventHandler
public void onInventoryClick(final InventoryClickEvent e) {
if (e.getInventory() != teamGUI) return;
e.setCancelled(true);
final ItemStack clickedItem = e.getCurrentItem();
// verify current item is not null
if (clickedItem == null || clickedItem.getType().equals(Material.AIR)) return;
final Player p = (Player) e.getWhoClicked();
// Using slots click is a best option for your inventory click's
p.sendMessage("You clicked at slot " + e.getRawSlot());
}
```
this doesn't work either
think i did something wrong tho
Use .equals (or well, !.equals) to compare the inventories instead of ==/!=
Ah
This was fully copied from the SpigotMC forums (tutorial)
And even if y change it, it doesn't work
because e.getinventory isnt the same as teamGUI ig
hey, is there a way to decompile jar into intellij project?
its possible but not really recommended
You can decompile, but to add it into Intellij you’ll need to reference its dependencies
Yesterday I came with a jitpack issue, and I wasn't able to get jitpack working, so I created my own repo manager. The thing is that, when declaring my lib as a dependency, it doesn't show any error, but it doesn't appear in external libraries (like it didn't download).
Here's my repo: http://repo.dolphln.com/ui/native/ModelTool/com/github/AleIV/ModelTool/0.1-SNAPSHOT/
My build.gradle file:
That's the build gradle of my lib
The one I'm testing if my lib is being downloaded (at least) is this one:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
jcenter()
mavenCentral()
maven {
url 'http://repo.dolphln.com/artifactory/ModelTool/'
allowInsecureProtocol true
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'com.github.AleIV:ModelTool:0.1-SNAPSHOT'
}
test {
useJUnitPlatform()
}```
Using Fabric, how can I make a mod that only does logic server-side, but has items the client needs to render?
I tried making an ItemManager class that's run from both the server and client, and registers the items to the registry
but it doesn't seem to work
the item just doesn't exist
hey. Im making a plugin to extend player reach to 5 blocks. would anyone know how to force a player to place a block so the original spigot code runs? if i did just setLocation() that code and other events from other plugins wouldnt run
Sounds like something that has to be implemented on client side as well imo, Fred
is it possible to do what mee6 does with welcoming members to a server with an image but with java ? for a custom bot
hm, @sinful portal ^^ possible answer
thanks :)
I am, but it's just not working
You accepted the commission without knowing how? 👀 (I'm in that server aswell)
Anyway, you'll have to manually do it server-side. You can't just tell the client to
Must raytrace
yeah i ended up doing that
I wouldn’t say there’s anything wrong with that.
^
what server? 👀
ah
like what lol
the challenges are all too hard for me
w8 i found learn java free course
I've heard pretty good things about them.
i had thought they were paid for
i would like to learn but im poor so the free-er the better
ye you really don't need money to learn programming
when it comes to programming atleast for me after awhile itll just click in your head how it all works. aslong as you keep trying to and using tools like youtube and w3schools and other stuff then you will learn
w3schools not best place to learn
at least in HTML tutorials it have common mistakes xd
or more like bad practices
Jetbrains gives you a bunch of free months
https://hyperskill.org/financial-aid (jetbrains academy extra months)
its how i learned some stuff
more of a if i forget syntax now
btw if you r student check this @summer ingot https://education.github.com/pack 😏
already applied a few days ago
fingers crossed that they accept me
my student id doesnt have a date on it only my name and school name so they might not accept me right away
It took me like a month to get accepted since I don't have a school email
Any idea why processResources doesn't replace ${version} from any resource? https://github.com/iGabyTM/arcane-vouchers/blob/master/plugin/build.gradle#L55-L57
isn't that using ReplaceTokens
ye
this is what i use
🤷
wait dont use that
processResources {
doLast {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(sourceSets.main.resources.srcDirs) {
expand 'pluginVersion': version
}
}
}
```hmm try this
will do
I think that doLast is around processResources
tasks.processResources {
outputs.upToDateWhen { false }
expand("pluginVersion" to project.version)
}
```this is what i do in kts, in gradle probably ```gradle
tasks.processResources {
outputs.upToDateWhen { false }
expand 'pluginVersion': project.version
}
although I use a similar build.gradle on multiple plugins and didn't had an issue yet
hmm
works now, did a clean install
Mood
Best way to detect when player digs a block (so you can do stuff while player digs)??
I’m not at my PC right now, but iirc the dig packet is send when the player starts digging and when it believes it has finished. Not sure if there is an event that correlates to this. You can cancel whatever you are doing when the finish dig packet / break block event is called (whichever comes first).
Edit: upon further research, don’t think there is an event for this so you would have to manually intercept the packet https://wiki.vg/Protocol#Player_Digging
On a separate note, what’s the best way to continuously perform a task if a player is not within a specific region of a block. There could potentially be many of these blocks. This also integrates with world guard regions if that makes things easier (I am currently using flag changes but I don’t want to create lots of regions)
Have a single timer, and just check the players
Have a single timer, and just check the players
why is 0xBEE5, a 16-bit value, not compatible with a short, a 16-bit value 
Do you know how big that value is in decimal?
Need to keep shorts max and min in mind
Just use int
yeah i guess
but it feels like it messes with writing and reading it to a stream, doing testing rn
Erm in what way
it looked like the value being written wasn't the correct bit-size (using objectoutputstream to write to a file), but i might've just messed up smthing idk
Yea probably something simple
nvm it works, am dumbo
Is there a simple way to replace the 'Internal error ...' message?
yes, you can fix your code
Catch the exception?
my code is fixed
I just don't want for players to see some random ass error message when some other plugin doesn't work properly
then don't use broken plugins
smart one aren't you
An internal error means something has gone really wrong, enough to throw an exception. What would you replace it with? Just another generic "Something has gone wrong" message? Other than that, you'd have to actually figure out the exception in the plugin and catch/correct it
the message is hardcoded
Yeah, ya could always patch Paper lmao
how do i detect right clicking action from a player
???
does anybody know how to do this? or could anybody teach me how plz.
You listen to the correct event, and then you execute the logic
i've understood that, but it doesn't seem to be working at the moment.
i've done some code and edited some things but it isn't working for some reason.
i've got this so far:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
if (p.getInventory().getItemInMainHand().getType() == Material.STICK) {
if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Bukkit.broadcastMessage("Event Triggered");
}
}
}
is there anything obviously wrong with that or anything?
Did you register the event in your main class?
hmmm, wait i'll check
how would i register it as the main class?
Can you not tag me everytime you send a message please
ok im sorry.
getServer().getPluginManager().registerEvents(new Listener(), this);
ah ok i'll try that then.
okay
would that require a "this.(msg)" or not?
ah ok ty. sorry im kind of inexperienced.
All good
i tried to build it and i got "java: org.bukkit.event.Listener is abstract; cannot be instantiated"? what does that mean.
???
new Listener(), You have to replace the Listener with your listener class/event class
oh ok.
So if your listener class is called like InteractionListener, you do new InteractionListener()
ah ok thank you.
so is my listener class the class i mention when i do "implement listener" then?
Yeah, this class
ah ok cool ty. so because i've got "public class ClickEvent extends JavaPlugin implements Listener {" my listener class would be called "clickevent"?
ah ok so that's correct good. i'll try it out now.
it still doesn't seem to be working? is there anything i need to input beforehand to make it work?
Show us the whole class and main class if possible...we could help more then
ah ok
in a pastebin if possible
is there a command on this server for one?
hey can i send it to u?
it would be better if you send it here...as every one here can help you right? 😃
ah ok yeah.
ill use this ty.
howd i now send that to you?
paste the code there and click on save on the top right and share us the link
i think that should work... but idk why the codes not working. im new and inexperienced so it's probably something really obvious.
getServer().getPluginManager().registerEvents(new ClickEvent(), this);
you can't do this IG
you can't create another object of the JavaPlugin or is it possilble?
getServer().getPluginManager().registerEvents(this, this);
try this
i don't know... .
ah ok. ill try that and reupload the plugin.
is the "this" a placeholder or do i actually type "this"?
this is not a placeholder...its pointer to the same class
ah ok. i'll try running code again ty.
(to the same instance)
yeah..sorry..same instance
the message isn't being displayed when i perform the action? but i don't think there are many other errors in there?
im trying to get it to execute the code when a player right clicks using the "stick" item.
hey, one more thing..do @carmine jacinth annotation on onEnable()
its extended from base class
wait... was he a member?
wdym?
nah, i pinged a user accidentaly
ah ok :/.
Somebody knows how to addd potions in Shopgui+
so do u think you know what might be wrong with it?
is there any error?
nope. it just doesn't work.
weird, let me try the code...
it just isn't doing anything...
also the "getiteminhand" thing was deprecated so idk what to use instead.
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event){
final Player player = event.getPlayer();
if(event.getItem().getType() == Material.STICK){
if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
Bukkit.broadcastMessage("Event Triggered");
}
}
try this
ah ok i will. is there anything i need to have before that?
just replace your onPlayerInteract with this...
what i did was to get the event.getItem() instead of Player#Inventory.getItemInMainHand()
ah ok... im just refreshing the server to try it out.
fingers crossed
but how does that change the outcome overall though?
lets just simply print both to know whats the difference
hmmm... i've updated the plugin and there haven't been any errors, but it still doesn't print out the message. this is still loads better in that it accepts all of the variables and events though, thank you.
do you have any idea what might be going wrong?
i noticed theres also a "final" behind player? before i think i was using just normal "Player player" thingies... what does the "final" do?
is that working for you?
we can't change the value of a variable later that has been assigned with final..
yeah it is
ah ok.
so it's printing out the "event triggered" thingy?
do you have anything before the section of code you sent back to me that might make a difference???
i'm on 1.18.1 by the way, idk if that makes any difference though.
also both are same...it printed true..so both the object are same
i think i missed some parts out that you had at the beginning. lemme rerun that code again.
it isn't working still. are you on 1.18.1 as well?
yep
are there any things on the pastebin code thingy that are placeholders for other things?
i haven't inputted the startup and on disable code into it. might that cause it not to function properly?
nope
i changed the "itemcheck" name to the name of my class. was that the correct thing to do?
yep. i log onto my server and i right click the stick in my hotbar and no messages are sent...
could it be a message sending thing?
yes. the welcome message is still working so ik its enabled.
do /plugins
what would i put in the output box to have it kill me? just something more extreme
yep. it's there.
p.getInventory().getItemInMainHand()
ah ok ty.
Hey, ive got this code wich turns 9 Coal into a CoalBlock it also works fine, but only if there are 10 coal in the barrel but it doesnt work with 9 coal. WHY?!
@EventHandler
public void onInventoryChange(InventoryMoveItemEvent event) {
try {
Container cont = (Container) event.getDestination().getHolder();
if (cont.getInventory().getType() == InventoryType.BARREL && cont.getCustomName().equalsIgnoreCase("autocraft")) {
for (int i = 0; i <= event.getDestination().getSize(); i++) {
if (cont.getInventory().getItem(i) != null)
{
ItemStack item = cont.getInventory().getItem(i);
if (item.getType() == Material.COAL && item.getAmount() >= 9) {
cont.getInventory().removeItem(new ItemStack(item.getType(), 9));
cont.getInventory().addItem(new ItemStack(Material.COAL_BLOCK));
``` (this is a small snippet of code)
at me.clip.placeholderapi.expansion.PlaceholderExpansion.register(PlaceholderExpansion.java:138) ~[?:?]```
whats this?
i am trying to register my expansion
and this error keeps popping up
using the spigot 1.18 jar as library wont let me do basic things as extending JavaPlugin
import org.bukkit.plugin.java.JavaPlugin also doesnt work how do I import any of the classes or am I supposed to use a different jar
do I really have to use gradle :|
you should either go for maven or gradle for building and stuffs
ill just use 1.16 then lmao
Man tagged me 3 fucking times for the same thing
I'm having the same issue with a 1.18.1 server
I have 1.17.1 i think
after long time debugging i found out that the current item that is executing this event doesnt get count. is there a way to fix this?
Make sure you dont shade papi in your jar
compileOnly for gradle or provided scope for maven
is there any other event except InventoryItemMoveEvent that allows to check for items update in the inventory without any player interactions
Seems like this worked... idk why i had implementation instead of compileOnly
@sage thorn This may help you too
Will try thanks
Nice
what da hell is a fake enchantment
its a not real enchantment fs
but how does it act
does it work like an enchantment but doesnt show or does it show like enchamnent but doesnt work
Yep works
Thank @dense drift <- they were the big brain here XD
Np
Tryin to create a custom uploader with ShareX
but this happens when i take a screenshot
open the url
Can someone reach out the creator and inform about this, im still waiting
I want to prevent players from moving items in their inventory. But when I cancel the event I still get the item on the cursor (aka the item is duped). How do I fix it? Here is my code: https://paste.helpch.at/utuwilinor.cs
You can do this item stacks have an nbt
And if player have and item satck with this nbt
Replace with air
What do you mean? I don't understand.
Humm you know Nbt api?
No
The problem is not registering if the item should be moved or not though, if that is what you mean. Also, my items all have unique NBT-IDs so getting the correct item is not a problem. I use Tasks.getArtifact(SomeItemStack); and I will get the custom item corresponding to the itemstack or null if the item isn't a custom item.
But you are saying when you interact with the items
They are dupped
You can do this
The event is not cancelled properly is the problem.
Question, so in 1.18 has NBT Changed? When im trying to do it as i did previously ItemStack is importing as import net.minecraft.world.item.Items;
What is the event you use?
I sent my code if you want to look at it, but I use InventoryClickEvent.
You can us Nbt Api as a guide its a good api
Try ItemMoveEvent
Ok
I need the player though, so I can send a message. How do I get the player with InventoryMoveItemEvent? I see no function for it.
The player humm i dont remeber but existe a function
Should I use a InventoryMoveItemEvent along with a InventoryClickEvent?
And cancel the event with the move event and get the player with the click event?
e.getSource().getHolder()
This is a entity
Player p = (Player) e.getSource().getHolder()
e is event
No better use
e.getViewers()
This return an Human Entity
List*
Wait no, that is not what I want. I just checked the event. I want to prevent the player from moving the item in their inventory.
Is there no way to cancel the InventoryClickEvent properly?
I dont know
Because it works fine in my GUIs but not in a player inventory, and I don't get why :/
Try the inventorymove eveny and guse witj inventory click event
And if you move a item is artifact
InventoryMoveEvent doesn't apply to players
Replace with air
Humm yes works
I have and item updater
I don't want to check if the artifact changes inventory though. Only if a player moves it in THEIR inventory
I thought that event was more for things like hoppers and droppers, etc
It is
From the wiki Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another..
Players trigger it too?
Still though, I don't want to check if the item swaps inventory, only if it changes slot
So how are they getting the item into their cursor in the first place?
You're not cancelling the initial click?
At the bottom?
Why do they have an item in their cursor then?
One use e.getItem() but the other i dont remember
That is what I don't understand. I cancel the event, but I still get the item on my cursor
Its normal because the events is cancelled but you equals tough the item
But this exact method works as it should in my GUIs?
I dont remember i have all mi code in my laptop
Is it possible 1.8 FurnanceRecipe with custom cooking time?
private void registerCustomEnchantments() {
new Telekinesis();
new SmeltingTouch();
new Rainbow();
new Experience();
new SilkTouch();
}
is there a better way of doing this?
without having to type out new classname() for every single class
Honestly for the sake of readability I’d leave it like that
the classes are all in the same package and only gets called once
It’s better off having it like that than adding some fancy loop with array of classes, it’s more readable like that and prevents complication
I used to try make it as fancy as possible, but then by doing so you make it harder for future
im not trying to make it fancy, just register every class in a package so i dont have to type it out for every one i add
I've found something similar to this is truly the best away :p with hardcoded enchants you have to register them somewhere. Might as well have a nice register class that does it.
Hi guys, this is because of reading config values? SpawnTeleportEvent: https://paste.helpch.at/ronitabuze.java
this what @cinder forum
1st screen
Someone knows if it's possible to update Google Drawings (image) using an API?
How does DeluxeMenus register commands?
afaik, they don't
They do no?
Other wise what is this used for? register_command: true
doesn't belong there, its a development question as im wondering how they do that. And registering any command would require a restart I know it doesnt register then on reload
final Server server = Bukkit.getServer();
final Method getCommandMap = server.getClass().getDeclaredMethod("getCommandMap");
getCommandMap.setAccessible(true);
final CommandMap commandMap = (CommandMap) getCommandMap.invoke(server);```
<https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandMap.html#register(java.lang.String,java.lang.String,org.bukkit.command.Command)>
how can I filter messages printed on the console? what is the best way of filtering them?
I think Frosty did that once
That'll do it I think, thank you!
bad class file: /C:/Users/mason/.m2/repository/org/spigotmc/spigot/1.18.1-R0.1-SNAPSHOT/spigot-1.18.1-R0.1-SNAPSHOT.jar!/net/minecraft/nbt/NBTTagCompound.class
class file has wrong version 61.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.``` What would be causing this? I used `java -jar BuildTools.jar --rev 1.18.1` to build my build tools and removed `-api` as i usually would but im getting this
Try to run it using java 17
Ok
Info: Not a Minecraft plugin
When I press the "up" key on my keyboard when using a terminal, I will be given the option to repeat my last command. However, when I try doing this in a java program, I get "^[OA" instead. Anyone know how to fix this?
starting at Line 48 ending 127 is there a better way to change the itemstacks at each slot more cleanly then im currently doing?
I believe (I may be wrong) it’s because your up key inputs those weird characters, just like your “a” key inputs ascii “a”, and your b key inputs ascii b. usually though, programs (and terminals) will listen to and link your up key to your last command, but that isn’t always the case, and some programs just don’t do that
using a proper inventory framework would help the most, but a good start would be to make a small helper method that sets multiple slots to the same item, since you have a lot of repeated calls to #setItem only varying by the slot number
you can create a couple lists 🤷 and reduce arrow code
https://paste.helpch.at/zizivuleqo.php
44 -> 27 lines :))
this too
since you seem to be doing it a lot
an inventory framework?
why would i need an inventory framework ?
im only making 2 inventories rn
you don't. it just would make your code more concise, if that's what you're going for. but imo what you currently have does the job just fine if you're only making 2 inventories
How do I create a multi bungee network?
create two networks and use a cache + pubsub like redis to synchronize player state and manage cross-network messaging
No.. like I mean connecting one bungee cord proxy into another
Yes
That’s what that is
Two bungee cord proxies that intertwine player state and stuff
That’s not what I want… something like
The main proxy -> a lobby proxy -> a game proxy
Kinda like how hypixel does it.
Hypixel doesn’t have “lobby proxies” and “game proxies”
They use a system of standalone networking applications that spin up and down lobbies and games and the master contextual proxy sends players to servers
Well they have multiple bungee instances linked into one. Which is what I want for my server.
Having “sub proxies” isn’t a good idea anyway
What I described before is exactly what you seem to be asking for
Multiple proxies that are synchronized
You need something like redis to synchronize the data between proxies
I don’t want synced data…
^
I want to setup sub-proxies
why would you want separate proxies
You don’t want sub proxies
that creates unneeded complexity
Which I’m more than fine with, I need this so I can add a couple crucial features to my minigame server
If you really want sub proxies, you’re on your own. It’s not how bungee operates, so you can write your own custom proxy from scratch
Ah, okay.
Or you can do it the normal way, and have processes that manage mini games and just tell the proxy to send the connected player to it
How would I do that?
i’ll draw it
Ok
Hii discord team
No tho
Guys after a few sql statement with hikaricp my server passes away
here are the logs
I'm using default hikaricp settings
This is my class that manage the SQL Statements
idk but i do my hikari like this
HikariConfig config = new HikariConfig();
config.setMinimumIdle(1);
config.setMaximumPoolSize(20);
config.setDriverClassName(settingsManager.get(Config.DATABASE_DRIVERNAME));
config.setJdbcUrl("jdbc:mariadb://" + settingsManager.get(Config.DATABASE_DETAILS_IP) + ":" + settingsManager.get(Config.DATABASE_DETAILS_PORT) + "/" + settingsManager.get(Config.DATABASE_DETAILS_DATABASE));
config.addDataSourceProperty("user", settingsManager.get(Config.DATABASE_DETAILS_USERNAME));
config.addDataSourceProperty("password", settingsManager.get(Config.DATABASE_DETAILS_PASSWORD));
config.setAutoCommit(true);
dataSource = new HikariDataSource(config);
let me try
Did it work?
Is there a tutorial on spigot and bungee support at the same time?
Btw I've fixed it
You mean a spigot/bungeecord plugin like SkinRestorer
Just create another class and extend the bungeecord plugin, create bungee.yml and it should work
yep
Will try thanks
Hi guys, maybe you can help me with it. I am trying to send my own pluginMessage to change the platform name in the debug screen (F3) at the top left, but my method for some reason doesn't work, despite the fact that the pluginMessage is successfully sent. Thanks in advance.
In my main class
@Override
public void onEnable() {
...
getServer().getMessenger().registerIncomingPluginChannel(this, "minecraft:brand", new BrandListener());
getServer().getPluginManager().registerEvents(new Listeners(), this);
...
}
public class Listeners implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
String fakeBrand = "FakeBrand";
System.out.println("Sent to " + e.getPlayer().getName());
e.getPlayer().sendPluginMessage(PluginChannels.plugin, "minecraft:brand", fakeBrand.getBytes(StandardCharsets.UTF_8));
System.out.println(fakeBrand);
System.out.println(Arrays.toString(fakeBrand.getBytes(StandardCharsets.UTF_8)));
}
}
its MC|BRAND
It was changed to minecraft:brand on 1.13 from what I've seen
Haha
Weak, no embed
I blame hc
We're generating a profile for this user, try again in a minute.
Lol
The hell are you doing
Perhaps there is some kind of specific handling of bytes used... idk really :/
player.getClass().getMethod("addChannel", String.class).invoke(player, "minecraft:brand");
Can you explain, please?
you gotta make the client see the channel
hm, i'll try, ty
I see youre finnaly online, please can you do this, to fix so command cooldowns works? @robust crow
DeluxeCommands isn't my plugin
I know but read what you need to do
Oh wait
umm okay i misread
Can you please contact the creator?
I cant find any contact info
O.o
Hello? @robust crow , i hate to ping but this needs to be done
Is there a better way to store an ItemStack in a .yml file than this: https://paste.helpch.at/tajijejade.makefile ?
if you don't want to be edited by an user, base64
@gentle mauve I would suggest to use another plugin, like MyCommand.
Is there an easy way to do this? Or do I have to write my own functions?
how would commands work?
Here it serializes an entire "inventory", but you can just extract the per item logic for your usecase
I don't wanna steal code lol, also I need to learn :)) Was hoping for a spigot function or something. But thanks anyways!
Well not really stealing code, just showing you which methods you can use, and then you can write the use case specific functions for yourself
Yeah, ok. Might take some inspiration if I get stuck :)). But I don't wanna copy paste.
Thanks! 👍
Ok, so I managed to come up with an output function with some google help. And I didn't realise there would be so much text. I am worried that reading and writing this much text often might cause lag. I do not know how this way of reading and writing itemstacks compare to the other one in terms of efficiency, but is there no way of like getting an itemstack from the class itself. From something like ItemStack[@83h4823h] (or however they look) I mean?
no
Frick, ok. What is more efficient then? Base64 or "regular item stacks"?
that's just the location in memory of that object
What's the use case for what you're even doing
Uhm sooo, anyone has some examples of when I should have 2 different plugins and when it can be in one single plugin?
functionality
I have some custom items for my plugin. And for each item you have the option to allow the item to be "soulbound" ish. Meaning if you die, the item will stay, even if keepinventory is off. So I need to save the itemstacks somewhere, and I do this in a .yml file since I want to save the data even if the server is shut down. So every time a player dies with an item that is "soulbound" the itemstack has to be saved to the config file, and once they respawn the file is read from and the data deleted.
In what sense
Why not store it in a map, and if the server is shut down while the item is stored, write it to a file, and once it's enabled store it in a map again
I usually think like, what is the plugin about? Is it about ranks, then don't add a scoreboard, provide placeholders but nothing out of that. Otherwise it will be to much in one project imo
plugin 1: manages claims,
plugin 2: creates rainbows,
two completelly different things, might get unorganized if you bunch them together
What about an essentials like plugin and builders tools?
but I mean if done right, you can split them into modules and still have a single plugin
I guess that would work. Was thinking of that first, but I was thinking of like blackouts and stuff. Tried to make the data save even if something like that happened. But now when I realise there is no good way to save data ig I'll have to do the map thing. However, isn't sql really optimized for this kind of stuff?
to be fair even writting and reading a file isn't going to pose many performance issues
Probably not, my brain just sees a lot of text and is like server gon be ded.
not really lol
but I mean you can use a lot of things to achieve what you want, using a db could also be cool
maps aren't persistent, what frosty meant, is to have one with all your items and save it (to whatever format you want) on interval / when the server shuts down.
It's me again 🙂
Now my code looks like this:
@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
try {
player.getClass().getMethod("addChannel", String.class).invoke(player, "minecraft:brand");
player.getListeningPluginChannels().forEach(s -> plugin.getLogger().info(s));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | NoSuchFieldException ex) {
ex.printStackTrace();
}
e.getPlayer().sendPluginMessage(plugin, "minecraft:brand", "FakeBrand".getBytes(StandardCharsets.UTF_8));
plugin.getLogger().info("Sent to " + player.getName());
}
Console output:
[15:56:43 INFO]: [PluginChannels] minecraft:brand
[15:56:43 INFO]: [PluginChannels] Sent to Feniksovich
I tried what you suggested and it seems channel was added, but it still didn't work. What am I doing wrong?
pretty sure you have to make the addChannel method accessible
Edited
get the method, make it accessible and then invoke
and that console message will always be there because it is located outside the try/catch block
Like this?
...
Method method = player.getClass().getMethod("addChannel", String.class);
method.setAccessible(true);
method.invoke(player, "minecraft:brand");
...
yes
what mc version?
1.18.1
Unbelievable
I looked into open source projects on GitHub and tried to impudently copy-paste the code to my project:
@EventHandler(priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
try {
Method method = player.getClass().getMethod("addChannel", String.class);
method.setAccessible(true);
method.invoke(player, "minecraft:brand");
player.getListeningPluginChannels().forEach(s -> plugin.getLogger().info(s));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
ex.printStackTrace();
}
// COPIED FRAGMENT
final ByteBuf buf = Unpooled.buffer();
final byte[] utf8Bytes = "FakeBrand".getBytes(StandardCharsets.UTF_8);
buf.writeByte(utf8Bytes.length & 0x7F);
buf.writeBytes(utf8Bytes);
final byte[] result = buf.array();
buf.release();
// COPIED FRAGMENT
e.getPlayer().sendPluginMessage(plugin, "minecraft:brand", result);
plugin.getLogger().info("Sent to " + player.getName());
}
This works fine, however it requires netty as a dependency
Earlier I used just "FakeBrand".getBytes(StandardCharsets.UTF_8)
Isn't netty included inside of spigot?
Without a separate netty dependency the IDE doesn't suggest to any import. ¯_(ツ)_/¯
is probably not exposed, Deerjump
So, my final cringy implementation without netty:
final byte[] bytes = "FakeBrand".getBytes(StandardCharsets.UTF_8);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
outStream.write(bytes.length);
outStream.writeBytes(bytes);
Output (the same as using netty methods):
[9, 70, 97, 107, 101, 66, 114, 97, 110]
9 = byte array length
70, 97, ..., 100 = encoded string
It just works
Is there any way to prevent Bukkit#dispatchCommand from appearing in the console? Regular commands I can use a LogRecord to hide, but it does not seem to work on "sudos".
So I'm using
Inventory inventory = chest.getInventory() instanceof DoubleChestInventory ? ((DoubleChest) chest.getInventory().getHolder()).getInventory() : chest.getInventory(); To get the inventory of a chest or a double chest but no matter what It only gets a single half of the chest. Any ideas why?
Have you tried using chest.getBlockInventory() instead? That is what I've been using
Only gives the single chest.
Wat, I've never used doubles. Thought that worked lol
Maybe DoubleChest#getLeftSide() and DoubleChest#getRightSide() can help?
I'm sorry if this is obvious, but I'm trying. Are you using the material import or the org.bukkit.block.Chest?
That still gets single chests but for either side. I need to get the doublechest as a whole.
Yeap
You can get block inventory, and the inventory of the chest next to it, then iterate over to add them together?
Can't you just unite them together further?
Shouldn't need to. Thats the whole point of DoubleChestInventory xD
^^^
I know, but if it does not work I mean lmao
I don't click links lol. Can you embed? or post to imgur.
Idk how to embed lol
I don't think tier 1 can so you can just use imgur then I can embed it.
don't need one
You don't?
no lol
I think I figured out why my method isn't working.
I save the instance of Chest and use that to check the chest every time so when you add a chest to create a double chest its still the instance of a single chest.
Yeah that was the case
Just added Chest = (Chest) Chest.getBlock().getState() to my getChest method.
Hi.. sooo. we used to be able to use this e.getClickedBlock().setData((byte)(data + 8)); aka setData with bytes, but rn, we have to use MaterialData which doesn't work the same way bytes work, and I wanted to ask how I can replicate the same thing but with MaterialData...
(add 8 bytes to data part)
And also, how can we compare them? since we used to also be able to just do if (e.getClickedBlock().getData() <= 7)
Yapper use Container if you can and only need the items
when having plugin with spigot and bungee support, how commands work on bungeecord? do i need to register them or what?
Using raw command stuff? Yeah I'm fairly sure you have to register them under the proxy class too.
Is there a way to use the time someone has been in a team or has been tagged for as a selector. For example, when someone dies they get put into a team and after 15 seconds they respawn so is there a way you can detect if a player has spent 15 seconds in that team so you can pick them to respawn?
Not sure if that made sense lol, ping me if you answer or want me to re explain it
You can schedule a runnable for 15 seconds once they die
That will only run something for everyone with that tag or in that team though…
Ideas for new plugin developer what to make for my first plugin?
Is there a good way of simulating a block being broken by an item? I have an item with a veinminer ability and want to simulate fortune with it. Should I just get a random number in these: https://minecraft.fandom.com/wiki/Fortune ranges depending on level or is there a better way?
You can use the World#breakBlock(Location, ItemStack) method (iirc it's called something like that), and it'll apply the enchantments accordingly iirc
Ok, found it, I think. It was Block#breakbNaturally(ItemStack). Though it is a boolean, so I can't get the drops easily. Guess I will have to live with that. Thanks!
I'd suggest you to make a chat plugin (which lets you enable/disable coloring, change colors, a GUI would be a plus), then follow it up with a staff chat (such as, toggling sending/receiving messages, ensure it's locked behind a permission node, etc)
If you mean using a config file that might be too much. I did almost exactly that as my first plugin, and I struggled hard. Maybe I was just stupid, but I found it very hard to use the chat in my first plugin, partly because it can be hard to get feedback. I would instead suggest doing something like, simple commands. Like hello world or spawn a mob, stuff like that. To understand what you are doing and get a grip of Java. If you understand Java, maybe try to change the block a player clicks on? Then, once you understand the basics, try making a staff chat like Tofpu said. It is hard to say what you should start with, if you know Java do what Tofpu said. Otherwise, consider my suggestion. Also, some youtube tutorials are good imo. @lethal plaza
struggling is part of the learning process
So I have a plugin that has both a fabric and a spigot portion. How do I shade them together into one jar in gradle?
is there a non-hacky way to do it that doesn't involve specifying full paths
what for?
what's the issue with combining them?
is that not clear? Like what if you accidently loaded a class that isn't supported by the current platform
and its a fuckmess to handle and everything
just make them separate
will make your life easier
mhm
I do
I'm not using it yet 🥲
I need to refactor things to use the same codebase
there's just too much differance atm
mf-gui will fix that hopefully 😄
anyway, got it
it seems like it'd just be more convenient not to have different jars
._. okay
you can get the drops by using Block#getDrops(ItemStack)
i have a problem, On my Discord First Creator (OWNER) Account Has been Deleted, And i want to transfer on my account, i have a administrator Permission, i have to send messages 2-3 Times But i didn't get any help, anyone can help me?
this isnt a discord support server
this server is for minecraft related stuff
Where i can get help? :// i have to submit 2 Or 3 Messages
Where i can make live chat?
This server isnt related or owned by anyone that works at discord
if you want discord support you will have to email discord
i did it but i didn't get any help :/
About 2 weeks
I would have them as separate jars personally
Man I'm really liking fabric...
if I ever make a public server again, I might make it with fabric (server-side only though, no client mods)
heck https://github.com/Patbox/polymer is like amazing
it lets you make server-side items
that the server thinks of as modded
with a vanilla client
ooo that’s really cool
Looks really nice yeah, specially if you combine with things like https://github.com/astei/krypton
I think there is another one that gives better lighting performance too
Krypton!!!
'tis my plan
I think running a non-bukkit server would be kind of a relief
I'd have all sorts of problems, sure
and probably nowhere to go
but it'd be a relief from the bukkit ecosystem
and I could use papi soon™️
the best lighting mod is already included in paper
but it will make me not rely on outdated things updated by noone
Is there a way to join a vanilla server with a modpack instance?
I have a bungee server with a vanilla hub on it. (Running spongeforge egg). But i keep getting disconnected when i try to join with the error: 20:18:20 [INFO] [Extech] disconnected with: IllegalStateException : Too many registered channels @ com.google.common.base.Preconditions:502
where is the net.md_5 bungee api in 1.18 jar?
https://paste.helpch.at/onowerakus
So, I have this vouchers plugin and someone came with an idea to add different redeem types (for example, EAT would require to eat the voucher and for this I would need a PlayerItemConsumeEvent listener). I thought about making a small system where I could register a listener by calling a method, give it the functions required to access the data it needs (player, the item involved in the event) and then call a method that will do the rest. Do you guys think this is a good idea? 🤔
Personally I’d have all the listeners registered for each thing, and then on event I’d check if what they’re using / interacting with is a voucher, if so, do the checks accordingly
Any ideas on the Protocol Lib angle object?
I didn't find any objects named like that although the documentation defines it as Angle.
Is it supposed to be Directions?
I want to use a console filter for my plugin as it can get very spammy when you do certain edits. But my filter does not seem to register commands, any idea why this might be?
When you use #add() is it a way to update redstone like comparator? or do I have to get blocks around location and update that block somehow?
What #add()?
add items to inventory
I not "update" as normally do in minecraft. I don´t know exactly if it exist in spigot api or need dig into nms.
ah
Is not biggest issue, but nice if it was a solution for it.
is there a method to get the materials that an enchant is compatible with?
Enchantment#getItemTarget() (EnchantmentTarget) is prolly the closest you'll get to it
that sounds like a little xy, I suggest you start looking there to see what fits your needs
that reminds me, is there a method to get the materials that an item meta type is compatible with?
Any ideas what method to make animations ?
Should I go ahead and use scheduler built in, not really sure how performant it is..
ItemFactory#.. something(ItemMeta, Material)
can't remember the name
not check whether a material is applicable to an item meta, but a list of materials applicable to a specific item meta type
xy: I want to print out a list of compatible materials if a user tries to edit itemmeta-specific values with an incompatible item
I’d be fine with (and currently have) a custom method for this, but was just wondering if there’s a better way
do you already have the itemmeta?
yeah, it’s provided upon user command (the only time we’d even need the compatible materials)
tbh I’d be fine with keeping what I’ve currently got. was just curious if anyone had any better ideas
thx for your help tho 
Is there something like an interpreter already for color codes so i can easily translate stuff like &2Text to CHATCOLOR.DARK_GREEN+"Text"
:what:
d;spigot chatcolor#translatealternatecolorcodes
@NotNull
public static String translateAlternateColorCodes(char altColorChar, @NotNull String textToTranslate)```
Translates a string using an alternate color code character into a string that uses the internal ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r.
altColorChar - The alternate color code character to replace. Ex: &
textToTranslate - Text containing the alternate color code character.
Text containing the ChatColor.COLOR_CODE color code character.
Legit forgot what the method was called, went to go check GH to find it lmao
Big thanks
Hey i have a small problem with my indexes + maven, basically i have a multiversion plugin i made but i cannot compile it, i added 2 different spigot dependencies to maven but the material class is still from 1.13+ and i want to use 1.12.2 and 1.13+ material class, how do i do it?
Hi. How can I fix this issue? Kinda forgot lol, isn't it with utf or so?
-Dfile.encoding=UTF-8
ty
- you can't do that
- maven is the problem
god why is Mushroom stems, etc so difficult to get in 1.12.2
wat
like, we don't have the id and data systems anymore
soup?
🤷
OH
like, barriers, mushroom stem, oak wood bark
mob spawners
end gateway
etc
you could get those using id and data
yeah you just play around with them numbers lol
but in 1.12.2 that changed
you mean 1.13?
no, 1.12.2
uh? how do I get a material by id and data then?
couldn't find anything about that
maybe I am just blind
getMaterial(id) doesn't support data (byte)
the material is just these
then you modify the MaterialData
Mushroom is the MaterialData, you'd use this method to change the texture https://papermc.io/javadocs/paper/1.12/org/bukkit/material/Mushroom.html#setBlockTexture-org.bukkit.material.types.MushroomBlockTexture-
but I need a Material, not MaterialData
okay wait...
I am totally confused rn
xd
it's a single Material
the "block type" so to speak
the MaterialData defines its properties
Material.BROWN_MUSHROOM
such as texture
this is a material yes
sanest solution
kinda stuck at 1.12.2 for reasons
I wish I could switch
that's the mushroom item you collect, not the large block
those are the large blocks #development message
which one is which uh yeah 
[16:06] Emily: then you modify the MaterialData
[16:07] Emily: Mushroom is the MaterialData, you'd use this method to change the texture https://papermc.io/javadocs/paper/1.12/org/bukkit/material/Mushroom.html#setBlockTexture-org.bukkit.material.types.MushroomBlockTexture-
and what about them "don't work"?
Mushroom is the MaterialData
or wait is the end the byte?
uh but it worked?
(material being Mushroom)
the second argument is the data value
my god are you purposely ignoring what i'm typing out?
no
I am just not understanding
where you want me to go
or what you want me to realize
Mushroom is the MaterialData
create a Mushroom instance
Mushroom extends MaterialData
@worn jasper do you by any chance make scripts in Skript
5 years ago yes lol, if you think SK in my name is mentioning skript it's not xD
it's mentioning SK Gaming
and I already figured another way of doing it and even better
cool
Is there any difference between getConfig().getList("key") and getConfig().get("key") if key points to a list?
well, get returns an Object
d;spigot configurationsection#getstringlist
@NotNull
List<String> getStringList(@NotNull String path)```
Gets the requested List of String by path.
If the List does not exist but a default value has been specified, this will return the default value. If the List does not exist and no default value was specified, this will return an empty List.
This method will attempt to cast any values into a String if possible, but may miss any values out if they are not compatible.
path - Path of the List to get.
Requested List of String.
and u should use this instead
or for ex #getIntegerList
getList and get is there in case you serialize your own stuff
but is the object that it returns just a List?
you'd have to cast it to a list
if you did ```java
List<String> list = config.get("path");
it would error
yes but List<String> list = (List<String>) config.get("path"); would work?
yes, but you should use getStringList instead
Caused by: java.lang.NullPointerException: Cannot invoke "com.leonardobishop.quests.common.quest.Quest.getId()" because "quest" is null
Find where "quest" is defined in your code, it is null
I don't recall using quest as a variable
Stacktrances are pretty easy to read, especially if you run your server through IDEA, you can jump to parts of your code from these references (ClassName.java:line)
QuestsAlternative:67?
67 line number? that's a // out line
Cant tell much without seeing more than 2 lines of code. Follow the stacktrance and see where a value could be null
that isnt telling us much either tbh
since the lines I gave you is basically the whole thing, it hooks into quest plugin and gets info, no clue what thier code is
https://paste.helpch.at/uyuveyaseb.java i dont really know what im doing but does this seem correct? i dont fully understand how relational placeholders work
Does it work?
no but i dont know if thats an issue with my code or TAB
ok so doing /papi parserel AkiraDev AkiraDev %player_protocol_version% just returns the %player_protocol_version% back to me
U should just try % AetherPlaceholders_player_protocol_version%
nope
i dont understand how these work
it should be the placeholder that max provided (%aetherplaceholders_player_protocol_version%)
check that your plugin actually shows in /papi list and that you're registering the placeholders
how do i checkif ive registerd the placeholders, my expansion shows up in papi list
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
yes but that don't work with my plugin
public void playerJoinListener(PlayerJoinEvent event) {
event.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("welcome to the server"));
}
this is the code that I have but it is not working and yes I registered the event and I did implements Listener
@EventHandler?
yes , sorry I already found the problem I did register the event in the wrong place.
||System.out.println fixing the error||
btw 😄
how do you protect your API keys if they're sent as part of the request URL
Use header + https
Thanks mate.
wasn't plugin related lmao
should've done it in #dev-general my bad
Can still be revealed by project decompilation
👍
Yeah dude! Hope you've been well mate.
Ive been fantastic mate, hope same back
Yeah mate, me and my gf had a kid 🙂
Hello, I would like to make Minecraft server from scratch as learning project, I know this is too general question but, how to start? 😄
by regretting your decision
no thanks
oh no
ooo thank you
xddrypton
why 
🙂

My condolences
why 
Because every single from scratch mc server that ever started has never gotten anywhere
but for learning its good thing
i think
make a json parser

even krypton is in its verrrry early stages
so if you're writing one in a new language
i'd recommend something easier
+1
You wrote worse wrong
If you don’t know any networking gl
i know just little thats reason why i choosed making server xd
why
Custom servers take a while
my current goal is
Been working on one for a little over a year now. Somewhat close but really not
just move in flat world without other entities
Custom servers take an infinite amount of time, they never seem to finish
Your goal should be to login
I haven’t seen any used for good purpose, or for big servers yet
ye ig
Because they never get finished
Mohist
🤔 how is Bukkit made? its just edited Vanilla?
yes
You can totally make a custom server with spigot api lmao
well now that you edited it the answer is no

Nms fork
not my shit fork
yaml is good for a home plugin right?
As long as you load it all into a map onenable
isn't that kinda risky?
in terms of if the server crashed
How is different GUI for different chest menu's made?
Yessir you could also just load in there are with the playrtb
In there home with the player
Use any database
Or redis
I’d you could write to your file every so often in case of data loss. Too many options
Would anyone be able to take the time to teach me how to use the fabric OR forge api?
okay thx
in terms of performance, is it the best?
basically use the fabric wiki thing
and trial + error
and their discord server is quite active iirc
thats all
😛
the fabric wiki has A LOT of documentation for many individual bits on how to do various different things
like, A LOT
yeah its very much nice
the community is, eeh it depends on who chooses to help you in my experience, but most of the time quite positive
Forge in other hand is a fucking cesspit
Using mojmapped NMS,
what's the issue with this:
((CraftWorld) world).getHandle().setBlock(new BlockPos(x * multiplier + mx + chunkCoordinate.getX() * 16, y * multiplier + my, z * multiplier + mz + chunkCoordinate.getZ() * 16), ((CraftBlock) cloneBlock.clone()).getNMS(), 2, 0);
it just freezes in it's tracks
a simplified version is
((CraftWorld) world).getHandle().setBlock(new BlockPos(0, 0, 0), ((CraftBlock) cloneBlock.clone()).getNMS(), 2, 0);
is it running async? 🤷
also note that if it's running async, it might not show errors in console
Executors.newBlah() for example
at least for me it didn't 🤷
emily
i had to wrap it around a try/catch
I see
it just freezes
is this a referance to something?
I spent more than that on this
'cause you were using it wrong
lmao
99.999% sure
probably more than an hour actually bc it happened in another project too
(and plus, u shouldn't modify the world async)
🥲
is it possible to take chunk snapshots async?
that was my assumption
cool
Idk though, some java is still like black magic to me
so I wasn't sure how that works
fun main() {
val executor: ExecutorService = Executors.newSingleThreadExecutor()
executor.submit {
println("a")
throw IllegalStateException("test 1")
}
executor.submit {
println("b")
runCatching {
throw IllegalStateException("test 2")
}.exceptionOrNull()?.printStackTrace()
}
println("start")
Thread.sleep(2000L)
println("end")
}
start
a
b
java.lang.IllegalStateException: test 2
at me.dkim19375.project.TestKt.main$lambda-2(Test.kt:15)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
end
¯_(ツ)_/¯
execute instead of submit
o
submit returns a Future, that's what you use to either a) get the result or b) handle the "queued" exception
ty
google says submit 😩
so ive been using it all this time without knowing i have to use the future
at least most of the results say submit
ic
you use submit if you need a Future
you'd use a Future if you need to queue some sort of callback or get a result back from it
or handle an exception thrown by the task outside of the task itself
watch out: Bad code incoming
mutes channel
basically I have this static function that generates an UI Inventory and has the player open it. It just doesnt work. Does anyone know whats the problem? There are no erros in console.
https://paste.helpch.at/urazotuzoz.cs
Static generating Method (pls dont bully, its 1:57 am and im just developing whatever crosses my mind)
if(event.getItem().getType().equals(Material.NETHER_STAR)) {Utils.getChooseClassInterface(event.getPlayer());}```
Did you log before you call Utils.getChooseClassInteract(event.getPlayer()); to see if it's even making it there.
Maybe the event isn't behaving how you would expect.
yes. the "player.sendMessage("opening inv");" is my debug and it is being called
That would have been good to add 😛 "It just doesnt work" made me think its not getting there.
Why do you do 3*9 
Is this for like 1.8 or something?
like if I want more rows I just gotta increase that 3
its 1.12
I basically copied over another function I used in the same plugin so the generation should work in theory
I can send the working function, only difference is that it gives back a inventory and the listener opens it, but even when I had it with this function it didnt work
https://paste.helpch.at/omixohewim.cs other function, you can see its basically the same
if(event.getItem().getType().equals(Material.EYE_OF_ENDER)) {event.getPlayer().openInventory(getNewCompassInterface(event.getPlayer()));}
only difference is that its being called like this
if I wanted to use placeholders from other plugins I would need to hook into papi right?
Hey
Is it posible to make a clickable scoreboard?
Like that you see lobby 1 and when you click on that text you see an overview in a gui of all available lobby’s or your player just executes the command /lobby when you click on that text in the scoreboard
no. There is no events associated to the scoreboard
Oh so there is no sollution how I could achieve this?


