#help-development
1 messages · Page 1529 of 1
but is Inventory is for GUI?
No
Inventory is the contents of a user's inventory
their items
I would recommend reading the docs
wait, i cant use the add()
Why not?
in intelij its red
Show me your code
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player){
if (command.getName().equals("cmdb")){
Player p = (Player) sender;
p.getInventory().add();
}
}
it's empty
Well you need to specify the item
you have to set an itemStack
in this case, .add(new ItemStack(Material.COMMAND_BLOCK);
Don't have my IDE so I may not have the ID correct
it work but it still red
What's red
I use 2Go personnaly but I have 32 in stock 🤷♂️
red?
for 600mb? hmmmm idk
1gb atleast
if you mean the line is red, you probably need to import something
only? i thought it would need more. my intellij laggs like shit
I have like 4 gb allocated to IntelliJ
where can i actually see how much it uses
nah you dont need alot alot but u can make it use more
allocate like half your ram to it and check task manager
what do you mean when in your premium plug say Moderated?
how do i allocate more
idk
f
:,v
@sullen dome IntelliJ, right?
yea
Click help > find action > type memory and press enter
i mean, i'm sure there was an option inside ij
That brings it right up
IntelliJ's find action feature makes it usable lol
like, i have 2048mb, ryzen5 3600, and my intellij laggs like hell
I can't be bothered to learn the settings ui
intellij ui is godlike
oh it is, but it's a bit of a maze sometimes
yea
but i couldnt use eclipse because of the ui... it looks so.... uuhhh
idk how to even call it
eclipse stinky
It really does feel dated using it
maybe thats why ij laggs? huhmmmm
sry to bother i am a noob and i want to learn more lore about the plugindev and i want to know how to use the plugin source and export to
a plugin jar
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
I made the mistake of learning Java through spigot
same
I had to unlearn a lot of shitty practices
i have been learn a bit and grasp rather
xd
to be honest
you know how long it took to unlearn using static for everything? xd
gooood
lol
Oh god
yea
i learned basic java
thats from the tutorials, i learned from
Oh god
before i tried spigot plugin making
i learned from spigot coding tutorials lol
This one horrible tutorial I watched
because reading is boring
Set me in my ways for a while
and i cannot really learn from reading, ngl
Understandable
if i have a src then how to export it
yes
do you use eclipse or intellij
What do you have, a jar file?
you use maven?
do mvn package (if you have maven and installed it)
to see if you do, check if you have a ui called Maven at the arrow
yeah
i still wonder how to reload that fucking project while running. starting the client takes like 5 minutes lol
what is that
Oh, you're making a client?
yea
run in debug?
well, re-starting
i actually do
but it does never finish building
when re-building
or it crashes my game. random actually
f
?
bug?
is testMethod used?
why are they both empty tho
i made them to show you the problem
do you call these methods anywhere?
i dont think you get what i mean
one sec
why does startGame says not used, but start doesnt?`both methods are never used anywhere
X is never used just means you never call that method from anywhere in the program. They won't even compile because it's impossible to reach them.
it's just an optical weird thing
yeah, but start is never used as well
but it doesnt show never used
are you sure you don't run it somewhere
ok
i think its a bug
same here. created 10 seconds ago
what if u make it asd and asf
why
wtf
idk
thats weird
ofc its weird
never happend to me XD
i mean
just finish writing your plugin. I don't see why we're talking about this.
it gives me this warnings on the right
and they look bad
ngl
one question tho
is that picture more blue, or more grey
i think my monitor is broken
why i cant upload any screenshot in this channel
no !verify
^
then cafebabe dms you
!verify
Usage: !verify <forums username>
just for seeing comparison
yea, my main monitor is probably broken
or the color format is weird
?
i have 2 monitors. and the second one has a way different color
i hate that warnings show up like right in ur face
i mean, i can't show it ofc. but on my main monitor, everything has much less contrast
yeah, thats why i hate intellij saying me never used
its annoying
the best way to fix this issue is to use the methods.
when open maven it show this
lol
you mean this?
no
no
Hello, so I have the constuctor variable EntityTypes<? extends EntitySilverfish> entitytypes so It's a silver fish so what should I put in? in the super
oh i see
idot
this
then w shoud i do
what are you trying to do?
wtf
xd
click this, https://i.imgur.com/DppquqU.png
enter package
when all the crate plugins are either bad, not updated, or paid so you make your own
xd
XD
why do people use maven?
bc its better than not using it
cuz maven is better
yeah, so stfu
because i have to for my client xd
same thing as maven but faster
is it like maven?
but yeah gradle is faster
I just download jars
it is?
am I a loser?
dont really feels like
what wrong with this
yes, big looser
my game needs 5 minutes to start with gradle
yes chew your a big looser
nothing went wrong @next crown
okay thanks guys
check the target folder for the jar
No, that's what I do, too.
why not using maver or gradle? i dont see any bad site on using them
I don't use dependency managers because I have only had pain trying to get them set up
Gradle > maven > manually downloading and importing jars
its not hard
you probs should fix those warnings but thats ok...
if you code spigot, there's even an intellij plugin called Minecraft Development lmao
oh
this plugin is very nice actually
that sets everything automatically up for you
gradle actually can get things from maven central so idk why u wouldnt use it but i guess its just not as user friendly as maven
i think i'll use the fuck for telling people you're right
duck is cool
i said fuck
what s the distinction from these
why did i say fuck. i wanted to say duck
Well, for me, gradle is blocked by my school district, and because if where i live, using their internet is better
so like, its a pain to download the gradle wrapper
well, they block it, so it cant download the wrapper, as to why its blocked, they're fucking idiots
is there an actual disadvantage to importing jars, or is it just harder?
i mean, i have a vpn, but doesnt work for that long at a time
disadvantage
your not gonna get the latest version everytime
major disadvantage, especially for opensource
the the on thats doesnt have original at the beginning
also its kinda harder well not really but i just like using maven
and you can import things from disk using maven
so why not use it
I have only ever just imported the spigot jar manually since I started plugin development. Would I need to create a new maven project in intellij and move the code over?
and ant is just shit
I just prefer maven, I can use gradle, I just choose not to /shrug
no
you can convert an existing project to maven pretty easy
Once you learn Maven or Gradle importing jars is just a pain honestly
ima go now
I went through hell and back trying to learn gradle, like a year ago
does it export jar like this frequently
maven is easier
since it uses the xml format
which is like english
XD
I just gave up with ever trying to use a package manager after spending like 3 hours on it
everytime you change stuff and want to test it, you need to export a jar
You can also use something called Renovate which automatically updates maven dependencies for you
maven is easier than gradle imo
well gradle config stuff is smaller for getting like things from repos
cuz pom.xml's are massive
af
well yeah but there smaller
yeah i see and if export jar usse this method frequently
yes, there are ways for debugging where you dont have to constantly export a jar and restart the server, its known as HotSwapping, but its limited in what you can do. for example, if you remove or add a method, you have to export a jar, but for quick changes, its pretty nice
whats nice about gradle is you can import maven dependencies
what I do, is just have a test server set up and running, and export the jar directly into the plugin folder, so I can just /reload and instantly have the newest build.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
extremely rapid development
I use ant plugin to copy the jar instead
I dont like moving it out
personally at least
With IntelliJ you can literally do a remote debug and set breakpoints as the plugin is running on the server
Ant is okay but it isnt that good
yeah, thats what i linked
we need maven to do caching lol
I only use ant to copy a jar ¯_(ツ)_/¯
What's ant?
cuz it does none of that shit
Ah
it says software tool XD
"Apache Ant is a software tool for automating software build processes which originated from the Apache Tomcat project in early 2000 as a replacement for the Make build tool of Unix. It is similar to Make, but is implemented using the Java language and requires the Java platform."
Isn't that what maven does?
no its different
can i change the path of export?
The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
yes
hold on, let me find the thing
<build>
<outputDirectory>/my/path</outputDirectory>
</build>
thank for your elaborate
<build>
<directory>my/path</directory>
</build>``` i thought it was this lol
theres a few ways, but its outputDirectory
outputdirectory: The directory where compiled application classes are placed.
directory: The directory where all files generated by the build are placed.
what
same thing?
no...
but dont you want every file from the build in another directory?
so you use directory right?
can someone explain to me how vectors, direction vectors, and velocity works n all
@next crown use directory instead of outputDirectory
in like baby boy terms
how much do you know about what a vector is?
ima go
bye
bye
ok well I know a vector is x,z values and a 3d vector is x, y, z
I dont think spigot itself differientiates
spigot has a 3d vector i think
but mostly confused on things like velocity and getDirection() and all
ye
i think, but I could be wrong, that getDirection() returns a unit vector facing the direction
The velocity of an object is the rate of change of its position with respect to a frame of reference, and is a function of time. Velocity is equivalent to a specification of an object's speed and direction of motion
Hey, does anyone know how to prevent the sign input dialog popping up when a player places a sign? The only solutions I've come up with involve NMS and I'd like to avoid that if possible.
right but when I use setVelocity im not setting it to a function of time, just a vector
how does this vector eventually go back to still
gravity?
do you have any written tutorials?
if anyone knows more definitely please do tag me
minecraft does it for you idk
dont make guesses because it doesnt help me understand
There are a lot of factors
hm I should make a small plugin that allows me to set my velocity and sends me an actionbar with my current velocity to see how its affected
setVelocity just sets your instantaneous velocity
not really, its just <directory>path</directory>
yeah but i think minecraft does somethings so it isnt like it teleports you like it pushes you
it can be changed by anything that affects velocity, i.e. gravity, friction, however the game calculates movement
cool
i mean the tutorial about Writing a plug-in of entry level
you need to set it every tick for it to be constant
so say I set my gravity to (1, 1, 1)
this means upwards, southeast
or say I set it to (-1, 0, 1)
this means southwest, no change to y position?
does anyone here have experience with fawe api on 1.16?
and say I set a runnable 1 tick later, with getVelocity, would that be it returning to 0 on all accounts?
yeah i think it would push the player and you mean setting the velocity?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I don't know how it is in cardinal directions, but there would be no change to y, that is correct.
ok so If I'm understanding this correctly
setVelocity sets the velocity, meaning it overwrites the previous velocity values
yes
ok now if I set it to (1, 1, 1) it will rise on all accounts to 1, 1, 1, then it will fall to 0, 0, 0 again?
nah that doesnt make sense
since its not like a coordinate its just a push
yeah
velocity does not correspond directly to the actual distance traveled
because it decays and changes from other variables
like, contact with the ground
or air resistance
im going to go create a plugin that allows me to set my velocity and every tick sends me an actionbar with my current velocity
I think I need a more hands on approach to see how this actually works
thank you snax
np
you could probably create a fairly accurate position predictor based on the delta of velocity between ticks.
that would be a really fun project
it's called when a block is destroyed by an explosion
yes
try just sending something to console
hm
Bug? 🤔
are you getting any errors?
Mind if i see your EventHandler?
@EventHandler
public void onSignExplodeEvent(BlockExplodeEvent event) {
List<Block> adjacentBlocks = this.getAdjacentBlocks(event.getBlock());
if (adjacentBlocks.stream().anyMatch(b -> b.getState() instanceof Sign)) {
event.setCancelled(adjacentBlocks.stream().anyMatch(b -> psManager.doesPlotSignExistAtLocation(b.getLocation())));
}
}```
I just have a breakpoint on the first line
So it should break no matter what
I'll add a println for giggles
Just do Bukkit.ConsoleSender.sendMessage("test");
Yeah, doesn't print anything
it's EntityExplodeEvent I think
For blocks?
For tnt and stuff it is
oh wait, is the tnt actually destroying blocks when you blow it up?
Yeah
hm
I'll see if the EntityExplodeEvent runs
It's EntityExplodeEvent
Unknown explosions
is there an easy way to get all blocks pushed by a piston event?
ah, perfect, thanks
There's also a retract one to
I need to hurry cuz my phone about to die soon I charged it for like 5 mins
And it was 16%
And now it's 13% 🤣
Once phones get to like 12% they go to 0 in like three seconds
Ok, I want to make an ability where a bunch of silver fish goes in in all directions. So, I would like to make silver fish go in a strait line from a location. So, how would I do this>
Valknet which is my fav host has amongus server hosting and more now before it was just discord bot hosting VPS hosting and MC hosting before
These are all the hosting it offers hmm yum
The vpses are pricy tho :(
F
What is a AMD EPYC 2nd Gen
Oof it's a little bit more expensive than where u got it from but I mean it says they use a amd EPYC 2nd Gen and that sounds like a good CPU
Is it me or does this look incorrect https://www.spigotmc.org/wiki/how-to-make-custom-rank-system/ just how its made
¯\_(ツ)_/¯
I mean look at this ```java
public void loadRank(Player player) {
String rankString = getConfig().get(player.getUniqueId() + ".rank");
Rank rank = (rankString == null) ? Rank.NONE : Rank.valueOf(rankString);
player.setDisplayName(prefix.get(rank) + player.getName());
player.setPlayerListName(prefix.get(rank) + player.getName());
ranks.put(player, rank);
}
public void saveRank(Player player) {
getConfig().set(player.getUniqueId() + ".rank", ranks.get(rank));
ranks.remove(player);
}
no
altho I personally wouldn't load it and apply on player in same method
that's 2 separate pieces of logic
they do not save the config on the saveRank method 😮
how to use this if i want to compile other plugin src
What does ConfigurationSection.getObject(String path, Class <T> clazz) do if there is something at that path but it can't be cast to the given class?
Cast exception?
the docs dont say it throws anything though? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/ConfigurationSection.html#getObject(java.lang.String,java.lang.Class,T)
does it just return null?
imported the bukkit Location, but my usage of Location yellow with this... anyone know why? Access restriction: The type 'Location' is not API (restriction on required library 'C:\Program Files\AdoptOpenJDK\jdk-16.0.1.9-hotspot\lib\jrt-fs.jar')
never mind it went away when i saved
event.player.velocity = Vector(0, 4, 0)
val task = Bukkit.getScheduler().runTaskTimer(this@STDuels, {
if (event.player.velocity.y >= 0) return@runTaskTimer
event.player.velocity = Vector(event.player.location.direction.x * .2, -0.05, event.player.location.direction.z * .2)
}, 0L, 1L)
(kotlin, but should be understandable)
Sometimes I randomly fall, without the slowness my velocity should give
It's also jittery, I need to fix this somehow
any ideas?
same again, save method says nothing, load method says never used. i dont even know why i bother about this, but Intellij should really fix this
(both methods are never used)
should i create a class for every command
yes
Yes
yes
they also have helper classes they use inside of those commands
this is how I do things, too.
It's easier to organize
I have one "command" with a bunch of branches
how does that go syntax wise?
I use a switch statement
For subcommand if you have a lot of subcommand I suggest you to have like a subcommand handler or something like that.
i usually create a class for every command too, but i almost always use a TabCompleter as well, and handling so much commands in one class. hmmm idk
ooh, TabCompleter
never heard of that
I will implement it
well yeah, let's you show specific args while typing the command
pretty nice
and i actually would like it if ALL of the public plugins would use them
so you can see how to use a command
Talking about TabCompleter, do you know why the suggestion doesn't show as I desired?
On args.length == 4 https://paste.md-5.net/xuzogoyufu.java
It doesn't show <amount> on the suggestion.
https://github.com/hawkfalcon/ServerTutorial/tree/master/src/main/java/pw/hwk/tutorial/commands
@silver wadi how I setup my commands
to make it easier
probably because there's no 4th arg lol
idk
thanks
The command is /mobcoins give virtual <player> <amount>
Yes, but args.length == 0 will return the command.
yea
confusing ik
lemme explain
/mobcoins give virtual <player> <amount>```
`/mobcoins = command, give = args[0], virtual = args[1], <player> = args[2], <amount> = args[3]`
and the args.length is 4 yes, because the args.length weirdly either starts with 1, or counts the command as 0.
I understand that part.
and on tabcompleter, you don't have that command. because tabcompleter obviously only starts on the first arg. commands have no tabcompleter, because it's a specific command
you cannot mistype a command
But it's showing the correct suggestion before args 4 tho.
It's not that confusing, you can get the command from both command and tab completer.
I just don't know why it doesn't show the correct suggestion in the args.length = 4
list of player name
actually you could try System.out.printLn(args.length()) to see what it says
and i see that i was completely dumb. you use args.length in tabcompleter, not args[whatever]. forgive me my lord
I'm gonna try that.
hey, for TabCompleter, is there a simple way to only suggest completions that match what they have already typed, or do I need to check it against every option?
i need in fact a larger mousepad. mine is 85x33cm, and still too small
you need in fact check every character lol
alright, I'll just do an ol'
for(String choice : choices){
if(args[0].indexof(choice) == 0)
options.add(choice);
}
I like to do something like this:
StringUtil.copyPartialMatches(argument, array of completions)
.map(Enum::name)
.collect(Collectors.toList()), completions to return to user ya know);```
that works too
other way around
choice.indexof(args[0])
@sullen dome I fixed it, the problem is i don't register the tab completer properly.
are break statements really that bad
wdym with break statements
just in general
you mean switch statements right?
??
what are break statements lol
why would they?
they jump you out of the current loop
ah these
why is that even a question
why would they be bad lol
they are crucial for breaking out of loops and continuing the method lmao
it's just used for controlling code execution
continue; is sometimes better
they are basically goto
not at all?
I know u lol
it's really depend on your code lmao
Yes I do
ok
Ur from minehut discord XD
im on a couple dozen minecraft related discords XD
how do i get a player object from a CommandSender object?
cast it 🙂
if you know it's a player
use instanceof to guarantee it is a player, and then cast it to player
hm?
yes
thanks
Player implements CommandSender
I need to find a use for continue lol
it is exceedingly rare you will ever need it.
I have never used or even heard of it in my ~5 years of java
lol
Lol
you can obviously write code without it but it does come in useful
if you've never used it you probably just haven't thought of using it
just use an if statement
i mean... yes
true; but it seems evil
i've used it in many projects 🙂
you are beyond saving
lol
How can I use maven placeholder in the plugin.yml?
for (Player player:Bukkit.getPlayers()) {
if (!(blockedNames.contains(player.getDisplayName()))) {
continue;
}
player.kickPlayer("your name has been blocked");
}
I made use of continue XD
for (Player player:Bukkit.getPlayers()) {
if(blockedNames.contains(player.getDisplayName()){
player.kickPlayer("your name has been blocked");
}
}
``` nope
for longer for loops it can be handy
but hey you dont even need a for loop for that anyway
or an if either
Ik but if u had to make use of it
xd, use continue will make it more cleaner ig.
How do I add a suggestion like this to my TabCompleter (the stuff on top)
Sorry if the formatting is wrong XD
I'm on phone
It's hard to write java code on phone
depends
well, for me at least
am i just totally dumb, or is this the most useless boolean that minecraft uses? wtf
not with the bukkit api
damn
makes sense to me
you can use either lucko/commodore https://github.com/lucko/commodore or if you want it to be done "properly", Paper API has some events you can use
Can you put colors in the suggestion?
yesn't
public enum Everyone extends Role {
Role_ID(Guild.getID());
public Everyone(String id) { this.id = id }
}
let me check
if you send that you get immediately kicked for illegal chars though
that was literally what i wanted to wite. it types the § when tabbing it
idk tho how it handles ChatColor
from either Bukkit or Bungee api
?
or is this using ChatColor
when converted to strings it's just § + the code itself
though lucko/commodore (more specifically, commodore-file https://github.com/lucko/commodore-file) is probably easier lol
wow, how do you do that?
commodore?
no
The whole Bedrock/Java edition thing feels like Microsoft is competing with the ghost of Notch, tbh.
just color codes
is there a standard for how to present command arguments in help?
"/lbb geturl [-h] [-cpp <chars per page>] <plaintext file URL> <book title>"
is this able to be understood?
I mean to imply that the [-h] and [-cpp] flags are optional, and that anything in <> is required
yeah that's usually how one does it
i would just deinstall the plugin
there isn't really a standard per se
xd
what
but <> implies required argument, [] optional and without any brackets a literal
ok cool
Ooh I found out u can open books for players with a itemstack
I don't remember it there before
Idk if it's 1.17 addition or not
@sullen marlin really needs to have docs for older versions
@quaint mantle is this a fake XD
yes
No not support them
Just have docs for old versions like paper
Like archives for older versions
Are they official?
the docs or the sites?
Nvm
?
that ip Made up of numbers
What query?
server ip
do you just want to ping it to see if it's up?
Socket?
What's query tho
yeah
INetAddress?
yeah like that
yes
I am writing an application where I need the IP address. I have a domain name and I would like to know how to get the IP address from it. For example, "www.girionjava.com". How could I get the IP a...
InetAddress address = java.net.InetAddress.getByName("some.thing.domain");
String addressStr = address.getHostAddress()```
is there a way to get the advancement name? if i do getAdvancement() it will be something like org.bukkit.craftbukkit.v1_16_R3.advancement.CraftAdvancement@6938472
but i want it to be like "Bed time!" or whatever the advancement name it is
Advancement names are pretty much handled client-side. so probably not possible
try .getKey()
o ty
Idk if that will work
hm i'll try it
it would let you identify it
yeah thats true tho
so you could do a switch statement
god
switch statement with more than 100 advancements
yeah
best way is probably getting the key, replacing _ with , and convert to lower/uppercase.
i can't get the key in an PlayerAdvancementDoneEvent..
it's .getAdvancement().getKey()
oh
it uses integers.. and theyre not shown on the website
yea
keybind components don't use "java keycodes" lol
can't you register the keybind identifier to the configured key name?
i mean, there's KeyEvent#VK_SHIFT, but thats not really what i need
i mean after all you are showing a keybind component
for minecraft they do
they all take in the manual keycode. so i need those integers. but i couldn't find any info on which keyboard-key is which integer-key
if you know what i mean
so it kinda worked
its giving minecraft:adventure/arbalistic
ah i c
there's InputMappings.getInputByName(string).getKeyCode() that returns an integer, but i dont really know what to put in as the string...
as i don't have any key list
idk what kind of decompiler you're using though but fabric's ff fork shows this :thonk: so they are gotten from those constants ig
mine is from mcp
so i guess fabric has another system
but this works. thanks my dud
is there any way to make commands player specific without using a database?
a config maybe
I have a "flash" command which essentially ticks a isSprinting variable to true when the command is ran
coolio
and when a player sprints (using PlayerToggleSprintEvent), it checks if isSprnting is true or not, and if it is then it applies speed to the player
but it applies speed to all players, but I want it only to apply to the player who ran the command
someone has an idea how i can configure that my minecraft (gradle) re-opens automatically when its already started? so basically i don't need to close the old instance by myself
what a nice rainbow right there 
public class InventoryGui {
public Inventory inventory;
public Inventory setInventory(Inventory inv){
inventory = Bukkit.createInventory(null,9, ChatColor.AQUA +"GUI");
ItemStack item = new ItemStack(Material.CRIMSON_DOOR);
ItemMeta meta = item.getItemMeta();
ItemStack bow1 = ItemManager.ScanArrow;
ItemStack bow2 = ItemManager.ShockArrow;
meta.setDisplayName(ChatColor.DARK_RED+"exit");
item.setItemMeta(meta);
inventory.setItem(0, bow1);
inventory.setItem(1,bow2);
inventory.setItem(8,item);
return inv;
}
}
can someone tell me whats wrong here?
im new to this and i cant find out whats wrong
lol
repo for pluginbase?
What is the error?
what are your expectations? what are you trying to achieve? is there an error? we need more informations.
probably doesnt actually set the inventory
i dont see anything wrong
u return the inventory and done it is
Probably expects it to work like that. Code out of the web maybe too? Not sure tho
oh yeah, he returns the parameter inv, not the actual inventory
Hello, I've a question. Can I run a spigot plugin on a spigot-paper server without any changement on the plugin please ?
yes
you have my permission to do
Despite me explicitly including plugin.yml in my maven build path, it isn't being included in the jar
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
<finalName>Libabel</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
[01:18:13] [Server thread/ERROR]: Could not load 'plugins/Libabel.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:384) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:232) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:986) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot.jar:3111-Spigot-66f9d3c-cbf2f67]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
using InteliJ?
building with Artifacts?
I run this
Those are Artifacts
so yes
Wrong place
Menu very right of screen
labeled as maven
in there under lifecycles, use Package
your jar will then be placed in a folder called Target
^ and make sure your plugin.yml is in the resource folder
it is
@eternal oxide this is on run of package
read the log and see where it failed
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ Libabel ---
it failed here
?paste your log and your pom
Send full log
there is a paste link
?paste
Please..
Try adding in your <build> <defaultGoal>clean package</defaultGoal>
you use ${java.version} but don't define it as a property
it def what I said
this did not change anything
what should I add and where
^
Should definitely be learning what you pasting
that worked, thanks
Also the first result on google btw
testCompile failed: multiple points is what I searched
this is my first time ever using maven. I tried using gradle but got trapped in hell for 3 straight hours trying to debug it, so I vowed to never use package managers again. Until now.
Yeah, beginning Maven is easiest
Gradle is more for Business and large group projects.
I dm'd you a possible fix
Is there any ArmorEquipEvent lib that works on 1.16.x?
The usual should work
Nah https://www.spigotmc.org/resources/lib-armorequipevent.5478/ ain't working
It's not?
Nope
Ah it got abandoned
Yup
You can always fork it I guess...
now, say I wanted to always copy the jar to my test server's plugin folder. Is there a way to do that after building through maven?
I guess
in intellij
Or try getting the one from Paper (I think..)
I could just write a bash script, but I want to do it through the press of a button in intelliJ
Wdym?
Don't they have that added to their API
You can try using theirs and moving it in to your plugin
You can set the outputDirectory property
that did not work...
just, adding the directory I want the jar to be?
Show what you did
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<java.version>16</java.version>
<outputDirectory>../SpigotTestServer/plugins/</outputDirectory>
</properties>
I added it to outputDirectory
It should be in build not properties
ok
that does not put the jar there, that puts a compiled copy of all files included in the jar there
Hm might have to be in the jar or compile plugin configuration then..
Try Google
I'm not home atm
#general message @rocky glacier
what kinds of errors are you having?
"cannot be resolved to a type"
do you have spigot in your project?
You're giving us nothing to work with
Means a missing import
decompiled code
Whats the problem when it says "cannot be resolved to a type -> net.milkbowl.vault.economy"
did you decompile your own stuff
You're missing vault as a dependency
wait im sending decompile
also, fyi, I am like 90% sure that using an external currency to directly buy in-game currency violates mojang TOS.
it buys BTC but w/in-game money
Probably
This seems to just be using the Bitcoin name
It looks like its a random chance of mining Bitcoins (in game) when mining with the correct tool
yh exactly
thats true
pretty cool
thx
you don't have vault in your project, it sounds like
are you using an IDE, like intellij?
IDE
Integrated development environment
ah lol i use eclipse
Add Vault as a dependency
download and import the jar, or use a package manager like gradle or maven
Eclipse has maven built in
So does Intellij
Not sure that helps him as he's using eclipse 😉
True 😉
ough how do i do that agian with maven
If you're just quickly modifying a plugin it's probably easier to just add dependencies manually by importing the jar
you don;t need a manifest
so just maven/me.bitnet/BtcMining/ -> pom.properties + pom.xml
@EventHandler
public void tntHitEvent(ProjectileHitEvent e){
if (e.getEntity() instanceof TNTPrimed){
TNTPrimed t = (TNTPrimed) e.getEntity();
t.setFuseTicks(0);
}
}
``` gosh
i am trying to make tnt explode when touched the ground
no errors
it doesnt work
Tnt isn't a projectile
How to do that again
Yes
hey there,
would this packet https://wiki.vg/Protocol#Advancements be the right packet for sending a fake advancement (right above thing) ?
what should i do then?
Tick it's location or smth
what is this supposed to do
Explode when tnt hits block
Just do a while entity isvalid loop and check if the block directly below it is set or not
i am trying to make tnt explode when it touches the ground
whaa
Use a scheduler and loop all tnt
i am new to spigot and i have no idea what you are talking about
seems like you are not only new to spigot
wait i got it
BukkitScheduler scheduler = main.getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(main, new Runnable() {
@Override
public void run() {
if (tnt.isOnGround()){
tnt.setFuseTicks(0);
}
}
}, 0L, 20L);
something like this?
This
it works lol
i'll use the scheduler more often
Wow first guy in a while to use Plugin#getServer and not Bukkit big credit to you
that's not DI purism enough
🥲
they should inject main and the scheduler separately as they're separate dependencies
every constructor MUST have at least 25 parameters or it isn't proper DI
Good point lmao
i actually made throwable dynamites 😳
do throwable intercontinential ballistic missiles
Do throwable confetti 
?paste
Is there a difference?
its like tbh and to be honest.
tbh is over Bukkit
to be honest is the other way around
So bukkit is just the lazy version
