#help-development
1 messages ยท Page 185 of 1
well i'm 19 and i think i sound like 19
someone has experience
How do you not have an accent
cmon man
event.setCancelled(true);
player.closeInventory()
i try
๐
Does your redwool one work?
HumanEntity#closeInventory is the only way to close a displayed inventory to a player.
I hope you're not planning on splitting that to get the individual keywords
looking thro sqlite impl
wait that's in the impl?
yep
๐
Welp, not gonna deal with that, gonna go back making an ALU with logic gates, cya
Inventory.getitem(material.iron).remove();
bruh private and public possible for a default method in an interface, but protected not ๐ค
Why would you need protected methods from an interface?
https://www.spigotmc.org/threads/errors-while-trying-to-use-spigot-instead-of-spigot-api.576216/
I'm not retyping it
How would a private method differ from a protected method in an interface? At that point you should probably be using an abstract class
I still find a rare use case for private methods in interfaces
find out that i can just access it when it has no access specifier
im feeling like a noob now
if (Message.lastmessaged.containsKey(uuid)) { why is this check failing? im pretty sure there is that object in the map.
".lastmessaged" I think it's .lastmessage
no
its not
i have a hashmap named "lastmessaged" that stores last messaging players. "Message" is a class name
why do you need spigot instead of spigot-api
how do i get the block the player is looking at?
and why are you coding on Java 8 for mc 1.19
player.getTargetBlock(null ,10);
10 is search radius, so if block is 11 blocks away method would not return it
ahh ok
i have a bukkitrunnable which just runs code once, but i want it to run multiple times, but i also need to be able to run the runnable whenever i want, the bukkitrunnable has a .run() method but a bukkittask doesnt, any way around this or smthn?
then use the runnable?
BukkitTask bukkitTask = bukkitRunnable.runTaskTimer(plugin, 0, 1);
int taskId = bukkitTask.getTaskId();
I'm doing java 17
if I pass in "" as a permission to hasPermission(String) would it return true or false?
is there a way to add variables that are directly linked to the individual player?
basically i have been using the players XP as a variable that I can change and then read if statements from, and wanted to know if i could create a variable directly into the player class?
Make a wrapper
bros bout to learn what sessions are
uh oh
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
go ahead
fun
DAMN I TYPED THAT AS MY SONG SAID IT
but basically
you can't edit a class's functions unless you implement it yourself
which is annoying
Your song saying learn Java?
you could just do
Damn song
ManaManager.get(player);
nah
Mercury - Acts 1 & 2' is out now
https://ImagineDragons.lnk.to/Mercury
Imagine Dragons - Bones
https://ImagineDragons.lnk.to/Bones
Shop Imagine Dragons: http://ImagineDragons.lnk.to/Merch
Sign up for email updates: http://smarturl.it/ID_Email
Listen to Imagine Dragons on Spotify: http://smarturl.it/ID_Discography
Catch Imagine Dragons on to...
It said "go ahead" as I typed it
I I I got this feeling in my soul go ahead and throw your stones 'cause there is magic in my bones
@fluid river
oh
it's simple
you didn't install the maven repo in your local repo
so it tries to find it on spigotmc.org
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/permissions/PermissibleBase.java#67-86 false if that permission doesnt exist ig
you just need to install it in your local repo
Where do I download it
will return true if player is op tho
also localrepo do you mean spigot-mc?
no
local repo is located usually
C:\Users\user\.m2 windows
~/.m2 linux
yeah
What do I download?
I ran it already
how did you run it
java -jar BuildTools.jar
Yeah I copyed the command from that
thats exactly what I did
oh alr
Java Version: Java 17
Current Path: C:\Users\ethga\Downloads\BuildTools.
*** Could not find PortableGit installation, downloading. ***
Starting download of https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.1/PortableGit-2.30.0-64-bit.7z.exe
Downloaded file: PortableGit-2.30.0-64-bit\PortableGit-2.30.0-64-bit.7z.exe with hash: 6497e30fc6141e3c27af6cc3a081861043a7666dd54f395d47184e8eb75f5d61
Extracting downloaded git install
Is this a good start?
o its working- I think
uh it errored and closed
alr
How can I check if the player entered a new chunk?
there was an event for it
nvm
just use move event and check pre chunk and curr chunk
How
Please use the spigot help development as your last resort. Refer to https://www.spigotmc.org/threads/chunk-enter-event.376021/
Can you give me a code example?
What?
Dude, help development is to help with development
what do you think this it?
says the 3 other people who gave me that
It's not that hard, you can use your IDE's auto-complete to figure it out in a minute
Those people where wrong lmfao
#help-development is for, well, help with development
?paste
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?paste
?tas
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
and some more
can you copy the url?
It just gave me https://paste.md-5.net thats why I said I copyed it wrong
How can I uninstall buildtools (To try to reinstall it again)
Because I think it messed up my maven
I cant use spigot-api anymore
Should I just delete everything inside of C:\Users\ethga.m2\repository\org\spigotmc?
and than reload maven?
what;s the connection between "your maven" and build tools
because it installed alot of files and I think it did something with maven
bt basically use maven to download sources
it doesn't modify anything on your pc
just downloads sources and build jar
I need help with "Cuboids". I have this code: ```java
for (final Block block : cuboid.getFace(Cuboid.CuboidDirection.South).expand(Cuboid.CuboidDirection.South, 1)) {
Bukkit.getScheduler().runTaskLater(BasesPlugin.get(), new Runnable(){
@Override
public void run() {
block.setType(Material.AIR);
}
}
and how is that connected to your problem
idfk
you don't need buildtools to code and compile plugins
download paper for your server and test on it
ik but I want it to make npcs
you want what to make npcs
hmm
oh
the installation process is too difficult
CitizensAPI ๐
I like to challange myself, to only my plugins and no apis of anybody elses
besides plugwomen, vewwy useful
ill follow those steps, step by step
try reversing the ops
or smt
like expand north?
When it finishes, what do I change my pom.xml ?
persistantdatacontainer
or a wrapper
It doesnt tell me anything specific
yes
copy paste pom xml from website to ide
most of it
free java lessons
;-; Where do I paste it in the pom.xml
i guess you need to figure it out yourself
use some logic
Analyse
umm
these are wrappers yeah
primitive type wrappers
but you can wrap objects
public class PlayerWithData {
private Player player;
private int mana;
public PlayerWithData(Player player) {
this.player = player;
}
public Player getPlayer() {
return player;
}
}```
https://paste.md-5.net/ageganejuk.xml
Just tell me yes or no if I messed it up
does your IDE show warnings? @wary topaz
if no then you didn't mess up
well you wouldn't have errors if you just added dependencies and they loaded successfully
i still don't get
why Ethan uses Java 8
for 1.19
well
there is a flag
I dont use java 8!
which forces your server to run on java 8 even if it's 1.19
I use java 17!
backwards compatibility enjoyer
look closer
17
thank you
haha
buildtools is still doin its thing
I want to make a list of constant letters that i can pull from for something how would i do that
oh "Thats good"
List<Character>
Thatnks
i want to make something and it needs constant lettrs
??
i want to change messages and i want to check if they have a constant letter at the start of the word
if your letter represents something from bukkit you'd better have FunctionalInterface or HashMap
i dont understand ho whtat works
gonna do code review
It's regex
basically checking if first letter is A or B or C
gocha
By adding another |Letter you can add more letters
if i wanted to chech the second letter would it be String.substring(0,2).matches("other letter");
1, 2
why that?
first number is inclusive
second exclusive
0 is first letter
1 is second letter
(0, 1) represents letter with 0 index
which is first
(0, 2) would represent letter with 0 and 1 index
so three would be (2,3)
yeah
declaration: module: java.base, package: java.lang, class: String
map of Queues and types xD
why don't you make a Colorizer util class tho
to not write translateAlternateColorCodes everytime
here it is
tagged
with static import you can avoid writing class name when calling colorize method
how would i remove a letter from text
you can't remove just letter
you can use string.replaceFirst("letter", "");
or replace all letters with
nvm i got it
or replace letter with given index to ""
int x, y, z; ya know
tho you should probably pay attention to varargs
not ArrayLists only
Is there a way to make an entity walk along a path like the one in this image?
NMS
PathfinderGoal
Player...
args
sry messed up
correcet me of im wrong but it hasnt been taken out ei its just a hollogram?
idk im new to this so
Is there a good tutorial or docs on all of that? It seems very complex to figure out
I had to rerun the buildtools as my computer had a mandatory update
ask @old jay
he worked with pathfinder goals
Protip when working with NMS you can often use Fabric and Forge guides
this isn't an improvement
and bonk
actually is
I want to bonk whoever wrote the BlockExplodeEvent code
preprocessor would eat this faster on compilation
1 nanosecond compilation time improvement
wow
๐
except it screams "beginner dev who is trying to use less lines cause less lines = better code"
true
lemme take a look at this
am i beginner dev?
i assume u mean the impl olivo
Yes
i dont know, and didn't say that.
is there a event for fallingSand turning solid?
yeah
i couldnt find it?
BlockForm probably
its like blockToFrom or something
just go to javadocs and search From
it has a terrible name
one of these
ye
the latter
they need to die
Do you see the problem?
straight to capital punishment
i think thats for checking if sand needs to fall and turn into FallingSand
declaration: package: org.bukkit.event.entity, class: EntityChangeBlockEvent
i mean its just horrific with regards to everything. Like this is the same thing its just with a different constructor...
yikes that's very ugly
๐คฎ
So you missed the major problem the event is fired after the main explosion calculation
This allows it to get the blockList however it also means entities will be damaged and get kb even if the event is cancelled
yeah... i didn't really think about the fact that finalizeExplosion is called after explode
Oh and the exploded block will be gone if cancelled
yeah, this wont be fixed though as it is expected behaviour now
Also also the getBlock method in the event will always be air
Since the block is broken before event
So you have no way of knowing what exploded
ez
Beds and respawn anchors
what is a respawn anchor lol
๐ต
i see
A block that allows you to respawn in the nether by giving it glowstone
i just googled
bros stuck in 1.15
damn
i was about to blast mojang for using their own custom MathHelper.floor method but then realised that Math.floor has like 3 method calls before some extensive logic
what dependency did you add?
does look fine to me at a cursory glance
Anybody have an idea?
Is it possible to detect if a player was killed by a player if it wasnt direct? Like they get hit, and then fall off a cliff.
Try getKiller
getLastDamageCause()
getKiller only works if the "last hit" was from a player
so potion effects says it can only apply to living entitys, but is there another way to make it apply to other such as fallingsand?
and getKiller()
you'll have to listen to all damage events and then keep track of that yourself
Ah I assumed it returned the value that nms keeps track of
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
I'm like 80% sure that it only returns a player if the player actually did the "last hit" but I might be mistaken
I'm mistaken very often lol
listen for damageByEntity and damageByBlock
how is that even possible tho
to get damaged by block
What event is this from?
like when you are stuck in block?
nevermind
that's from Entity class
Block explosions
well i guess there is no way to check if somebody made block explode to klll you
That's what I worked on today
so just check EntityDamageByEntityEvent
Which is how I found the absolute mess that is the BlockExplodeEvent
and check if entity is a player
or entity is a projectile and it's launched by player
and so on
?paste
java cringe code in 3 2 1
don't worry
plz
If I were you I'd just use Citizens
no sir
Their API is great and you don't have to worry about version compatibility
public class Main extends JavaPlugin implements Listener, CommandExecutor {
@Override
public void onEnable() {
saveDefaultConfig();
getServer().getPluginManager().registerEvents(this, this);
getCommand("cringe").setExecutor(this);
}
@EventHandler
public void onCringe(PlayerJoinEvent event) {
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
}
}```
ayo wtf
i told him the same thing tho
citizens has a lot of good stuff which you won't even come up to when recreating it
also has own Event system
thanks bro, you're really good at discouraging people, i just wrote a command, i don't think you were good at first and didn't need help or if it's so lucky you, what do i have to tell you
i was answering myself lol
don't take this seriously
i also helped you already tho
with previous problem
inventing a bycicle heh
yes, thank you for this but the message you replied to was related to the fact that I write cringe code
ok
i'm not here to blame people for writing bad code, i offer FREE JAVA LESSONS instead(and spoonfeed sometimes)
what is your problem
you know what it is
Is that still net.minecraft.server.ItemStack tho?
wdym
i thought devs changed the way of handling NMS itemstacks
It gave me 2 options and I picked to import that
yessir
our java lessons have some influence i guess
?
you are not nesting ifs
tho you are
why didn't you make the same thing for player
if (!(sender instanceof Player p)) return false;
score.setDisplayName(getConfig().getString("Scoreboard-title")); what is wrong here?
because I dont set error messages until I fix the problom
do you have this line in config?
ye
what is the problem tho @quaint mantle
u used wrong imports Ethan
when i put text(not by config) they doesn't have problem
Caused by: java.lang.IllegalArgumentException: Display name cannot be null
is that actually in the config
that's why i asked the question lol
https://paste.md-5.net/orakocuqeb.java
Now what?
Try HAND
bet
and you imported wrong EquipmentSlot anyways
worked
you need nms
O I did?
How do I import the equipment slot?
org.bukkit.configuration.InvalidConfigurationException: while scanning an anchor
in 'string', line 4, column 19:
scoreboard-title: &fPolar&2MC
^
expected alphabetic or numeric character, but found &(38)
in 'string', line 4, column 26:
scoreboard-title: &fPolar&2MC
this is message in config: scoreboard-title: "&fPolar&2MC"
this is the only line
don't change nothing
did you save
reload what
server
ya know config is not resetting
on server restart
if you changed config in ide and replaced jar in folder
how does your config look like rn
in plugins folder
no, I changed in the config and did / reload
well now remove .HAND, then place . and look through suggestions
I did exactly that ๐
show your line 82
Thats my plugin name
does your BetterNPCS have getPlugin method
BetterNPCS.getPlugin().getNpcs().add(npc);
BetterNPCS is your class where you have this line
you don't have BetterNPCS class lol
what do I replace betternpcs with
Quests i guess
Cannot resolve method 'getPlugin' in 'Quests'
'getPlugin(java.lang.Class<org.bukkit.plugin.java.JavaPlugin>)' in 'org.bukkit.plugin.java.JavaPlugin' cannot be applied to '()'
in () place Main.class
Cannot resolve method 'getNpcs' in 'Main'
Main.getPlugin(Main.class).getNpcs().add(npc);
or should I do Main(Main.class).getplugin...
yea
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Will this work?
?paste
?
what is this?
i write this:
Score coins = score.getScore(ChatColor.WHITE + "Coins: " + customplayer.getCoins());
Please read error messages
show plugin.yml
Caused by: java.lang.InstantiationException: me.distruzionee.hubreforged.Main
yeah
show your plugin.yml
the config has nothing to do with it, the problem is of another class, I can send the code
the config is this:
#Thanks for download HubReforged โค๏ธ
#if you need support, contact me on discord Smo#8902
scoreboard-title: '&f&lPolar&l&3MC'
lmfao show your plugin.yml
not config
read
fduihsdyfh
srry
name: HubReforged
version: '${project.version}'
main: me.distruzionee.hubreforged.Main
api-version: 1.19
?main
1.19 plugin on 1.8 server
'ServerPlayer(net.minecraft.server.MinecraftServer, net.minecraft.server.level.ServerLevel, com.mojang.authlib.GameProfile, net.minecraft.world.entity.player.@javax.annotation.Nullable ProfilePublicKey)' in 'net.minecraft.server.level.ServerPlayer' cannot be applied to '(net.minecraft.server.MinecraftServer, net.minecraft.server.level.ServerLevel, com.mojang.authlib.GameProfile)'
https://paste.md-5.net/ehehudelim.java
the problem is this
customplayer.getCoins()
private final CustomPlayer customplayer;
public Main(CustomPlayer customplayer){
this.customplayer = customplayer;
}
public int getCoins() { return coins; }
oh
really?
what a shit
so new me.distruzionee.hubreforged.database.CustomPlayer()
sorry if i write a shitty
bro...
I'm just trying to learn it
it turns out they never troll, try explaining it again
this is like stackoverflow but better ๐
everyone used to say that to me so I get it @quaint mantle
everyone's just trying to roast each other ๐
thanks...
but why do you have to do this if you don't want to help me well but don't tell me I'm stupid
just remember, no constructor or final variables (constants) in your main class as long as you're operating in spigot/bungeecord
thanks, now i understand
you probably wont do that even outside of spigot/bungee ๐
i never use new Main()
To provide the singleton instance of your plugin use Main.getPlugin(Main.class)
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
@last temple are you sure about that xD He's learning the Framework ...
+1
Then just use regular dependency injection ๐
static sucks
You shouldn't use Guice if you don't have to
no'ones talking about static xD
ah well
you got a point
๐
can someone give me a template to create a npc in nms
nothing online tells me how to do it
๐ฆ
What can I iniaitlize my ChunkLoadEvent chunkLoadEvent = ????
declaration: package: org.bukkit.event.world, class: ChunkLoadEvent
Doesn't really help much
Im trying to make a check to see if its a new chunk
Not helpful either
pretty sure you can have an empty public constructor in your main class lol
Hey, so I'm getting an UnsupportedOperationException error for this code on line 107. How would I fix it?
What I mean by empty is parameters
ffor a runnable?
EntityDeathEvent
1.8 sucks ik
I get told that all of the time
"omg why use 1.8 when there's 1.19"
ik lol
would this work?
like why does this work but not the other one
this is why I made a private fork of 1.8, for performance, and so I can still have (almost) the same content as later versions
it makes 0 sense
is there a way to use blockbench to create custom models with spigot? sort of like what mcc island does, just wondering if blockbench can do it
btw they're not just bots that are standing still
they are moving, sneaking, punching, jumping, interacting with their inventory
how did you test this out
rust-mc-bot
what did you use to simulate players
pretty sick asf program
actually on that topic
you might be knowledgeable on this
iโm hosting an event and iโm presuming at least 200 people will be online at once
whatโs the โchecklistโ i should make for my server?
to prevent hackers, crashing, etc
i want to make sure it runs as smoothly as possible
Honestly
alright
Try and load-test the server
make sure you're using a version of spigot with no crash exploits
as that exists a lot in 1.8
And for hackers, try use a decent anti-cheat. I heart spartan is okay
heard*
@floral drum
Yo
can ya help me wit smth
I rewrote my code to make it an event, but how do I cast it to on enable as well
Make what an event?
https://paste.md-5.net/evohocakul.coffeescript
Anyone know what causes this error?
lamo
why is it coffeescript?
Are you using mojang mappings?
yes
version?
1.19.2
@gritty pebble might this work?
public void IsChunkLoaded (ChunkLoadEvent e){
for(Player player : Bukkit.getOnlinePlayers()) {
World world = Bukkit.getWorld("World");
Location loc = player.getLocation();
if (e.isNewChunk()){
try (EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(world))) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(BlockVector3.at(loc.getChunk().getX() * 15 + 6 , 40, loc.getChunk().getZ() * 15 + 6))
.to(BlockVector3.at(loc.getChunk().getX() * 15 - 6 , 40, loc.getChunk().getZ() * 15 - 6))
.build();
Operations.complete(operation);
}
}
}
}```
@fervent gate
if it is - make sure you're dragging the correct jar out your plugin
it should end with -remapped.jar
lemme try that yea
Once you've done that, just make sure you use this jar instead
alright
eeeeeeeeeee
Hey, someone knows what's the limit ?
how might I add a random rotation to my schematic before pasting it?
@floral drum
oop
mb
on accident
bro ๐
Can you help me with this tho?
Im trying to apply a random rotation to a schematic before pasting it
bruh ๐
Is the ItemHeldSwitchPacket still send if the client is an inventory?
yeah I give up with nms ima just use citizens api
::D:
well no one has docs on nms so i just gave up
- citizens api source code wont help me
me cry though as I have to add another plugin
Only reason why no-one has docs on NMS is because it's mojang's code
no-one wants to document Mojang's code for software they made
How do I install citizens api
By importing it as a maven dependency
https://paste.md-5.net/qoholenade.xml
*** Rep ***
<repository>
<id>citizens-repo</id>
<url>https://maven.citizensnpcs.co/repo</url>
</repository>```
***Dep***
```<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens-main</artifactId>
<version>2.0.30-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>```
can someone do it for me as I'm not really good at maven
Like it's confusing for me
Well you gotta learn to do it
Why are you excluding everything?
its in the docs
Installing Citizens 2.0 is easy. It is like installing any other Bukkit plugin. If you don't know how to do that, see below.
I see
Hello, I am looping through the contents of the top inventory and printing out the items; however, the item in the right slot doesn't seem to show up. Does anyone know why? Thanks.
Impossible due to how the compiler changes code
Yeah but it'll be good enough so just be aware of that
There's always a Posibility of it Decompiling your Code
not Exactly, but Enough for the Person to modify it as they want
there's people on this same Discord that lost their Source Code and Decompiled their own Plugin to Work on it
so you can do it
does anyone know how to generate schematics 2-3 chunks in all directions around a player?
Could not find artifact org.spigotmc:spigot-api:jar****:remapped-mojang:1.19.2-R0.1-SNAPSHOT in citizens-repo (https://maven.citizensnpcs.co/repo)
Try to run Maven import with -U flag (force update snapshots)
o wait
IT WORKED ๐ฎ
caps
but what is that erroR?
oh wait in project errors
anyone have any ideas why a bungee plugin is loading before its dependencies?
now my bukkit isnt working
Does said bungee plugin have those dependencies listed as such?
yes listed as depend
Then it's probably listed wrong. Can't really think of any other reason
Can someone send me there pom.xml so I can fix mine?
You can do it yourself lol
o true found one
so dependencies are just broken
how to generate schematics at a certain vicinity near a player?
Meh. It's not too difficult to deal w/ lmao
lol
Your only spigot resource lol
Not every decompiler is trash lol
I've got like... 5
Here's a different decompiler for example
but yea, anyone can easily just decompile a jar and work off the code lmao
decompiled kotlin looks kinda sus
the decompiler I used allows saving source iirc
it would just be a matter of throwing it into a maven project & getting the right dependencies lol
nope
Not really, it's just like any other project
Nothing special needs to be done
Not really special
And there we go @last temple
Compileable & usable project
So I'm kicking players everytime they join to keep them banned from the network, however, while it works it sometimes shows this screen
Anyone know how this can be fixed? All I'm doing is kicking the player when they join.
Anyone know how to calculate the distance from a player and fill that distance in with schematics?
Probably my last request here
that sounds like an awful idea
its going to be like a chunk thing
paste a schematic 1-3 chunk form the player
for this effet
right now its 1 chunk
help?
?paste
Sorry need this
No i needed it for my friend because im on my phone and cant read shit in chat

And forgot the link ๐คจ
at redempt.plugwoman.PluginEnableErrorHandler$1.publish(PluginEnableErrorHandler.java:22) ~[PlugWoman.jar:?]
plugwoman error
stop using plugin reloaders
just /restart
I did restart ! it gave me the same error message!@
I restarted than immediately ran the command, same error.
;-; ok
and never use again
oh i didnt know I had to do that
than theres no point of me making a plugin for this
then*
well you can shade the entire citizens into your plugin
how do I do that ๐
nvm than too difficult
Lmfao the whole point of using an API is so you don't have to shade the entire plugin in
Wait citizens cost money?
where
somewhere on plugin page on spigotmc
hey im getting this error
[ERROR] Could not pass event InventoryClickEvent to TestLab v1.0
org.bukkit.event.EventException: null```
entire stack trace?
um can I send it to you in dms
go ahead
What can my code in citizens api do that citizens cant do?
basically, whats the point of making a plugin with the api
Share your bycicle with others
so others don't have to invent it again
Citizens has A LOT of features
own event system
npc gear
and so on
and API for you to use
but what does citizens not have that the api can have?
for example a gui
thats one thing
The API allows you to access what they want you to
but theres another plugin to implement that
Within their plugin
i'm kind of getting what you're saying
also I do believe hypixel uses citizens too
i'm going to use the api to make guis and others, thank you
The reason they would if they do is they don't want to reinvent the wheel
API just allows to interact with your plugin on lower level
I have a JailsAPI plugin
so guys can jail players with code
not by command
or smth
on some event or when player send command he shouldnt
?scheduling
@quaint mantle
npc.spawn();
It's asking for a location, how can I set it to a specific coords?
wait nvm
I used the docs
What do I set this to
if (sender instanceof Player player) {
Inventory opentheguiinventory = Bukkit.createInventory(null, 54, "Example");
opentheguiinventory.setItem();
player.openInventory(opentheguiinventory);
}
return true;
How can I set the item?
you didnโt specify the item and the slot to be placed
opentheguiinventory.setItem(1, BLACK_STAINED_GLASS);
Cannot resolve symbol 'BLACK_STAINED_GLASS'
because you need ItemStack
Where do I put it
new ItemStack(Material)
opentheguiinventory.setItem(1, new ItemStack(BLACK_STAINED_GLASS));
Cannot resolve symbol 'BLACK_STAINED_GLASS'
it worked thanks
also if you want to specify a count of this item then do new ItemStack(Material material, int count)
also when youโre using methods/constructors please look their parameters so youโre gonna know what you need to put inside them
I am trying to execute a command through console right when a player respawns and the console says No player was found even though the command that is executed is correct and so is the player name in that command.
Any ideas?
like if I try to use give YTG667 minecraft:stick 2 it says No player was found
oh I delayed it in 1 tick and it now works
thanks anyways
how to fix
Could not connect to a default or fallback server error
On bungeecord
SmartInventory inventory = new SmartInventory(this, null, "test", null);
for(Element element : inventory.getElements()) {
if(element.getAction().isPresent()) {
element.setClickEvent(Optional.of(
event -> {
//do something
}
));
}
}
inventory.build().show(player);```
Guys, I made an API where, in the config, you can build an inventory. To each element, you can give one of the predefined actions for that inventory that are in an ENUM class.
Obviously after associating an action with an element, I have to associate a Consumer<InventoryClickEvent> with it and I was wondering if you guys had any better ideas than this
and would be labelled as malware
yeah since it contains a hardcoded playername on which the plugin reacts
with what exactly
.
I was talking about code-styling (?)
ah, well, i wouldnt set a consumer for each element
why not?
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if(event.getClickedInventory() == null) {
return;
}
if (!(event.getInventory().getHolder() == holder)) {
return;
}
if(event.getCurrentItem() == null) {
return;
}
event.setCancelled(true);
if(elements.get(event.getSlot()).getClickEvent().isPresent()) {
elements.get(event.getSlot()).getClickEvent().get().accept(event);
}
}```
seems to be the easier way to get this done
its unnecessary. why would you have each element basically the same consumer
thats just a waste of memory
rather give the entire inventory just one
or if you wanna be able to use the elements in the consumer, use a bifunction instead of a consumer
i just threw it in the room, no need to worry
how do I use it?
Yes okay, great, perfect, wonderful. But I mean, what args should I interact with in ur opinion.
Slot (Integer), Element, ClickEvent?
hm
how to make ore with spigot plugin?
what?
Did you mean something like that?
(Function<Action, Consumer<InventoryClickEvent>>)
inventory.setClickEvent(action ->
switch (action) {
case EXAMPLE -> event -> this.getLogger().info("Example action");
...
}
);```
If I want to store items in a custom container how should I persist that on restart? I feel like it'd get really sketchy as I'm attaching the container to an item how would I ever know where the item is to store it. Maybe I'm super overthinking it though
e.g. you right click the item it opens an inventory and you can store certain items in it
a database
try sqlite
yea my main concern would be how would I keep track of all these mfing things
well, so you have an item that opens an inventory?
yea

